====== OpenSSH: Autenticazione a Chiave Pubblica ====== Per accedere da un client ad un server senza la seccatura di dover digitare la password, o peggio di doverla mettere in qualche script, si può usare l'autenticazione a chiave pubblica su Secure Shell (SSH). ===== Generazione della Chiave ===== Una chiave RSA deve essere generata su di un client. La parte pubblica deve poi essere copiata sul server a cui si desidera accedere, mentre quella privata rimane al sicuro (?) sul client (per le macchine linux di default in ''~/.ssh/id_rsa''). Esistono utility per generare chiavi RSA sia in ambiente Windows che Linux. ==== Linux ==== In ambiente linux possiamo generare la chiave tramite l'utility [[http://www.freebsd.org/cgi/man.cgi?query=ssh-keygen&sektion=1&manpath=OpenBSD|ssh-keygen]] o tramite [[http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html|PuttyGen]] === ssh-keygen === mkdir ~/.ssh chmod 700 ~/.ssh ssh-keygen -q -f ~/.ssh/id_rsa -t rsa # Enter passphrase (empty for no passphrase): # Enter same passphrase again: === PuttyGen === sudo apt-get install putty-tools ===== Links ===== * [[http://sial.org/howto/openssh/publickey-auth/|OpenSSH Public Key Authentication]] * [[http://blog.padraigkitterick.com/2007/09/16/using-putty-ssh-keys-with-openssh-on-ubuntu/|Using PuTTY ssh keys with OpenSSH on Ubuntu]]