Chiavi RSA
Con RSA usa questo comando:
ssh-keygen -t rsa -b 4096 -C "tuo_nome_o_email"
Spiegazione:
- -t rsa → tipo di chiave RSA
- -b 4096 → lunghezza consigliata
- -C → commento facoltativo
Poi:
- premi Invio per salvarla nel percorso predefinito
- scegli una passphrase oppure premi Invio per lasciarla vuota
Di solito i file creati sono:
~/.ssh/id_rsa ~/.ssh/id_rsa.pub
Per vedere la chiave pubblica:
cat ~/.ssh/id_rsa.pub
Per copiarla su un server:
ssh-copy-id -i ~/.ssh/id_rsa.pub utente@server
Se vuoi usare un nome file diverso:
ssh-keygen -t rsa -b 4096 -f ~/.ssh/mia_chiave_rsa -C "tuo_nome_o_email"