This page will serve as an introduction to SSH.
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
For a little added security, it is a good idea to throw a pass phrase
in there. Make sure it is difficult to guess and NOT the same as your logon
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, (it will say it when you cat
it) 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 carriage returns.
It is real finicky.
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, i.e. :
drwx------ 2 victor victor 4096 2012-03-02 12:14 for .ssh directory
-rw------- 1 victor victor 1675 2012-03-02 11:53 id_rsa for the private key
Now type from your Ubuntu prompt:
ssh -p XXXX user@yourhost.com
Note, your ISP provider or Administrator can give you the port number to
type in for the server.
Enjoy!