SSH without using password
HI,
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 4.still its not working for me.still its asking password for me... both hosts are Red Hat Enterprise Linux Server release 5.6 (Tikanga) Regards, Ajju |
Hi,
try using ssh with -v so that you can see the verbose output. Also try looking at what sshd is logging (/var/log/secure on RHEL IIRC). However, my first guess would be bad permissions on the key files. Evo2. |
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,gssapi-with-mic,password debug1: Next authentication method: gssapi-with-mic debug1: Unspecified GSS failure. Minor code may provide more information Unknown code krb5 195 debug1: Unspecified GSS failure. Minor code may provide more information Unknown code krb5 195 debug1: Unspecified GSS failure. Minor code may provide more information Unknown code krb5 195 debug1: Next authentication method: publickey debug1: Trying private key: /home/gerbil/.ssh/identity debug1: Offering public key: /home/gerbil/.ssh/id_rsa debug1: Authentications that can continue: publickey,gssapi-with-mic,password debug1: Offering public key: /home/gerbil/.ssh/id_dsa debug1: Authentications that can continue: publickey,gssapi-with-mic,password debug1: Next authentication method: password password: so above is the verbose o/p and file permissions looks good i.e -rwxr-xr-x for aut..Key.. |
Quote:
Code:
ssh-copy-id -i ~/.ssh/id_rsa.pub user@host: 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. Quote:
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 Code:
if [ "$(pidof ssh-agent)" ] ssh-agent still needs your login credentials, the private key. After you have logged in and ssh-agent is running, use the command: Code:
ssh-add 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. |
Main reason for ssh passwordless failure could be permission .Cross check whether you had enable wright permission for keys & .ssh file
Check the sshd_ config file you had whether enable authorized_ keys file path file & pubkey attentication yes in your sshd_ config file Look after the link for passwordless login http://www.linuxquestions.org/questi...os-rhel-35029/ |
it is asking user's password not ssh Key password, which I dont want
actually i am automating some task through script this password asking makes a problem . |
what you had tried in your part ? Did you Cross check your permission of keys &.ssh file ? Did you enable pub key attentication to yes in sshd_config file ? Did you look after the link what i have posted above ?
|
Quote:
|
All times are GMT -5. The time now is 10:59 AM. |