passwordless ssh connection problem


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users passwordless ssh connection problem
# 1  
Old 10-26-2011
passwordless ssh connection problem

I need to ssh from Host A to Hosts B and C. A->B works, but A->C does not.
I can do rcp/rcmd A->B and A->C.
B and C are identical systems. All three are SCO OSR 5.

More relevant info:
Code:
Host A$ ssh -V
OpenSSH_3.8p1, SSH protocols 1.5/2.0, OpenSSL 0.9.7d 17 Mar 2004

Hosts B and C are:
Code:
OpenSSH_4.3p2, OpenSSL 0.9.7i 14 Oct 2005

What I did:

... on A
Code:
$ ssh-keygen -t rsa 
$ rcp id_rsa.pub B:/tmp
$ rcp id_rsa.pub C:/tmp

... on B and C
Code:
$ cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys
$ chmod 600 ~/.ssh/authorized_keys

And then I repeated the same with dsa public key.

Here is debug info from failing attempt to connect A->C

Code:
 
$ ssh -v C
OpenSSH_3.8p1, SSH protocols 1.5/2.0, OpenSSL 0.9.7d 17 Mar 2004
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to C [192.168.1.9] port 22.
debug1: Connection established.
debug1: identity file /u/myuser/.ssh/identity type -1
debug1: identity file /u/myuser/.ssh/id_rsa type 1
debug1: identity file /u/myuser/.ssh/id_dsa type 2
debug1: Remote protocol version 1.99, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.8p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
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: Host 'C' is known and matches the RSA host key.
debug1: Found key in /u/myuser/.ssh/known_hosts:6
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,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /u/myuser/.ssh/identity
debug1: Offering public key: /u/myuser/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Offering public key: /u/myuser/.ssh/id_dsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
myuser@C's password: 
...etc...

Any suggestions would be appreciated.
# 2  
Old 10-26-2011
I've had a similar error when there was a broken key above mine in the ~/.ssh/authorized_keys file. Move your key to the top and see if that helps.
# 3  
Old 10-28-2011
I tried to have just one key in my authorized_keys file, but that made no difference
# 4  
Old 10-28-2011
if you copy/pasted the key(s) in the file, make sure that each key is one CONTINUOUS line with no 'line wraps' (as the keys are long and copy/pasting from one window to the other may introduce some line wraps).
# 5  
Old 10-30-2011
No, as you see in my post I did not manually cut/paste. I did cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys

Last edited by migurus; 10-30-2011 at 12:40 AM.. Reason: typo
# 6  
Old 10-30-2011
From SSH FAQ:

3.14 - I copied my public key to authorized_keys but public-key authentication still doesn't work.

Typically this is caused by the file permissions on $HOME, $HOME/.ssh or $HOME/.ssh/authorized_keys being more permissive than sshd allows by default.
In this case, it can be solved by executing the following on the server.
$ chmod go-w $HOME $HOME/.ssh
$ chmod 600 $HOME/.ssh/authorized_keys
$ chown `whoami` $HOME/.ssh/authorized_keys
If this is not possible for some reason, an alternative is to set StrictModes no in sshd_config, however this is not recommended.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Passwordless sftp connection from UNIX to windows server

HI , I am trying to make a passwordless sftp connection from a unix server to windows server I have used a existing script which is like this cd /home150/adm/.ssh/ ssh-agent /usr/bin/ksh <<EOF ssh-add IDBNEWKEY ssh-add -l sftp IDBUSER@abc.com cd /home/IDBUSER/Share/IDB/ rm ${FILE}... (0 Replies)
Discussion started by: Jcpratap
0 Replies

2. AIX

Passwordless SSH problem with AIX machines

Hello, I am trying to setup passwordless nophrase ssh between two machines for the user id: oraprod here is what I did for a non-root user: oraprod whoami: oraprod Machine A: ssh-keygen -t dsa cat ~/.ssh/id_rsa.pub # GO TO MACHINE B create (16 Replies)
Discussion started by: filosophizer
16 Replies

3. UNIX for Advanced & Expert Users

Passwordless ssh

Hi I have created a user on a linux server and created a passwordless ssh key. I've echoed the key into the authorized_keys file for the user. I've added a series of forced commands to the key. From my laptop - logged in as myself - I can ssh into the server as that user and the commands... (3 Replies)
Discussion started by: steadyonabix
3 Replies

4. Shell Programming and Scripting

ssh connection problem

hi to all i have 2 machine (1 windows and i ubuntu) i have install cygwin inside the windows machine and when i use windows machine to ssh ubuntu machine, it works but when i try to use the ubuntu machine to connect to windows machine, it only prompts me pc3@pc3-desktop:~$ ssh... (0 Replies)
Discussion started by: Ericyue
0 Replies

5. Solaris

Passwordless FTP connection

Hello, Can someone help me in getting a passwordless FTP conncetion ? It works if I do it as myself, but I need to be user1 when I do it, not myself. When I do it as user1, it asks for user1 password, which we don't have. All in all, ftp myserver.com works on all other servers when I'm... (5 Replies)
Discussion started by: aksijain
5 Replies

6. Shell Programming and Scripting

passwordless ssh

My main concern is, i have to login into 300 linux server and all are having same userid and password. I dont want to create any key for each server to login . Is there a way to run the shell script ? (3 Replies)
Discussion started by: Mani2512
3 Replies

7. UNIX for Dummies Questions & Answers

passwordless ssh

hi, i have tried with passwordless shh in google.. i followed the below steps ... user:~> ssh-keygen -t rsa Enter file in which to save the key (/home/cantin/.ssh/id_rsa):key.txt Enter passphrase (empty for no passphrase): Enter same passphrase again: till this step i... (0 Replies)
Discussion started by: arunmanas
0 Replies

8. Shell Programming and Scripting

ssh passwordless

Hi, I want to login to a remote server and sftp files without password prompting. So, I created private-public key pair as follows: user1@server1.com .ssh]$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/user1/.ssh/id_rsa): Enter... (7 Replies)
Discussion started by: dips_ag
7 Replies

9. HP-UX

Help on passwordless ssh...

Hi, Can someone help me on ssh-keygen usage...? I used ssh-keygen after which "id.pub" file was generated in system1's > .ssh directory... I copied the same into the remote system system2 > .ssh directory as "authorized_keys" file. Now i tried ssh connection from system 1 to system... (7 Replies)
Discussion started by: EmbedUX
7 Replies

10. Solaris

Server unexpectedly closed network connection error in passwordless in ssh through

Hi , when i try to passwordless connection login in ssh through putty, i am getting the "Server unexpectedly closed network connection" error.i have already finished the public and private key settings for the particular user. thanks MaroV (1 Reply)
Discussion started by: vr_mari
1 Replies
Login or Register to Ask a Question