SSH in most system by default allow public key authentication. This means that you can use your public and private key pair to log in to a server via
You can disable
SSH public key authentication on the server side if your private key has been has been compromised or for any other reason by configuring
SSHd configuration file at the terminal.
Make sure your other authentication method such as via password is enabled before proceeding as you might completely lose access to your server.
Disable public key authentication in SSH:
SSHdconfiguration file with your favourite text editor.
$ sudo vi /etc/ssh/sshd_config [sudo] password for user:
PubkeyAuthenticationand set the option to
Add the line if it doesn't already exist and remove the
# at the beginning of the line if exists.
$ sudo systemctl restart sshd
|Red Hat Enterprise Linux|
|SUSE Linux Enterprise Server|
Comment anonymously. Login not required.