LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-03-2009, 09:21 AM   #1
blckspder
Member
 
Registered: Feb 2005
Posts: 37

Rep: Reputation: 15
passwordless ssh problem


Hello, Ive been looking around the forum and havent come across a solution for my problem.

I am trying to setup a passwordless ssh connection between 2 servers so I can use rsync. I generated the keys and set everything up like the dozens of tutorials say too but it still prompts for a password here is the debug out put:
PHP Code:
OpenSSH_4.7p1OpenSSL 0.9.8b 04 May 2006
debug1
Reading configuration data /etc/ssh/ssh_config
debug1
Applying options for *
debug1Connecting to www.xxx-xxx.com [192.168.111.250port xx.
debug1Connection established.
debug1identity file /home/synco/.ssh/identity type -1
debug1
identity file /home/synco/.ssh/id_rsa type -1
debug1
identity file /home/synco/.ssh/id_dsa type 2
debug1
Remote protocol version 2.0remote software version OpenSSH_4.5
debug1
matchOpenSSH_4.5 pat OpenSSH*
debug1Enabling compatibility mode for protocol 2.0
debug1
Local version string SSH-2.0-OpenSSH_4.7
debug1
SSH2_MSG_KEXINIT sent
debug1
SSH2_MSG_KEXINIT received
debug1
kexserver->client aes128-cbc hmac-md5 none
debug1
kexclient->server aes128-cbc hmac-md5 none
debug1
SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192sent
debug1
expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1
SSH2_MSG_KEX_DH_GEX_INIT sent
debug1
expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1
checking without port identifier
The authenticity of host 
'[www.xxx-xxx.com]:xx
([192.168.111.250]:31234)' 
can't be established.
RSA key fingerprint is 74:18:dd:69:71:ce:96:ad:22:aa:ce:06:23:88:9b:9e.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/synco/.ssh/known_hosts).
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
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
No credentials cache found

debug1: Unspecified GSS failure.  Minor code may provide more information
No credentials cache found

debug1: Unspecified GSS failure.  Minor code may provide more information


debug1: Next authentication method: publickey
debug1: Trying private key: /home/synco/.ssh/identity
debug1: Trying private key: /home/synco/.ssh/id_rsa
debug1: Offering public key: /home/synco/.ssh/id_dsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: password
synco@www.xxx-xxx.com'
s password
Any help would be greatly appreciated! Thanks.
 
Old 03-03-2009, 09:41 AM   #2
chitambira
Member
 
Registered: Oct 2008
Location: Online
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 51
which ssh client are you using? did you load your private key first?
 
Old 03-03-2009, 09:45 AM   #3
wsduvall
Member
 
Registered: Aug 2006
Posts: 92

Rep: Reputation: 16
You should also check the permissions on .ssh and .ssh/known_hosts. I've had problems with that before... I always uses the command ssh-copy-id to put my key on the server to ensure correct permissions. Also, are you using DSA or RSA keys?

Last edited by wsduvall; 03-03-2009 at 09:47 AM.
 
Old 03-03-2009, 09:59 AM   #4
mfons
LQ Newbie
 
Registered: Mar 2009
Posts: 26

Rep: Reputation: 1
Wink

In my case, it was perms fault:

These are the steps I've followed with no problems for root user:
1. In /root/.ssh/ generate keys:
ssh-keygen -b 1024 -t rsa1
ssh-keygen -b 1024 -t rsa
ssh-keygen -b 1024 -t dsa

These commands generate the files: identity.pub, id_rsa.pub and id_dsa.pub

2. Generate a file with those 3 files:
cat identity.pub > keypub.host.root
cat id_rsa.pub >> keypub.host.root
cat id_dsa.pub >> keypub.host.root

3. scp >> keypub.host.root host_destiny:/root/.ssh/

4. Add to authorized_keys
cat keypub.host.root >> /root/.ssh/authorized_keys

5. Check on destiny: perms on /root are set to 750
6. Check on destiny: perms on /root/.ssh are set to 700
7. Check on destiny: perms on /root/.ssh/authorized_keys are set to 644

Then you'll be able to ssh destiny without passwd with user root
 
Old 03-03-2009, 01:55 PM   #5
blckspder
Member
 
Registered: Feb 2005
Posts: 37

Original Poster
Rep: Reputation: 15
Thanks for the replies. I followed this little tutorial:
http://blog.rvdavid.net/instant-or-p...-ing-in-linux/

It used dsa keys.

mfons, thanks for the quick tutorial, I will try it out and see how it works, Ill let you know thanks again.
 
Old 03-04-2009, 03:29 AM   #6
chitambira
Member
 
Registered: Oct 2008
Location: Online
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 51
ssh and rsync:
http://www.howtomonster.com/2007/08/...automatically/
http://troy.jdmz.net/rsync/index.html
http://everythinglinux.org/rsync/
 
Old 03-05-2009, 09:29 AM   #7
blckspder
Member
 
Registered: Feb 2005
Posts: 37

Original Poster
Rep: Reputation: 15
chitambira,

Thanks for the post, the first link you supplied worked like a charm!
http://www.howtomonster.com/2007/08/...automatically/
 
  


Reply



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
Passwordless ssh isn't dcroxton Linux - Software 8 07-18-2008 12:16 PM
Can't use passwordless ssh sunhui Linux - Security 1 10-03-2006 08:29 PM
Passwordless SSH with SSH commercial server and open ssh cereal83 Linux - General 7 04-18-2006 12:34 PM
Passwordless SSH problem? LQYY Linux - Software 5 06-09-2005 09:56 PM
Regarding Passwordless SSH nedian123 Linux - Software 1 08-05-2004 05:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:54 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
Open Source Consulting | Domain Registration