MAC OS X Lion 10.7.3
1) On host, I've created an authorized_keys file inside .ssh folder, by doing:
2) I've copy my public ssh key into host .ssh folder by doing:
scp ~/.ssh/mykey.pub email@example.com:/home/userhost/.ssh/mykey.pub
3) I've place it's contents inside authorized files by doing:
cat mykey.pub >> authorized_keys
4) Then I've removed the mykey.pub file:
5) On my terminal, locally, inside my ~/.ssh folder I made:
(notice that it is without the pub extension);
6) I've closed and opened again the terminal.
When I first connect to this host, it has being added to the known_hosts file inside ~/.ssh;
pico known_hosts and the hash is there.
Still, every time I connect by doing: ssh firstname.lastname@example.org it requests a password !
What am I missing here ?
I've done EVEN TWO MORE THINGS here:
7) Set your key to be the default identity - if it doesn't exist, create;
and place inside the following line:
id_rsa is normally your default key. You should switched to your key. This tells that the outgoing ssh connections should use this as a default identity.
8) Add a bash process to your ssh-agent:
ssh-agent bash ssh-add ~/.ssh/yourkeyname
Lisinge answer helped but it's not definitive. If we restart our machine, the password gets prompted again!!!
How can we debug this? What can we do here? How can we check where is this process failing ?
If I use:
ssh -v -i <keyfile> email@example.com
I get among other things:
OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011 Warning: Identity file yourkeyname not accessible: No such file or directory.
This message refers to what? The identify file is not accessible on the localhost, or it's not accessible on the remote host ?