Setting up a CentOS 7 cloud server for a client, and have run into an issue with setting it to use a public RSA key instead of a password for one of a handful of SFTP users.
Found an online guide on setting up keys at:
The client supplied a public key file, which I copied to the server using the "ssh-copy-id" command. All good according to the responses I got.
I then locked the account using the "passwd -l" command. Reset the server and checked, and the system confirms that the password is locked:
testuser1 LK 2018-09-17 0 99999 7 -1 (Password locked.)
However, I can still log in using a password using that account on computers that do not have the private key installed.
So, I did more research, and found another tutorial that says you can force the use of RSA keys by setting PasswordAuthentication to no in the etc/ssh/sshd_config file, which raises a concern as other users do not use RSA keys for their login.
Did I do something wrong, or is there something else I can do to disable passwords for this single account? Is there a way to allow some users to use passwords while allowing others to use a RSA key?