Use ssh-keygen
command. On the server (where you want ssh to) store the public key in file ~/.ssh/authorized_keys
. If you haven't got an .ssh directory inside your home (~) yet, create it (also be careful: it seems sshd is picky - for security reasons - that no other user can read that file/dir, it's better to issue chmod 700 on your .ssh directory and chmod 600 on the file in it).
On the machine you want to ssh from ("client"), you can use the private key to ssh to your server then. You can store it anywhere then you can use the -i
switch of ssh, to give the public key which will be used. I write this, since you stated that "not storing at the default location". The default location would be file id_dsa
(for DSA key) inside your .ssh directory. Then you don't need the -i
switch to specify your key, because it will be picked from there automatically.