Skip to content

rsa key authentication fails #271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vdaele opened this issue Jul 15, 2016 · 4 comments
Closed

rsa key authentication fails #271

vdaele opened this issue Jul 15, 2016 · 4 comments

Comments

@vdaele
Copy link

vdaele commented Jul 15, 2016

I'm not sure whether this is the right place to ask but I have a problem with key-based authentication.

I installed Open SSH on my Windows10 PC

Using ssh [email protected], I can connect from my mac (by giving a password)

I can connect using RSA keys from my Mac to another Linux system (after generating the key on my Mac and adding my id_rsa.pub to the Linux pc .ssh/authorized_keys)

However, I can't connect using the same RSA key to my Windows PC (after adding the content of my id_rsa.pub to C:\Users\Marc.ssh\authorized_keys)

When starting the sshd with debug info and trying to connect, I see the log lines below

Any help appreciated!

Marc

PS C:\Program Files\OpenSSH> .\sshd.exe -d
debug1: sshd version OpenSSH_7.1, OpenSSL 1.0.2d 9 Jul 2015
[Build May 30 2016 09:53:40]
debug1: open - handle:000000000000014C, io:0000021719BBACD0, fd:3
debug1: close - io:0000021719BBACD0, type:2, fd:3, table_index:3
debug1: open - handle:000000000000014C, io:0000021719BD4620, fd:3
debug1: close - io:0000021719BD4620, type:2, fd:3, table_index:3
debug1: private host key #0: ssh-rsa SHA256:dv49+B1/NxMbywm/JQVeLy0YZjcsTDFGtb37ly1h/Gk
debug1: open - handle:000000000000014C, io:0000021719BD47B0, fd:3
debug1: close - io:0000021719BD47B0, type:2, fd:3, table_index:3
debug1: open - handle:000000000000014C, io:0000021719BD47B0, fd:3
debug1: close - io:0000021719BD47B0, type:2, fd:3, table_index:3
debug1: private host key #1: ssh-dss SHA256:dZ7rShg0MlB8/yfALKyw9dkkiHQG2A7ays61C1GegSE
debug1: open - handle:000000000000014C, io:0000021719BD47B0, fd:3
debug1: close - io:0000021719BD47B0, type:2, fd:3, table_index:3
debug1: open - handle:000000000000014C, io:0000021719BD47B0, fd:3
debug1: close - io:0000021719BD47B0, type:2, fd:3, table_index:3
debug1: private host key #2: ecdsa-sha2-nistp256 SHA256:vkOe+zRTllDQyNWEQFgHi1N0DKWMWyK7K7Pdv4GMVwc
debug1: open - handle:000000000000014C, io:0000021719BD5480, fd:3
debug1: close - io:0000021719BD5480, type:2, fd:3, table_index:3
debug1: open - handle:000000000000014C, io:0000021719BD5480, fd:3
debug1: close - io:0000021719BD5480, type:2, fd:3, table_index:3
debug1: private host key #3: ssh-ed25519 SHA256:GCPOQTwgZE/2t7zIZOhgud+iHCdjGGDR/lzNoTGL2qk
debug1: socket:332, io:0000021719BD5480, fd:3
debug1: Bind to port 22 on ::.
Server listening on :: port 22.
debug1: socket:376, io:0000021719BD4250, fd:4
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
debug1: socket:388, io:0000021719BD5530, fd:5
debug1: pipe - read end: handle:000000000000001C, io:0000021719BD7840, fd:6
debug1: pipe - write end: handle:0000000000000078, io:0000021719BD78F0, fd:7
debug1: Server will not fork when running in debugging mode.
debug1: close - io:0000021719BD5480, type:1, fd:3, table_index:3
debug1: close - io:0000021719BD4250, type:1, fd:4, table_index:4
debug1: close - io:0000021719BD7840, type:2, fd:6, table_index:6
debug1: close - io:0000021719BD78F0, type:2, fd:7, table_index:7
Connection from 10.100.1.117 port 54343 on 10.100.2.72 port 22
debug1: Client protocol version 2.0; client software version OpenSSH_6.9
debug1: match: OpenSSH_6.9 pat OpenSSH* compat 0x04000000
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1p1 Microsoft_Win32_port_with_VS
debug1: list_hostkey_types: ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: client->server cipher: [email protected] MAC: compression: none
debug1: kex: server->client cipher: [email protected] MAC: compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_INIT
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: KEX done
debug1: userauth-request for user Marc service ssh-connection method none
debug1: attempt 0 failures 0
Failed none for Marc from 10.100.1.117 port 54343 ssh2
debug1: userauth-request for user Marc service ssh-connection method publickey
debug1: attempt 1 failures 0
debug1: test whether pkalg/pkblob are acceptable
Postponed publickey for Marc from 10.100.1.117 port 54343 ssh2
debug1: userauth-request for user Marc service ssh-connection method publickey
debug1: attempt 2 failures 0
debug1: auth agent did not authorize client Marc
debug1: close - io:0000021719BE9C60, type:2, fd:4, table_index:4
Failed publickey for Marc from 10.100.1.117 port 54343 ssh2: RSA SHA256:Boi+YkdUfdDFS4lX07MYpyCDfJWLQqPHQUMArMUpntY
debug1: userauth-request for user Marc service ssh-connection method publickey
debug1: attempt 3 failures 1
debug1: test whether pkalg/pkblob are acceptable
Postponed publickey for Marc from 10.100.1.117 port 54343 ssh2
debug1: userauth-request for user Marc service ssh-connection method publickey
debug1: attempt 4 failures 1
debug1: auth agent did not authorize client Marc
debug1: close - io:0000021719BCEB00, type:2, fd:4, table_index:4
Failed publickey for Marc from 10.100.1.117 port 54343 ssh2: DSA SHA256:jVIM5ivOrMLGZGwVPQlz3HlAs+ljkrPEDHNpyAx5AqM
debug1: userauth-request for user Marc service ssh-connection method keyboard-interactive
debug1: attempt 5 failures 2
debug1: keyboard-interactive devs
debug1: auth2_challenge: user=Marc devs=
debug1: kbdint_alloc: devices ''
Failed keyboard-interactive for Marc from 10.100.1.117 port 54343 ssh2

@dud225
Copy link

dud225 commented Jul 18, 2016

Hello.

I'm getting the exact same issue on a 2012 Server. Password auth works fine, but there is no way to get public key auth working.

I've reinstalled OpenSSH several times, I've checked that the install-sshlsa.ps1 executed properly, I've tried to launch the service as the administrator account, I've tried to specify an explicit authorized_keys path, in vain.....

@manojampalam
Copy link
Contributor

C:\Users\Marc.ssh\authorized_keys should be
C:\Users\Marc.ssh\authorized_keys

Other than that refer to https://github.com/PowerShell/Win32-OpenSSH/wiki/ssh.exe-examples
and https://github.com/PowerShell/Win32-OpenSSH/wiki/Troubleshooting%20Steps

Also look into ssh-agent.log for any pointers.
Reopen with log contents if needed

@dud225
Copy link

dud225 commented Jul 20, 2016

C:\Users\Marc.ssh\authorized_keys should be
C:\Users\Marc.ssh\authorized_keys

What's the difference ??

@vdaele
Copy link
Author

vdaele commented Jul 20, 2016

@manojampalam 's comment should probably be
"C:\Users\Marc.ssh\authorized_keys should be C:\Users\Marc.ssh\authorized_keys" (extra backslash for the .ssh directory)

That was indeed a typo in my original question; However, I did use a separate .ssh directory.

In the meantime (also because I had issues with scp), I gave up and installed Cygwin with openssh package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants