How to enable passwordless logins to a server
Last modified on July 24, 2026 • 1 min read • 68 words- Enable root login with password on the server. To do so, you need to edit the file /etc/ssh/sshd_config.Modify the lines starting with “PermitRootLogin” like this:#PermitRootLogin prohibit-passwordPermitRootLogin yes
- Restart the sshd server:sudo systemctl restart sshd
- On the client, copy the public key files to the server with the ssh-copy-id command:ssh-copy-id root@server
- On the server, disable root login with password and enable root login with public key authentication:PermitRootLogin prohibit-password#PermitRootLogin yes