Tuesday, May 26, 2009

How to connect to other systems securely using ssh?

There are many ways to connect to other systems. In this post I will talk about the method I use most often, ssh. Ssh is short for secure shell. Ssh is a replacement for older unsecured connection protocols such as telent or rlogin. I wont get into the history of ssh or how it works. You can look that up in many places. Instead, I'll point you at the man page for your version of ssh (man ssh).

There are commercial versions and free versions and different ways of connecting using ssh. The main thing you need to know is that it's a secure protocol and most systems have it installed. If they don't you might want to install it or go to a system that does have it installed. Also, There usually is a corresponding sftp protocol for transferring files securely. I will say this, ssh and sftp are preferred (and a lot of times required) over their older telnet and ftp unsecured ancestors.

The first time you connect to a system using ssh you will get a message like this:

somehost$ ssh someuser@someotherhost.com

The authenticity of host 'someotherhost(1.2.3.4)' can't be established.
DSA key fingerprint is 12:cf:13:5:c7:t5:gb:bg:6y:4h:34:56:6d. (fyi - this is not the real fingerprint I change it)
Are you sure you want to continue connecting (yes/no)?

(Then next time you will not get this message just a shell prompt)

Type yes and hit return, you should see:

Warning: Permanently added 'someotherhost(1.2.3.4)' (DSA) to the list of known hosts.
someuser@someotherhost.com's password:

Enter the password.

Now you will see a prompt on the other host:

someotherhost$

You are now connected to the other host and can type commands just like you can on the originating system.

No comments: