1

So I have been trying every which way to get into my Server '08 box via SSH. I have tried FreeSSHD and Cygwin. Everything works fine when I am using simple SHA pass authentication, but the moment I try and use keys, the following occurs:

  • id_rsa key is recognized
  • the passphrase is accepted
  • but then a request for the user password returns a "permission denied" error

Terminal out below:

ssh -v -p 22 -i /home/m1ckrz/.ssh/id_rsa m1ckrz@10.11.1.22 
OpenSSH_6.2p2 Ubuntu-6ubuntu0.4, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 10.11.1.22 [10.11.1.22] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /home/m1ckrz/.ssh/id_rsa type -1
debug1: identity file /home/m1ckrz/.ssh/id_rsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2p2 Ubuntu-6ubuntu0.4
debug1: Remote protocol version 2.0, remote software version WeOnlyDo 2.1.3
debug1: no match: WeOnlyDo 2.1.3
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: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: RSA f6:cf:a9:fe:42:6e:21:73:84:1e:08:25:b7:b2:5b:38
debug1: Host '10.11.1.22' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:1
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: password,publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/m1ckrz/.ssh/id_rsa
debug1: key_parse_private_pem: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/m1ckrz/.ssh/id_rsa': 
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: password,publickey
debug1: Next authentication method: password
m1ckrz@10.11.1.22's password: 
debug1: Authentications that can continue: password,publickey
Permission denied, please try again.
m1ckrz@10.11.1.22's password: 
debug1: Authentications that can continue: password,publickey
Permission denied, please try again.
m1ckrz@10.11.1.22's password: 
Received disconnect from 10.11.1.22: 2: Too many attempts.
0

You are already using the "verbose" option -v of ssh.

It also has a "very verbose" option -vv.
Oh, and "very very verbose", -vvv, which may actually be too verbose!

So, I hopefully you see what's the problem when you run

ssh -vv -p 22 -i /home/m1ckrz/.ssh/id_rsa m1ckrz@10.11.1.22 2>&1 | less

If not, try with -vvv, which gives you about 300 lines of output.

0

Check the permissions on your private key file:

debug1: Trying private key: /home/m1ckrz/.ssh/id_rsa

If it's anything other than 600 (rw-------) then SSH will typically forgo using it since it could've been compromised.

For example

$ ls -l ~/.ssh/  | grep "[ ]id_rsa"
-rw-------. 1 saml saml  1766 Aug  5 21:43 id_rsa
-rw-r--r--. 1 saml saml   406 Aug  5 21:43 id_rsa.pub

Turning up the verbosity of ssh with additional -v switch will like shed more light on the issue.

$ ssh -vvv ....
  • Adjusted permissions and still receiving same error. It has to be an issue on the server. I can get in fine when using password auth and my key registers, so it must have something to do with the user permissions on Windows. Are there any specific permissions needed on the MS box? – m1ckrz Sep 16 '14 at 7:06
  • @m1ckrz - what's the SSH server you're running on Windows 2008? Take a look here for a list of options, make sure you setup your SSH servers as described here: superuser.com/questions/64058/windows-ssh-servers – slm Sep 16 '14 at 10:36
  • @m1ckrz - might be a better SSH server option: kpym.com/2/kpym/index.htm – slm Sep 16 '14 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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