Client can authenticate with `sshd` through one of following
authentication methods (corresponding sshd_config option in brackets):
- host-based (`HostbasedAuthentication`),
- public key (`PubkeyAuthentication`),
- challenge-response (`ChallengeResponseAuthentication`),
- password (`PasswordAuthentication`).
By default, only `PubkeyAuthentication` and `PasswordAuthentication`
are enabled. This commit disables `PasswordAuthentication`. Users
can now login only using public key authentication.
$ systemctl reload ssh
```
+Notes
+-----
+
+Before disabling password authentication, mark your SSH key authorized for
+public-key authentication.
+
+```
+ssh-copy-id -i ${SSH_DIR}/id_rsa user@server
+```
+
+This copies SSH public key to `user@server:~/.ssh/authorized_keys`. Don't lock
+the server account (`passwd --lock`) as it'll strip away `sudo` privileges.
+
[1] sshd :: https://linux.die.net/man/8/sshd
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
-PasswordAuthentication yes
+PasswordAuthentication no
#PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with