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

0.7.5 crashing on ssh connection #114

Open
svenstaro opened this issue Mar 6, 2022 · 6 comments
Open

0.7.5 crashing on ssh connection #114

svenstaro opened this issue Mar 6, 2022 · 6 comments

Comments

@svenstaro
Copy link
Contributor

I compiled this from source following official instructions.
Then:

go/bin/upterm host

On a second shell, I run the printed ssh command. Then the upterm host crashes with:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x876252]
goroutine 13 [running]:
golang.org/x/crypto/ssh.(*curve25519sha256).Server(0xc000446580, {0x7f77a1d19008, 0xc0002b6000}, {0xb9d380, 0xc000134570}, 0x80, {0x0, 0x0})
/home/svenstaro/src/upterm/vendor/golang.org/x/crypto/ssh/kex.go:515 +0x272
golang.org/x/crypto/ssh.(*handshakeTransport).server(0xc000216480, {0xba92d8, 0x1042d10}, 0xc0001a2880, 0xc0001e2c60)
/home/svenstaro/src/upterm/vendor/golang.org/x/crypto/ssh/handshake.go:691 +0xe3
golang.org/x/crypto/ssh.(*handshakeTransport).enterKeyExchange(0xc000216480, {0xc000472a80, 0xc0004e2420, 0x0})
/home/svenstaro/src/upterm/vendor/golang.org/x/crypto/ssh/handshake.go:616 +0x3ec
golang.org/x/crypto/ssh.(*handshakeTransport).kexLoop(0xc000216480)
/home/svenstaro/src/upterm/vendor/golang.org/x/crypto/ssh/handshake.go:325 +0xa6
created by golang.org/x/crypto/ssh.newServerTransport
/home/svenstaro/src/upterm/vendor/golang.org/x/crypto/ssh/handshake.go:167 +0x13d
@owenthereal
Copy link
Owner

owenthereal commented Mar 6, 2022

This is related to https://github.com/owenthereal/upterm#a-note-about-rsa-keys. I recommend deleting the RSA key in your ~/.ssh/id_rsa and generating an ed25519 key with something like ssh-keygen -o -a 100 -t ed25519

@svenstaro
Copy link
Contributor Author

Maybe so but it still shouldn't crash and burn like this! This is detectable improper program behavior and should be properly handled.

@svenstaro
Copy link
Contributor Author

@owenthereal Could you re-open this as a request to properly handle this case and provide a descriptive error to the user? I reckon this problem will re-occur often as distros update.

@owenthereal owenthereal reopened this Mar 7, 2022
@owenthereal
Copy link
Owner

owenthereal commented Mar 7, 2022

I agree this could be handled more gracefully, e.g. having a useful message saying RSA key issue etc. I'm closely monitoring the underlying Go crypto issue and will merge in fixes once they are ready. But until then, a descriptive message would help users

@svenstaro
Copy link
Contributor Author

By the way, I did what you said and now have no id_rsa, only id_ed25519 and get the same failure. My agent still has RSA keys in it, might that be the issue?

@owenthereal
Copy link
Owner

owenthereal commented Mar 7, 2022

My agent still has RSA keys in it, might that be the issue?

Yes, that's the issue. ssh will first attempt keys in the SSH agent if there is any before reading keys from ~/.ssh. Please remove the keys from the agent and try again.

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

2 participants