Skip to main content

Command Palette

Search for a command to run...

FTP vs SFTP vs SCP vs SSH: Which One to Use?

Easy guide to connect to remote servers

Updated
2 min read
FTP vs SFTP vs SCP vs SSH: Which One to Use?
M

junior dev

Have you ever wondered how to connect to a remote host? This guide introduces essential commands for connecting to remote machines. We'll explore three key network protocols: FTP, SCP, and SSH.

FTP/SFTP

File Transfer Protocol (FTP) is used to transfer files between a server and a client. SSH File Transfer Protocol (SFTP) is a newer, more secure version of FTP. For this reason, SFTP is the preferred choice whenever possible.

To connect to a remote server using SFTP:

sftp username@server

Once you've entered your password and connected to the remote server, you can use commands like GET or PUT to transfer files. Type help to view all available commands.

SCP

Secure Copy Protocol (SCP) lets you copy files between a server and a client, or between two servers.

To copy a file from a client to a server:

scp hello.txt username@server:/home

To copy a file from a server to a client:

scp username@server:hello.txt /home

To copy a file from one server to another:

scp username@server1:hello.txt username@server2:/home

The SCP command is easy to remember because it works similarly to the cp command:

cp source destination
scp local_file server:directory # copy file from local to server
scp server:file directory # copy file from server to local

SSH

Secure Shell Protocol (SSH) lets you connect to a remote server and run almost any command, not just transfer files. To access the remote server, use the following command:

ssh username@server

After logging in, you can do almost anything to interact with the server.

Conclusion

The three protocols mentioned above are some of the most commonly used for accessing a remote server. There are many other network commands and protocols in use. If you are interested in learning how networks work, you should definitely explore them, such as rsync and SMB. Another useful tool for file transfer is cURL, a command line tool for sending or receiving files that supports numerous protocols.

221 views
D
dyllann3y ago

Guys, can you please recommend me some reliable ftp clients right now? I need your assistance right now here. Thanks in advance for your help.

M
Martin3y ago

Hi there, I assume you want a FTP client with GUI. If so, WinSCP is a pretty good FTP client on Windows. If you are on different platforms, you may try FileZilla or other alternatives.

D
dyllann3y ago

Thank you a lot for this informative article here but can someone here please recommend me some good ftp clients right here? Thanks in advance.

L
liamm3y ago

Dyllann, hello there. I have already used some of different clients and it seems to me that if you are searching for a good one then you definitely need to check this turboftp one with the ftp sync because it looks pretty reliable and I loved using their service there. Hope that it will be useful for you.