You are currently browsing the archives for the VPS category.

Archive for the ‘VPS’ Category

Disable Password Authentication

Disable Password Auth, Follow these steps….

Once you have SSH Keys configured, you can add some extra security to your server by disabling password authentication for SSH. (Note that if you do lose your private key, this will make the server inaccessible and you will need to contact your host to have this re-enabled.)

To disable this setting, you can do the following:

nano /etc/ssh/sshd_config

In this file, set the following settings to the following values. If these settings are already in the file, set them to “no” rather than add new lines.

ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no

Once this is done, restart the SSH daemon to apply the settings.

/etc/init.d/sshd restart

Save a Public Key on your Centos Server or VPS

Save a Public Key on your Centos Server or VPS

  1. Log in to your destination server
  2. If your SSH folder does not yet exist, create it manually:

mkdir ~/.ssh

chmod 0700 ~/.ssh

touch ~/.ssh/authorized_keys

chmod 0644 ~/.ssh/authorized_keys