Debian/Ubuntu Tips and Tricks

Debuntu

Debian/Ubuntu Tips and Tricks

Secure your SSH server with Public/Private key authentification

Posted by chantra on 11th January 2007

Open SSH is the most widely used SSH server on Linux. Using SSH, one can connect to a remote host and gain a shell access on it in a secure manner as all traffic is encrypted.

A neat feature of open SSH is to authenticate a user using a public/private key pair to log into the remote host. By doing so, you won't be prompted for the remote user's password.

This tutorial will describe how to create a SSH public/private key pair, how to enable key based authentication and finally how to disable password authentication.

Read the rest of this entry »

Tags: , ,
Posted in Administration, HowTo, Networking | No Comments »

Secure your SSH server with Public/Private key authentification — page 2

Posted by chantra on 11th January 2007

2. Adding the public key to the authorized key

In the first place, we need to upload the key to the remote machine:

user@host:~$ scp ~/.ssh/id_rsa.pub remoteuser@remotehost:~/

Now, the public key is uploaded, let's add it to the authorized keys. To do so, we are going to connect to remotehost as remoteuser and add the key at the end of file ~/.ssh/authorized_keys and delete it once added:

Read the rest of this entry »

Tags: , ,
Posted in Administration, HowTo, Networking | No Comments »

Secure your SSH server with Public/Private key authentification — page 3

Posted by chantra on 11th January 2007

4. Disabling Authentication by password

In order to disable authentication by password, we need to connect as root on the remote machine. On connected, go and edit /etc/ssh/sshd_config and make sure you have the following setting:

....
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
...

Read the rest of this entry »

Tags: , ,
Posted in Administration, HowTo, Networking | No Comments »