ssh without password – certificate based

create keys:
ssh-keygen -t rsa
ssh-keygen -t dsa

or even more detailed:
ssh-keygen -f -C -N -t rsa
ssh-keygen -f id_rsa -C "Keyfile for server" -N "" -t rsa


which will create the files id_rsa/id_dsa and id_rsa.pub/id_dsa.pub respectively. To copy the public keys to the target machine you may use:
ssh-copy-id -i id_rsa.pub user@remote-system
ssh-copy-id -i id_dsa.pub user@remote-system

or you may use ssh to copy the files:
cat *.pub | ssh user@remote-system 'umask 077; cat >>.ssh/authorized_keys'

Note that the key file is only one line and must remain one line also in the authorized_keys file.
To get access to the server via normal ssh shell the server is asking for a verification which will be generated by the client using the private key and the corresponding private passphrase. You may omit this part by leaving the passphrase empty when generating the keys.

The public keyfile part must be inserted as one line to the server side .ssh/authorized_keys file.
To explicetely connect to a remote server using a key file you use the command:
slogin -i ~/.ssh/secret-key-file remotehost


You may even further restrict the access to the remote server by including some options in the authorized_keys file like this:
#
from="client1",no-port-forwarding,no-pty ssh-rsa AAAAB
3NzaC1yc2EAAAABIwAAAQEAybmcqaU/Xos/GhYCDkV+kDsK8+A5OjaK5WgLMqmu38aPo
56Od10RQ3EiB42DjRVY8trXS1NH4jbURQPERr2LHCCYq6tHJYfJNhUX/COwHs+ozNPE8
3CYDhK4AhabahnltFE5ZbefwXW4FoKOO+n8AdDfSSOazpPas8jXi5bEwNf7heZT++a/Q
xbu9JHF1huThuDuxOtIWl07G+tKqzggFVknM5CoJCFxaik91lNGgu2OTKfY94c/ieETO
XE5L+fVrbtOh7DTFMjIYAWNxy4tlMR/59UVw5dapAxH9J2lZglkj0w0LwFI+7hZu9XvN
fMKMKg+ERAz9XHYH3608RL1RQ== This comment describes key #1
#
#
from="*.domain",no-X11-forwarding,noagent-forwarding ssh-rsa
AAAAC4MybC1yD2EAAAABIwAAAQEAybmcqaU/Xos/GhYCzkV+kDsK8+A5OjaK5WgLMqm
u38aPo56Od10RQSEiB42DjRVY8trXS1NH4jbURQPERr2LHCCYq6tHJYfJNhUX/COwHs
+ozNPE83CYDhK4XhabahnltFE5ZbefwXW4FoKOO+n8AdDfSXOazpPas8jXi5bENf7he
ZT++a/Qxbu9JHF1huThuDuxOtIWl07G+tKqzggFVknM5CoJCFxaik91lNGgu2OTKfY9
4c/ieETOXE5L+fVrbtOh7DTFMjIYAWNxy4tlMR/59UVw5dapAxH9J2lZglkj0w0LwFI
+7hZu9XvNfMKMKg+ERAz9XHYH3608RL1RQ== This comment describes key #2

    Problems:

A possible problem may be the access rights for the files under .ssh/ and especially .ssh/authorized_keys which must only be accessible by the owner.
The public key file must be appended to the detsination hosts ~/.ssh/authorized_keys file.
The secret private key is stored on the client machine you are trying to connect to the remote machine from.