Use vipw(8) to set the user's password to "*", as in this example:martin_ said:How to remove user password and thus block user from log[red]g[/red]ingto[red]in with[/red] ssh (i[red]I[/red] use key to log in)?
fonz:[b][red]*[/red][/b]:1001:10000::0:0:A.J. "Fonz" van Werven:/home/fonz:/bin/tcsh
Of course it does. That's normal behaviour.martin_ said:I tried it to be empty, but funny thing happens - it lets me in with no password.
Also look at PasswordAuthentication and ChallengeResponseAuthentication, to be found in /etc/ssh/sshd_config and explained in the manpage sshd_config(5).fluca1978 said:Please consider that OpenSSH has specific options for AllowUsers and DenyUsers.
# pw usermod name -h -
If a value of ‘-’ is given as the argument fd, then the
password will be set to ‘*’, rendering the account inaccesâ€
sible via password-based login.
johnd said:Why not just use
# pw lock name
# pw unlock name
Very easy to remember.
No, the question was to prevent the user from logging in using a password and to only allow logging in over SSH using a keyfile.fluca1978 said:Not sure but the question was to prevent the user to log in via ssh,
fonz said:No, the question was to prevent the user from logging in using a password and to only allow logging in over SSH using a keyfile.