Translate

April 18, 2013

Install ssh on ubuntu

Install ssh with
sudo apt-get install ssh

Say yes to everything it asks you to install.
Note, you will now have an /etc/ssh/ directory under which you will find a ssh_config and sshd_config file you may have to uncomment a few lines in later.
You then want to run this command:
ssh-keygen -t rsa 

On safer side, it is a good idea to throw a pass phrase in there. For little security.  Make sure it is difficult to guess and NOT the same as your log in password.
Note, it should default to generating 2048 bit encryption which is always better than 1024. You will get a public and private file i.e.
id_rsa and id_rsa.pub
You put the id_rsa which is the private key, in the ~/.ssh directory. You put the public key one up on the server you are remotely connecting too. You can cut and paste it in usually. Make sure you do not introduce any unwanted white space in it. DO NOT put the private key one up on the server you are connecting too.

Troubleshooting:
You may need to restart the service/deamon with
sudo service ssh restart 

This would be necessary if you changed anything in one of the config files. Make sure your permissions are right on the ~./.ssh directory and the files in there.
drwx------ # for .ssh directory
-rw------- # id_rsa for the private key 


Now type from your Ubuntu prompt:
ssh username@yourhost.com

No comments: