MAC OS X Lion 10.7.3
1) On host, I've created an authorized_keys file inside .ssh folder, by doing:
touch authorized_keys
2) I've copy my public ssh key into host .ssh folder by doing:
scp ~/.ssh/mykey.pub
[email protected]:/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:
rm mykey.pub
5) On my terminal, locally, inside my ~/.ssh folder I made:
ssh-add mykey
(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;
I've pico known_hosts and the hash is there.
Still, every time I connect by doing:
ssh
[email protected] it requests a password !
What am I missing here ?
UPDATE:
I've done EVEN TWO MORE THINGS here:
7) Set your key to be the default identity - if it doesn't exist, create;
touch ~/.ssh/config
and place inside the following line:
IdentityFile ~/.ssh/yourkeyname
*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 ?
UPDATE 2:
If I use:
ssh -v -i <keyfile>
[email protected]
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 ?
Please advice