I would like to create a user and have no password. As in you cant log in with a password. I want to add keys to its authorized_keys by using root. This is for my automated backup system.
In order to block logins with password authentication, run
Any login attempt, local or remote, will result in an "incorrect password", while public key login will still be working. The account can then be unlocked with
If you want to completely lock an account without deleting it, edit
Please refer to passwd(1) man page.
Are not you asking specific to SSH daemon, not to accept the password based authentication but the key/passphrase authentication?
Look for changes to
Look for more config parameters at man ssh_config
Just don't set password for user. If there is already a password remove it by using
But it would be still possible to log in as this user - by using authorized_keys, or via su or sudo from some privileged account.