Originally Posted by azheruddin
I am trying to do ssh without using password but its not working for me...i will tell what i have done
1.source host---ssh-keygen -t rsa
2.copied id_rsa.pub key and kept on target hosts[in authorized key]
3.but its not working
Use this command example:
ssh-copy-id -i ~/.ssh/id_rsa.pub user@host:
Do not forget the :
Maybe the : is not needed, but it is when you use scp.
It's much easier than copying the file over manually. It will append to authorized host instead of overwriting it, and it's created for this. It also does error checking.
4.still its not working for me.still its asking
password for me...
Is it asking for the user's password or the password to the ssh key you created?
To stop it from asking the password to the ssh keys you created, be sure ssh-agent is running.
You can start it manually by typing ssh-agent, but you would have to do this after each reboot, or you can have it start automatically by your login scripts.
To start it automatically:
Add this to your ~/.bash_profile
if [ "$(pidof ssh-agent)" ]
break # ssh-agent is already running
ssh-agent # ssh-agent is not running, start it
Now each time you login even if multiple times, ssh-agent should only be running once.
ssh-agent still needs your login credentials, the private key.
After you have logged in and ssh-agent is running, use the command:
To add your key identity to ssh-agent.
Now when you ssh to a server that contains your public key, you will not be prompted for your ssh private key password each time.