LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-21-2012, 01:15 AM   #1
azheruddin
Member
 
Registered: Dec 2011
Posts: 83
Blog Entries: 1

Rep: Reputation: Disabled
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
 
Old 11-21-2012, 01:45 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
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.
 
Old 11-21-2012, 02:15 AM   #3
azheruddin
Member
 
Registered: Dec 2011
Posts: 83
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
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..
 
Old 11-21-2012, 03:09 AM   #4
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,452

Rep: Reputation: 85
Quote:
Originally Posted by azheruddin View Post
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
Use this command example:
Code:
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.

Quote:
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

Code:
if [ "$(pidof ssh-agent)" ]
then
   break # ssh-agent is already running
else
   ssh-agent # ssh-agent is not running, start it
if
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:

Code:
ssh-add
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.
 
Old 11-21-2012, 03:34 AM   #5
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
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/

Last edited by jsaravana87; 11-21-2012 at 03:35 AM.
 
Old 11-21-2012, 04:15 AM   #6
azheruddin
Member
 
Registered: Dec 2011
Posts: 83
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
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 .
 
Old 11-21-2012, 04:21 AM   #7
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
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 ?

Last edited by jsaravana87; 11-21-2012 at 04:23 AM.
 
Old 11-21-2012, 04:45 AM   #8
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,452

Rep: Reputation: 85
Quote:
Originally Posted by azheruddin View Post
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 .
Remove the authorized_keys file. Start over using the instructions I gave you. It will work. If it doesn't, please post back, and I will help you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] SSH: Asks for password: Permission denied (keyboard-interactive,password). tulicloure Linux - Newbie 7 02-14-2012 10:48 AM
[SOLVED] ssh scp key not working to ssh/scp without password rjo98 Linux - Newbie 9 08-22-2011 05:28 PM
get "failed password" when scripts ssh in, but ok when I manually ssh in??? callagga Linux - Networking 4 02-06-2009 03:49 PM
need help with no password ssh and ssh-agent hedpe Linux - Networking 3 02-08-2007 09:49 PM
ssh password ssudhi Linux - Newbie 6 05-13-2004 10:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration