Mailing List Archive

ssh disable password login
sshd_config has:
...
PasswordAuthentication no

/etc/init.d/sshd restart

but still can login with password. How to disable password login?

--
Thelma
Re: ssh disable password login [ In reply to ]
On 1/18/24 17:01, thelma@sys-concept.com wrote:
> sshd_config has:
> ...
> PasswordAuthentication no
>
> /etc/init.d/sshd restart
>
> but still can login with password. How to disable password login?

Hm, most of the reference on the net mention only line: "PasswordAuthentication no"
none of them mentioned "usePAM no" need to be enabled
Re: ssh disable password login [ In reply to ]
On 1/18/24 17:01, thelma@sys-concept.com wrote:
> sshd_config has:
> ...
> PasswordAuthentication no
>
> /etc/init.d/sshd restart
>
> but still can login with password. How to disable password login?

1.)
"PasswordAuthentication no + UsePAM no" worked

I got a respond: "...Permission denied (publickey,keyboard-interactive)."

this focuses on disabling password-based authentication and the PAM system, leaving the door open for other authentication methods that don't rely on passwords.

What other authentication methods that don't rely on passwords are?

2.) but so did:
"PasswordAuthentication no + KbdInteractiveAuthentication no"

I got a respond: "...Permission denied (publickey)"

This also disables password-based authentication but goes further by explicitly turning off keyboard-interactive authentication.
This makes the authentication process non-interactive and relies on methods like public key authentication.

It seems to me, second method is preferred.