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 Users Found This Useful
Was this answer helpful?

Related Articles

Linux tar Command

The Linux tar command is used to compress and extract files to and from an archive. In this...

How to Install WordPress via SSH

Since WordPress is the most widely used CMS it’s installation process has been made as simple and...

SSH Execute Command on a Remote server

Via SSH you can connect to a remote server’s shell. This will allow you to execute commands on...

How to connect to your shared hosting account via SFTP with FileZilla

SFTP is a convenient way to use SSH, while also using the interface of a simple FTP. In order to...

SSH netstat command

If you wish to debug or track statistics of your network in a Linux environment you can use SSH...