How to disable public key authentication in SSH

Disable Public Key Authentication In SSH | Zoftcares Solutions

SSH server in most systems is by default configured to allow public-key authentication. The method will enable you to use your public and private key pair to log in to an SSH server without using a username.
When you are using public-key authentication in your server, then you can’t ssh from another server to your server. When you try to ssh from another server It shows like this:- 

Steps to disable public key authentication in SSH

1. Steps to disable public key authentication in SSH 
2. Open SSHd configuration file with any editor.

3. Then search for PubkeyAuthentication and set the option to yes(for enabling public key authentication) or no (to disable public key authentication). In Vi editor for searching the word “PubkeyAuthentication” enter “/” and type PubkeyAuthentication . Or in nano editor CTRL+w.

4. Then Enable Password Authentication. For enabling password authentication search the word PasswordAuthentication
then remove # on this line

And also comment (put #) on line

5. And also search the word ChallengeResponseAuthentication and disable it by adding no. 6. Then save and exit the editor. 7. Then restart ssh service by the following command 8. Now you have successfully disabled public-key authentication.
Shifna
Shifna

Senior Administrator

More To Explore

Next.js 13 Features and Updates | Zoftcares solutions
Technology

Next.js 13: New Features and Updates

Next.js, the popular React framework, has recently released its latest stable version, Next.js 13. This version comes with several new features and updates that aim to improve the developer experience

×

Hello!

Click one of our contacts below to chat on WhatsApp

×