How to Transfer Files Between a Mac and a Remote Server Using FTP or SFTP

Stackademic

Transferring files from your Mac to a remote server and vice versa is a routine operation performed by freelance professionals, websites’ owners, designers, and writers. You may need to transfer the files approved by a client or pull some documents that have been uploaded on your hosting account. Transferring files is quite easy if you get authorized access to the server, proper connection parameters, and methods of transfer. You can connect to the server graphically using any file transfer client or via command line using macOS Terminal application and move files in any direction.

FTP vs. SFTP: Which Should You Use on Mac?

Both FTP and SFTP can be used for transferring files from one computer to another, but their security features vary.

FTP stands for File Transfer Protocol. It's a conventional way of sending and receiving files on remote servers. In general, standard FTP doesn't encrypt login credentials or file content during file transfer, so it isn't safe for sensitive information.

SFTP stands for Secure FTP, as it uses SSH (Secure Shell) to create an encrypted connection. Authentication details and transferred data will be secure on their way between your Mac and the server. If a server supports SFTP, it's the better choice.

There's also FTPS that secures FTP connections through TLS encryption. FTPS and SFTP are different protocols, so it depends on what type of connection the server supports.

Protocols supported by the server are decided by your hosting provider or server administrator. You can't assume that an SFTP connection will work just because the server allows FTP connections.

What You Need Before Connecting to a Remote Server

Before starting, collect the connection information from your hosting control panel, server administrator, or IT contact. You will generally need:

  • Hostname or IP address: Identifies the remote server.
  • Port: SFTP commonly uses port 22, while standard FTP typically uses port 21. Your server may use a different port.
  • Username: The account authorized to access the server.
  • Authentication method: A password or an SSH key, depending on the server's configuration.
  • Remote destination folder: The directory where uploaded files should be stored.
  • Permissions: Access rights that allow you to read, upload, or modify the necessary files.

You should also identify the local folder on your Mac containing the files you intend to transfer.

In the following example used in this tutorial, assume that a designer has approved two files for the project, namely handoff.pdf and logo.svg, which reside in a folder called Client-Delivery. The designer must upload the two files to the SFTP server and download another file called review-notes.txt.

The local path ~/Documents/Client-Delivery/ and remote path /incoming/client-delivery/ used below are illustrative examples only. Your actual remote directory depends on the server configuration and account permissions.

Also differentiate between the original login directory of the server and the desired one. A successful connection does not necessarily imply that you have reached the desired directory already. In some cases, the account will open in a limited directory, while in others, you may need to go to a particular directory.

How to Upload and Download Files with Commander One

A graphical interface makes the process of file transfers from the remote computer clearer, as you may see your Mac files and the server files separately in different windows. One Commander is an example of software that enables you to connect to FTP, SFTP, and FTPS servers via a dual-pane window. This software's remote server connections need PRO capabilities. The free mode offers only local file management features.

For a visual overview of the connection process, consult Commander One's ftp manager mac guide.

Follow these steps to complete the designer's transfer.

1. Open Connections Manager

Start up Commander One and bring out the Connections Manager from the toolbar menu or Window → Connections Manager menu. This is where you set up the connection with the remote server.

2. Select the connection option and protocol

Select FTP & SFTP for the connection type and then choose SFTP for the connection protocol. These two are different from each other: the former allows access to the connection settings, whereas the latter is the protocol selected.

3. Enter the server details

Provide the hostname, port, user name, and authentication credentials provided by the administrator. Port number 22 should be used only if the same is configured on the server. Provide the remote directory to which you wish to connect if the connection form has a remote-path option.

4. Connect and identify both locations

Once the connection has been made, use one window pane to show the local Client-Delivery folder and the other to show the remote directory /incoming/client-delivery/. Check the full path in each pane. Don’t assume that just because a folder with the correct name is in the right place.

5. Upload the approved assets

Select handoff.pdf and logo.svg from the local pane. Transfer them using drag-and-drop or copy functionality offered by the application interface to the remote pane. Ensure that the destination is the correct client delivery folder prior to performing the transfer action.

6. Download the review document

In the remote pane, find review-notes.txt. Highlight it and then copy it to the local Client-Delivery folder. In case there is a file with the same name in the local folder, make sure to check what’s inside it.

7. Verify both transfers

Revisit the remote directory and verify that handoff.pdf and logo.svg are among the files contained there. Next, visit the local directory to ensure that review-notes.txt is present. Compare file sizes or view the files as necessary to ensure that the right information was transferred.

This process gives you an easy way to track both ends of the transfer without switching between your local file viewer and your remote connection.

How to Transfer Files Using macOS Terminal

Another useful way of accomplishing this that is available to command-line users is by using the macOS Terminal. The sftp program included in macOS Terminal can transfer files via SFTP.

Open Terminal and connect using the server details supplied by your administrator:

sftp user@example.com

Change user@example.com to the proper username and hostname. In case the server is running on an unusual port number, check the relevant port option with sftp command documentation. Authentication should be done as per your account settings.

Once connected, you can use commands to navigate and transfer files:

pwd

cd /incoming/client-delivery

ls

lcd ~/Documents/Client-Delivery

put handoff.pdf

put logo.svg

get review-notes.txt ~/Documents/Client-Delivery/review-notes.txt

ls

bye

In this case, pwd, cd, and ls work at the remote server, as they show you the remote working directory, allow you to change the directory, and list its contents. As for lcd, it changes the local working directory on your Mac.

With put, you will upload both project resources from the local directory to the remote directory. With get, you will download the remote review document to the specified local path. Lastly, bye will end your SFTP session.

The example considers the existence of the remote directory, permission to access it, and availability of the local files. If the remote server uses other directories or login methods, use another set of commands. Just being connected to the server doesn’t mean that all the files are uploaded or downloaded.

How to Check a Transfer and Avoid Accidental Overwrites

Verifying information is necessary for file transfers. The completion message shows that the task is completed; however, one should make sure that the destination and contents are verified.

For the designer's example, check the following:

  • Remote destination: Confirm that both handoff.pdf and logo.svg appear in /incoming/client-delivery/, or the actual authorized target directory.
  • Local destination: Confirm that review-notes.txt appears inside ~/Documents/Client-Delivery/.
  • File details: Compare sizes, timestamps, or content when useful. Open documents or preview assets if you need to confirm that the correct versions arrived.
  • Existing files: Before replacing a file, preserve the original or compare versions so that important work is not lost.

In case of failure during the process, make sure you check both sites prior to resuming the task. It may be possible that some files are transferred partially, depending on the system used. Look into their content and size and decide what action you want to take.

Common FTP/SFTP Transfer Problems on Mac

Transfer issues generally relate to connection information, authentication, permissions, or wrong path.

  • Authentication failure: Check the credentials or SSH key settings. If still no access is granted, ask the administrator to make sure that the account exists.
  • Connection refused or timeout: Ensure that the right hostname, port number, network access, and protocol type have been provided. An FTP server may not allow SFTP access.
  • Access denied: Check whether you have the required permissions to access the source directory or write to the destination. You should request proper access and not try to override the permissions.
  • File not found: Make sure that you are in the right directory on a local or remote system. Relative path relies on the working directory at the time of operation.
  • Incompletely transferred file: Check connection information, the size of the target file, and disk space. Transfer again if possible.

Specific to FTP, active and passive connection types may impact the transfers if data connections are limited due to firewall or network settings. SFTP does not have FTP's active/passive modes.

Which Transfer Method Fits Your Workflow?

This entirely depends on your objective and personal preferences. While Finder may enable you to browse through FTP sites in a read-only mode, it doesn't qualify as a good FTP upload application. The terminal will come handy for direct transfers and command line operations. Graphical FTP clients like Commander One will be more comfortable to use if you wish to transfer your folders next to each other and pick files visually.

Nevertheless, none of these methods will serve as an alternative to thorough deployment and backup procedures in case they're necessary. But for casual file transfers between projects, any of them will do.

Conclusion

The procedure of transferring files from one Mac machine to another via remote servers is an easy task. All that needs to be done is choosing the right protocol, logging in through proper credentials, finding the right destination, transferring the files, and ensuring whether or not the process has been successfully completed. If possible, always try to use SFTP protocol for transferring files.