SSH Authentication Via PublicKey
From The Wiki Guide
Introduction
Authentication through PublicKey is a easy, yet secure way to authenticate to an SSH server. It is easy to setup, and eliminates the user having to type their password to authenticate over unsecured networks (Internet). This guide will take you through the steps required to get Public Key authentication working on both the client and server side.
Create Key Pair
- First thing you must do is generate a public/private key pair...
- "ssh-keygen -t dsa"
- -f option will let you name your keys something else than the default values below...
- This will create (by default):
- a private key "id_dsa"
- a public key "id_dsa.pub"
- These files (if defaults are used) should be located in the "~/.ssh" dir...
- The keys are 1024 bit by default, from what Ive read this is pretty
secure, and anything more, will just slow down the process as aposed to add security...
Copying your Public Key to Hosts
Ok now for all the hosts you connect to, you need to give them your public key...
- scp ~/.ssh/id_dsa.pub user@server.com:~/.ssh/authorized_keys
- Ex.scp -P 6661 ~/.ssh/id_dsa.pub raul@rbring01.myvnc.com:~/.ssh/authorized_keys
- Make sure to include the port number if its not default, in my case my ssh server listens to port 6661.
