SSH Lab - Configuriamo un demone SSH per l'utilizzo di chiavi RSA

Bene , una volta capito cosa siano le chiavi RSA passiamo alla configurazione del nostro server e rendiamo possibile l'accesso alla macchina solo dal nostro client Windows utilizzando la famosissima shell PUTTY .
Step :
1 - Generazione delle chiavi (pubblica e privata)
2 - Inserimento della chiave pubblica in quelle accettate dal server
3 - Modifica di ssh_conf in modo che accetti solo connessioni autenticate da chiavi
4 - Copia della chiave sul client windows
5 - conversione della chiave linux in formato windows - PUTTY
6 - TEST
Step 1
Generiamo le chiavi sul server con il comando ssh-keygen
mydesktop$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/xahria/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): (enter passphrase)
Enter same passphrase again: (enter passphrase)
Your identification has been saved in /home/xahria/.ssh/id_rsa.
Your public key has been saved in /home/xahria/.ssh/id_rsa.pub.
The key fingerprint is:
2c:3f:a4:be:46:23:47:19:f7:dc:74:9b:69:24:4a:44 xahria@mydesktop
mydesktop$ cd $HOME/.ssh
mydesktop$ ls -l
-rw------- 1 xahria hatchclan 883 Jan 21 11:52 id_rsa
-rw-r--r-- 1 xahria hatchclan 223 Jan 21 11:52 id_rsa.pub
Step 2
cat ../id_rsa_mydesktop.pub >> authorized_keys
Step 3
sshd_config:
# Should we allow Identity (SSH version 1) authentication?
RSAAuthentication yes
# Should we allow Pubkey (SSH version 2) authentication?
PubkeyAuthentication yes
# Where do we look for authorized public keys?
# If it doesn't start with a slash, then it is
# relative to the user's home directory
AuthorizedKeysFile .ssh/authorized_keys
step 4
copiare il file id_rsa sul client windows
step 5
Scaricare puttygen e convertire tale file nel formato putty
Lanciare putty ed impostare l'utilizzo di tale chiave
step 6
Effettuare un collegamento al server
