How to allow password authentication OR key authentication on CentOS 5.7?
Solution 1
Disabling PasswordAuthentication
doesn't force keys, it disables password authentication, as advertised.
PubkeyAuthentication
determines whether key authentication is allowed.
So, to answer your question directly, the following config allows either password or key auth:
PasswordAuthentication yes
PubkeyAuthentication yes
Solution 2
Do you mean you want something like this:
Match User user1
PasswordAuthentication no
RSAAuthentication yes
PubkeyAuthentication yes
Match User user2
PasswordAuthentication yes
RSAAuthentication no
PubkeyAuthentication no
Related videos on Youtube
Darren
Currently developing with Java, React Redux (JavaScript), and Oracle. In the past I've developed with NodeJS, PHP, MySQL, PostgreSQL, Redis, Memcached, and Angular. I'm pretty nifty implementing clients from the backend controller layer to the JavaScript/HTML/CSS frontend layer.
Updated on September 18, 2022Comments
-
Darren almost 2 years
is it possible to enable the use of password authentication or key authentication in CentOS 5.7? All I can find is setting PasswordAuthentication to no which forces the use of keys...
Thanks
-
Timo over 5 yearsWhere put the content for ? Is it in
ssh_config
? -
Davuz over 5 yearsPlace this configuration at the end of
ssh_config
-
Khom Nazid over 3 yearsIs there a way to do this for root (user1), but the other config for "everyone else"? How does one write "everyone else" in place of user2?