Installing SSH server in Kubuntu

Install

Run in console:

sudo apt-get install openssh-server openssh-client


Configure SSH server

Run in console:
sudo kate /etc/ssh/sshd_config

Change the following line
PasswordAuthentication yes

to
PasswordAuthentication no

in order to disable clear text password authentication.

Run in console:
/etc/init.d/ssh reload

Now the configuration is reloaded.

Setup keys

Run in console:
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -q -f ~/.ssh/id_rsa -t rsa

Enter a passphrase for that. You have to use it when connecting from a client.
Now the public key is placed in ~/.ssh/id_rsa.pub, while the private key in ~/.ssh/id_rsa.

Run in console:
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
rm ~/.ssh/id_rsa.pub
chmod go-rwx ~/.ssh/*

Now the public key is appended to the ~/.ssh/authorized_keys file.

Setup client

Copy the ~/.ssh/id_rsa file to the client and use it as the private key.

Done!

Posted byWill Tang at 9:28 AM  

0 comments:

Post a Comment