SSH sicuro: chiavi RSA/Ed25519 e disabilitare password

发布于 20/04/2026 Linux
The Firmware Factory
广告
The Firmware Factory — 面向嵌入式设备的定制固件开发
了解更多

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!