KEY-BASED AUTHENTICATION USING SSH

BACKGROUND

As a foreword, it was pointed out to me my terms are all wrong. My bad, this page refers to key based authentication, not host based. I did have some notes one host based authentication, but I never got around adding them to this webpage. If you ended up here looking for host based, may I point you instead to this page. Just be aware that your paths may change depending on your flavour of OS.

So why would you want to set up key based authentication using ssh? Or better still, what is key based authentication anyway?

Key based authentication is situation of authentication takes place based on the public/private information, rather than with the more usual method of prompting for a password. This is very convient if a non-interactive process is trying to authenticate with a remote machine.

The old way was to use rsh and specify which users and machines were allowed to login remotely without a password. This is a bad way of doing it, firstly because the session passes as plain text, so is vunerable to snooping and secondly because it opens a large hole for potential IP spoofers.

SSH is the preferred way of setting up such connections now as it uses public and private key pairs to establish a secure connection. The keys and encryption methods make it extremely difficult for IP spoofers to generate a connection and since it is secure, you do not need to worry about data being sniffed.

The downside to establishing such a situation is a decrease in security. Once someone is on as that user on one machine, they are on all of the machines where it has been set up.


INSTALLING

Installation is a two step process, taking place on the two machines.

On Machine "A" (The from machine), generate your key pair using ssh-keygen

	ssh-keygen -t dsa 
This will create two files:
	~/.ssh/id_dsa
	~/.ssh/id_dsa.pub


Log onto "to" machine :

	ssh-dss AAAAB3NzaC1kc3MAAAC+CLO2M9OfcIjEaFBJ+cNAubJeCw8dtlHn1aKKN
	3i9p4YA4w+cXVvOoD6RVD2TLudLu5av8WLiePZemUws7F4Z6hj4XHVA09Oxzneetf
	9c4XoMiSLrkEaTzwFkQmefU3Jo4dQtK94rLqezd7ljs6/A91RpWSIQ0e4gYpl6fql
	sUx51AAAAFQDpN1MHahy7NuCTG7g6PmsZcMN47QAAAIBhV7zbd4tPi0IqJSk3d8K4
	VHb6udU+ofyTOM92E/vCO2fk392dqrxvo65ly5kYKlaMKFSYZ3GdFyAUJlf47hdra
	KgoxSR6xBqin9a8vq9q5EW+hMSXAJlD1/zeXydnmuxpVTTK/Lu9yTcEKuKsiHR9Ml
	XBmEqc5Cr/OQV83tehxQAAAIBIJp6sNFd4eFUxSQmfuMS56Cw5rbui8hDBNb5ViwS
	LGZFxuHquCyaqr81Y4dNecNUrlU+m6cXLvMY5SlspnBTuDCKGOIQmSsoiNnjOhYO4
	iWLKPN6hTYlmee+fqG2BJ24zE8sLB5t1KiqGKm4VUvaNGSDtDHMLeCz+qqH6H7LPI
	A== fred@somemachine.somewhere.com


TROUBLESHOOTING

What to look at if it doesn't work


Back to top
Back to index


Conventions of this document:
This font indicates information typed by the user 
This font and colour represents data within files, either edited or produced
This font shows screen output
This font and color represent filenames
And this is the colour of normal text.