In the previous article, I wrote how to generate the public and private keys required for an SSH connection.
Finally, I will show you how to stop password authentication. As a result, no one can start an SSH connection with password authentication, and instead, you can start an SSH connection only with public / private key authentication.
$ sudo vi /etc/ssh/sshd_config
If you hit the above, the configuration file for ssh will be edited with vim. Search for the following in vim:
PubkeyAuthentication yes PasswordAuthentication no ChallengeResponseAuthentication no
I just mess with yes and no in the above part ... A surprising pitfall is that by default the top two commands are commented out (# ~). With this, no matter how much you change it to yes or no, it will not be reflected as a setting item lol Be sure to remove # to change and save the value.
Now, reboot the ssh system.
$ sudo systemctl restart sshd
Now try the previous article again. Perhaps password authentication is turned off.