- Linux Administration Cookbook
- Adam K. Dean
- 93字
- 2025-04-04 15:16:15
Disabling passwords (force key use)
Because we've got our public keys on this host, we no longer need to allow password-based access.
Find the PasswordAuthentication line:
#PermitEmptyPasswords no
PasswordAuthentication yes
Change this line to no:
#PermitEmptyPasswords no
PasswordAuthentication no
Restart the SSH daemon:
[vagrant@centos2 ~]$ sudo systemctl restart sshd
The eagle-eyed among you will have noticed that I already flipped this setting once, in the Vagrantfile at the start of this chapter. This was to allow us to use Vagrant as a learning experience, and we are effectively reversing the reversal right now.