How to make sure that password authentication is disabled on SSH

After I have disabled password authentication on SSH, I want to attempt to connect with password authentication so that I confirm that password authentication is certainly disabled.

With -o option set PreferredAuthentications to password.

$ ssh -o PreferredAuthentications=password
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

If you see "Permission denied", it's OK.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.