Monday, April 10, 2006

Host based Authentication Using SSH

HOST-BASED AUTHENTICATION USING SSH

BACKGROUND

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

Host based authentication is situation of authentication takes place based on the host 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