How to Connect to an External SFTP Server Using Midnight Commander

On this page
  1. Prerequisites
  2. Step 1: Launch Midnight Commander
  3. Step 2: Open the Connection Menu
  4. Step 3: Enter the Connection Details
  5. Step 4: Enter Your Password
  6. Step 5: Browse the Remote Server
  7. Step 6: Copy Files Between Servers
  8. Useful Keyboard Shortcuts
  9. Troubleshooting
  10. Connection Failed
  11. Authentication Error
  12. Permission Denied
  13. Summary

In situations where you need to transfer files directly between two servers that support SSH access, Midnight Commander (MC) provides a convenient way to establish an SFTP connection without first downloading files to your local computer.

This method is particularly useful for:

  • Website migrations
  • Backup transfers
  • Copying files between hosting accounts
  • Moving large amounts of data between servers

Prerequisites

Before you begin, make sure you have:

  • SSH access to your mybox account
  • The remote server’s hostname or IP address
  • A valid username on the remote server
  • The corresponding password or SSH key

Step 1: Launch Midnight Commander

After connecting to your hosting account via SSH, start Midnight Commander by running:

mc

The Midnight Commander interface will open with two file panels.

Step 2: Open the Connection Menu

Choose the panel where you want the remote server to appear.

From the top menu, select:

Left

or

Right

depending on which panel you want to use.

Then select:

SFTP Link...

or

FTP Link...

For secure SSH communication, use:

SFTP Link...

Step 3: Enter the Connection Details

In the connection window, enter the remote server information using the following format:

sh://username@server-address

Example:

sh://john@example-server.com

or

sh://backupuser@192.168.1.100

Press:

Enter

or click:

OK

to continue.

Step 4: Enter Your Password

Midnight Commander will prompt you to enter the password for the remote account.

The password prompt typically appears in the lower status bar of the application.

Enter the password and press:

Enter

Step 5: Browse the Remote Server

If the credentials are correct, Midnight Commander will establish the SFTP connection and display the remote server’s directory structure in the selected panel.

You can now:

  • Browse files and directories
  • Create folders
  • Rename files
  • Delete files (if permissions allow)

Step 6: Copy Files Between Servers

To transfer files:

  1. Navigate to the desired file or folder.
  2. Highlight the item.
  3. Press:
F5

or select:

Copy

from the bottom menu.

  1. Confirm the destination path.

Midnight Commander will transfer the files directly between the servers without storing them on your local computer.

Useful Keyboard Shortcuts

Key Function
F5 Copy
F6 Move / Rename
F7 Create Directory
F8 Delete
TAB Switch between panels
F10 Exit Midnight Commander

Troubleshooting

Connection Failed

Verify:

  • The hostname is correct.
  • SSH access is enabled on the remote server.
  • Port 22 is accessible.
  • The username is valid.

Authentication Error

Check:

  • Username spelling
  • Password accuracy
  • Whether the account supports SSH/SFTP access

Permission Denied

You may not have sufficient permissions to access the requested directory or file.

Contact the server administrator if necessary.

Summary

To connect to an external server via SFTP using Midnight Commander:

  1. Connect to your hosting account using SSH.
  2. Run:
mc
  1. Open Left or Right → SFTP Link.
  2. Enter:
sh://username@server-address
  1. Enter your password.
  2. Browse the remote server.
  3. Use F5 to copy files directly between servers.

This method provides a fast and convenient way to transfer files between SSH-enabled servers without using an FTP client on your local machine.

Didn't find an answer?

Our support team is here for you 24/7 – write to us and we will help you sort it out.