Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i'm trying to make ssh work wit pp keys. However after have followed several howto's, I still have issues with the login. Server is opensuse 12.1, client is mac. This is the verbose output:

 debug1: Reading configuration data /etc/ssh_config
 debug1: Applying options for *
 debug1: Connecting to 192.168.1.139 [192.168.1.139] port 22.
 debug1: Connection established.
 debug1: identity file /Users/me/.ssh/id_rsa type 1
 debug1: identity file /Users/me/.ssh/id_rsa-cert type -1
 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.8
 debug1: match: OpenSSH_5.8 pat OpenSSH*
 debug1: Enabling compatibility mode for protocol 2.0
 debug1: Local version string SSH-2.0-OpenSSH_5.6
 debug1: SSH2_MSG_KEXINIT sent
 debug1: SSH2_MSG_KEXINIT received
 debug1: kex: server->client aes128-ctr hmac-md5 none
 debug1: kex: client->server aes128-ctr 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 '192.168.1.139' is known and matches the RSA host key.
 debug1: Found key in /Users/me/.ssh/known_hosts:7
 debug1: ssh_rsa_verify: signature correct
 debug1: SSH2_MSG_NEWKEYS sent
 debug1: expecting SSH2_MSG_NEWKEYS
 debug1: SSH2_MSG_NEWKEYS received
 debug1: Roaming not allowed by server
 debug1: SSH2_MSG_SERVICE_REQUEST sent
 debug1: SSH2_MSG_SERVICE_ACCEPT received
 debug1: Authentications that can continue: publickey,keyboard-interactive
 debug1: Next authentication method: publickey
 debug1: Offering RSA public key: /Users/me/.ssh/id_rsa
 debug1: Authentications that can continue: publickey,keyboard-interactive
 debug1: Next authentication method: keyboard-interactive
 Password: 

Anyone an idea where to seek? thanks

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

It is not possible to debug this any further from the client side. The client is offering the key, its not being accepted, it must be a problem on the server side. The quickest way to figure out the reason, if it is feasible, is to start another sshd in debug mode, which will tell you exactly why the key is rejected. On the server side:

/usr/sbin/sshd -d -p 2222

which will start a sshd in debug mode on port 2222 (a different port so that we do not disturb the server running on port 22).

Then on the client side:

ssh -p 2222 user@remotehost

You should see the reason you key is rejected in the terminal where you start sshd.

Often the problem is with permissions being too lax. The authorized_keys file and the entire directory ancestry must not be writable by anyone but the user. So if the authorized_keys file is in /home/username/.ssh/authorized_keys, then, for instance, /, /home, /home/username all must NOT be group writable.

share|improve this answer
    
Great answer! thanks! –  user1092608 Apr 26 '12 at 16:51
add comment

It appears the keys are generated on the system other than the one you are trying to connect to. Generate the key on the system from which you are tying to connect to.

Are you connecting to VPN tunnel first and then to the server. If that is the case then also you will get same error because your are no more connecting from your machine to protected resources.

share|improve this answer
    
-1 for "generate the key on the system... you are trying to connect to". A private-key identifies you, not your system. –  nickgrim Sep 10 '12 at 12:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.