Autologin sshAutologin ssh

Lo scopo di questo post è eliminare per sempre la fastidiosa password imposta da ssh sui pc remoti innanzitutto creiamo una chiave unica rsa che ci identifica con

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/username/.ssh/id_rsa): 
Created directory '/home/username/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/username/.ssh/id_rsa.
Your public key has been saved in /home/username/.ssh/id_rsa.pub.
The key fingerprint is:
4e:3f:15:59:3c:6d:54:7d:ff:a5:2b:56:17:fc:7d:fa username@remotehost

creiamo la cartella .ssh (se esiste non succede nulla)

$ ssh username@localhost mkdir -p .ssh
username@localhost's password:

Ora inseriamo la nuova chiave pubblica sull’ host remoto username@remotehost:.ssh/authorized_keys ed inseriamo per l’ultima volta la password:

$ cat .ssh/id_rsa.pub | ssh username@remotehost 'cat >> .ssh/authorized_keys'

da questo momento digitando

$ ssh remotehost -l username

dalla vostra macchina non vi servirà più la password!!!

The purpose of this post is eliminate the annoying passwords  from ssh connection on a remote PC First we make a public rsa key

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/username/.ssh/id_rsa): 
Created directory '/home/username/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/username/.ssh/id_rsa.
Your public key has been saved in /home/username/.ssh/id_rsa.pub.
The key fingerprint is:
4e:3f:15:59:3c:6d:54:7d:ff:a5:2b:56:17:fc:7d:fa username@remotehost

make a .ssh folder (if exist is no bad)

$ ssh username@localhost mkdir -p .ssh
username@localhost's password:

Ora inseriamo la nuova chiave pubblica sull’ host remoto username@remotehost:.ssh/authorized_keys ed inseriamo per l’ultima volta la password: Now insert the new public key on the remote host username@remotehost:.ssh/authorized_keys and enter the password for the last time:

$ cat .ssh/id_rsa.pub | ssh username@remotehost 'cat >> .ssh/authorized_keys'

from this moment onwards typing

$ ssh remotehost -l username

and no more password needed!!!