Thursday, 15 February 2007

Using public keys for SSH authentication

With the ssh freeware utilities we can login on a Ubuntu server without type a password.
Example :

follow these steps:

user@hostname:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): (type nothing)
Enter same passphrase again: (type nothing)
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/
The key fingerprint is:
2e:24:d1:d9:f2:43:fc:6c:89:91:be:7e:db:a5:99:bf user@hostname
user@hostname:~$ scp /home/user/.ssh/ root@server_hostname:/root/authorized_keys
root@server_hostname's password: (type password of root ) 100% 408 0.4KB/s 00:00
user@hostname:~$ ssh -l root server_hostname
root@server_hostname's password: (type password of root )
user@server_hostname:~$ mkdir .ssh
user@server_hostname:~$ mv authorized_keys .ssh/
user@server_hostname:~$ exit
Connection to server_hostname closed.
user@hostname:~$ ssh root@server_hostname
user@server_hostname:~$ You enter in the server without type a password !!!!!!!!!!!!!!

Labels: , ,


Anonymous Rachelle said...

Good for people to know.

11 November 2008 at 08:00  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home