Difference between SSH and SFTP

1. Introduction

SSH and SFTP are two peas in a pod regarding secure communication and file transfer between computers. They’re like Batman and Robin, the dynamic duo of secure networking, always ready to thwart evil hackers and keep your data safe from harm.

2. What is SSH

SSH is a cool, calm, and collected protocol that lets you easily access a computer. It’s like a teleportation device that lets you instantly transport yourself to a remote machine and execute commands as if you were right there. It’s the perfect way to stay connected with your computer while on the go, like having a tiny computer butler in your pocket. SSH provides a secure alternative to Telnet, which transmits all data in clear text and is therefore vulnerable to interception and eavesdropping.

3. What is SFTP

SFTP, on the other hand, is like the FedEx of the secure file transfer. It’s reliable, fast, and always delivers your files safely and sound. Think of it like a magical file transporter that zips your files across the internet, through a secure tunnel, and drops them off at their destination with a little „ping!“ sound. It’s like having your own personal courier service, without the need for a fancy suit and tie. SFTP uses SSH for a save connection as its underlying protocol, therefore SFTP is built on top of SSH.

4. How to connect to SSH Server?

To connect to an SSH-Server, you need an SSH-Client. There are several SSH-Clients available like OpenSSH, Putty, etc. Since Windows 10, you can also use the normal terminal, since it has also integrated the SSH-Client. For Linux or Mac you can also just open the terminal.

Type the following command to connect to a server:

ssh username@ssh_server_ip_addres

e.g. ssh hello@10.19.55 (default port is 22)

5. How to connect to SSH Server using a key file?

If you don’t want to login with the user/password authentication, you can use a keyfile.

Therefore you first have to generate a key-file with the command „ssh-keygen„. Copy the public key (usually found in a file named id_rsa.pub or id_dsa.pub) to the remote SSH server by appending it to the file ~/.ssh/authorized_keys. You can use the ssh-copy-id command on Linux or macOS to automatically copy the public key to the remote server.

Then type the following command to connect to the server:

ssh -i /path/to/private/keyfile username@ssh_server_ip_addres

If everything is setup correctly, you should connect to the SSH Server.

Kommentar verfassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Scroll to Top