How to connect to SFTP location using Terminal command

connect to the SFTP location using Terminal command

In order to comment to an SFTP remote location using the Terminal, you can make use of the SFTP Terminal Command by providing the username followed by an @ (at sign) and the domain of the location you want to connect.

% sftp

( Password: 

Connected to

You will be prompted to enter the password and once you do that, you will see a message that you are connected and the prompt will change to sftp>

The SFTP protocol makes use of the SSH Protocol for authentication.

If you have the IP address instead of the domain name provided, then you can use username@IP-address instead,

Example: Connect to SFTP destination using IP address,
% sftp user@

(user@ Password: 

Connected to

✏️ The examples provided were performed on macOS Terminal Zsh Shell, but should work with all Linux/Unix Kernal Shells.

Try Out Code2care Dev Tools:


Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and software developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include learnings, tutorials, trouble-shooting steps, video tutorials, code snippets, how-to, blogs, articles, etc.

🎉 We are celebrating the 10th years of Code2care! Thank you for all your support!

We strongly support Gender Equality & Diversity.