Generare la chiave
Sul client:
ssh-keygen -t ed25519 -C "tua.email@example.com"
Accetta il path di default (~/.ssh/id_ed25519) e scegli una passphrase.
Installarla sul server
ssh-copy-id utente@server
Dopo questo comando prova: ssh utente@server → entra senza chiederti la password.
Disabilitare password
Sul server, modifica /etc/ssh/sshd_config:
PasswordAuthentication no PubkeyAuthentication yes PermitRootLogin prohibit-password
Poi sudo systemctl reload sshd. Test prima di chiudere la sessione corrente!