Disable SSH password authentication on your VPS

We will begin by editing your SSH servers configuration

file: /etc/ssh/sshd_config

vi /etc/ssh/sshd_config

Confirm the following lines are set to yes (these are normally enabled by default and may be commented out):

RSAAuthentication yes
PubkeyAuthentication yes

***Make sure your SSH keys are working properly. If they are not you will be unable to log back in via SSH!***

Now change the below line to disable PasswordAuthentication and only allow access for ssh keys.

PasswordAuthentication yes

change this to:

PasswordAuthentication no

Now lets restart the SSH service

service sshd restart

Your SSH server should now be locked down to only allow access via SSH key authentication.

  • 0 istifadəçi bunu faydalı hesab edir
Bu cavab sizə kömək etdi?

Uyğun məqalələr

SSH ip command

If you wish to obtain information about your server’s IP on a Linux machine using SSH you can use...

SSH rm command

If you wish to remove a file or folder from your Linux system you can use SSH rm command. In this...

SSH echo command

One of the most useful commands in a Linux environment is echo. With it, you can provide output...

SSH history command

If you wish to find what commands you have previously executed in a Linux environment you can use...

SSH cd command

SSH cd command is mainly used to navigate in your Linux environment. In this article, we’ll show...

Powered by WHMCompleteSolution