Skip to content
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

[Bug]: Fail to ssh to remote server on windows 10 using key #1516

Open
3 tasks
xtianus opened this issue Dec 13, 2024 · 4 comments
Open
3 tasks

[Bug]: Fail to ssh to remote server on windows 10 using key #1516

xtianus opened this issue Dec 13, 2024 · 4 comments
Labels
bug Something isn't working triage Needs triage

Comments

@xtianus
Copy link

xtianus commented Dec 13, 2024

Current Behavior

I have a remote server xxx.xxx.net that I access via ssh with an identity key. The server was already configured in C:\Users\xxxx\.ssh\config and I can connect with the ssh command from windows cmd.
The connection configuration is picked up by Wave but when I click on it I can't connect and the "handshake failed" error is shown (as in the log below).
The Wave log file has these lines:

2024-12-13 22:55:43.203 [wavesrv] 2024/12/13 22:55:43.203782 Connect [email protected]
2024-12-13 22:55:43.203 [wavesrv] 2024/12/13 22:55:43.203782 sending event: wps.WaveEvent{Event:"connchange", Scopes:[]string{"connection:[email protected]"}, Sender:"", Persist:0, Data:wshrpc.ConnStatus{Status:"connecting", WshEnabled:false, Connection:"[email protected]", Connected:false, HasConnected:false, ActiveConnNum:0, Error:"", WshError:""}}
2024-12-13 22:55:44.159 [wavesrv] 2024/12/13 22:55:44.160269 Failed to open Identity Agent Socket: dial unix .: connect: An invalid argument was supplied.
2024-12-13 22:55:44.360 [wavesrv] 2024/12/13 22:55:44.361681 error: failed to connect to client [email protected]: Connecting to &remote.SSHOpts{SSHHost:"xxx.xxx.net", SSHUser:"xxxx", SSHPort:0}, Error: ssh: handshake failed: Connecting to &remote.SSHOpts{SSHHost:"xxx.xxx.net", SSHUser:"xxxx", SSHPort:0}, Error: no identity files remaining
2024-12-13 22:55:44.361 [wavesrv] 2024/12/13 22:55:44.361681 sending event: wps.WaveEvent{Event:"connchange", Scopes:[]string{"connection:[email protected]"}, Sender:"", Persist:0, Data:wshrpc.ConnStatus{Status:"error", WshEnabled:false, Connection:"[email protected]", Connected:false, HasConnected:false, ActiveConnNum:0, Error:"Connecting to &remote.SSHOpts{SSHHost:\"xxx.xxx.net\", SSHUser:\"xxxx\", SSHPort:0}, Error: ssh: handshake failed: Connecting to &remote.SSHOpts{SSHHost:\"xxx.xxx.net\", SSHUser:\"xxxx\", SSHPort:0}, Error: no identity files remaining", WshError:""}}

The server auth.log has these lines:

Dec 13 22:55:43 heta sshd[22850]: rexec line 16: Deprecated option UsePrivilegeSeparation
Dec 13 22:55:43 heta sshd[22850]: rexec line 19: Deprecated option KeyRegenerationInterval
Dec 13 22:55:43 heta sshd[22850]: rexec line 20: Deprecated option ServerKeyBits
Dec 13 22:55:43 heta sshd[22850]: rexec line 31: Deprecated option RSAAuthentication
Dec 13 22:55:43 heta sshd[22850]: rexec line 38: Deprecated option RhostsRSAAuthentication
Dec 13 22:55:44 heta sshd[22850]: reprocess config line 31: Deprecated option RSAAuthentication
Dec 13 22:55:44 heta sshd[22850]: reprocess config line 38: Deprecated option RhostsRSAAuthentication
Dec 13 22:55:44 heta sshd[22850]: Connection closed by authenticating user xxxx yyy.yyy.yyy.yyy port zzzzz [preauth]

(the deprecation lines are always there also for successful connections)

Expected Behavior

I'd expect to connect.

Steps To Reproduce

  1. start Wave
  2. type ALT+G to see a list of remote connections
  3. click on one remote connection
    --> the error is shown

Wave Version

0.10.1 (202412130332)

Platform

Windows

OS Version/Distribution

Edition Windows 10 Pro
Version 22H2
Installed on ‎07/‎09/‎2020
OS build 19045.5247
Experience Windows Feature Experience Pack 1000.19060.1000.0

Architecture

x86_64

Anything else?

No response

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later
@xtianus xtianus added bug Something isn't working triage Needs triage labels Dec 13, 2024
@xtianus
Copy link
Author

xtianus commented Dec 13, 2024

Remote system is

Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0-213-generic x86_64)

Remote ssh is

OpenSSH_7.6p1 Ubuntu-4ubuntu0.7, OpenSSL 1.0.2n 7 Dec 2017

@gy-7
Copy link

gy-7 commented Dec 19, 2024

What does the contents of C:\Users\xxxx\.ssh\config?

@gy-7
Copy link

gy-7 commented Dec 19, 2024

I had the same error today, when I connected to a remote server with the public key. I eventually realized that the problem was caused by C:\Users\xxxx\.ssh\config format

Error:

Host xx.xx.xx.xx
    HostName xx.xx.xx.xx
    Port 22
    User username
    IdentityFile "C:\Users\username\.ssh\id_rsa"

Success:

Host xx.xx.xx.xx
    HostName xx.xx.xx.xx
    Port 22
    User username
    IdentityFile  ~/.ssh/id_rsa
    AddKeysToAgent yes

@xtianus
Copy link
Author

xtianus commented Dec 19, 2024

Changing "C:\somedospath\mykey" with "/someunixpath/mykey" for the value of IdentityFile fixed it.
This is a good workaround but I think DOS paths should be recognized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Needs triage
Projects
None yet
Development

No branches or pull requests

2 participants