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

Github ssh connection issues #9

Open
Folcon opened this issue Jan 28, 2022 · 14 comments
Open

Github ssh connection issues #9

Folcon opened this issue Jan 28, 2022 · 14 comments

Comments

@Folcon
Copy link

Folcon commented Jan 28, 2022

Hey,

I'm not sure if the docs are unclear or something is wrong, but I couldn't use either limit-access-to-actor together with limit-access-to-users or limit-access-to-actor by itself (introduced in #8).

The ssh command I used was:

ssh -i ~/.ssh/gh_current_key b9mSRLZzh0Br3aVNmSNE:[email protected]
b9mSRLZzh0Br3aVNmSNE:[email protected]: Permission denied (publickey).

I also tried stripping the password string, as the connection string instruction in the docs is a little ambiguous.

ssh -i ~/.ssh/gh_current_key [email protected] 
Connection closed by 157.230.199.75 port 22

To sanity check I tried doing an ssh connection test to github, which worked fine:

ssh -T -i ~/.ssh/gh_current_key [email protected] 
Warning: remote port forwarding failed for listen port 2222
Hi Folcon! You've successfully authenticated, but GitHub does not provide shell access.

Not sure what the problem is or if this is an upstream issue...

@lhotari
Copy link
Owner

lhotari commented Jan 29, 2022

Thanks for the report @Folcon . Do you see any log messages about fetching the ssh keys?

Example of the logs:

Adding actor "lhotari" to allowed users.
Fetching SSH keys registered with GitHub profiles: lhotari
Fetched 2 ssh public keys

If that's fine, it could be the type of the public keys that aren't accepted by the Upterm ssh server. What type of ssh key do you use? Is it RSA or ed25519? I believe legacy DSA keys might not be supported.

@lhotari
Copy link
Owner

lhotari commented Jan 29, 2022

I see it's ed25519, https://github.com/Folcon.keys . Can you try adding a RSA key temporarily for testing?

@Folcon
Copy link
Author

Folcon commented Jan 29, 2022

Nope:

ssh -i ~/.ssh/gh_upterm_rsa h5NCmo8QbJciRl98apgZ:[email protected]
Connection closed by 157.230.199.75 port 22

Ok, it worked this time. Not sure if it's an intermittent issue, but it does work at the moment.

@lhotari
Copy link
Owner

lhotari commented Feb 2, 2022

Ok, it worked this time. Not sure if it's an intermittent issue, but it does work at the moment.

I'll close the issue if it's resolved. It could also be a upterm server issue. It's possible to run your own upterm server on Heroku. I haven't tried that myself yet.

I also tried stripping the password string, as the connection string instruction in the docs is a little ambiguous.

btw. that doesn't seem to work at all and the connection will always fail in that case.

@Folcon
Copy link
Author

Folcon commented Feb 2, 2022 via email

@jas88
Copy link

jas88 commented Feb 3, 2022

Same issue here - key seems to be accepted, but then connection is closed:

debug1: Will attempt key: /Users/jas88/.ssh/id_github2022 RSA SHA256:Wi4K402kNASQdMNFJqTpgxl3MqwXhXTiKkzs6lQsy/o explicit agent

debug1: SSH2_MSG_SERVICE_ACCEPT received

Connection closed by 157.230.199.75 port 22

No error or anything else - just a dead session.

@lhotari
Copy link
Owner

lhotari commented Feb 3, 2022

Same issue here - key seems to be accepted, but then connection is closed:

debug1: Will attempt key: /Users/jas88/.ssh/id_github2022 RSA SHA256:Wi4K402kNASQdMNFJqTpgxl3MqwXhXTiKkzs6lQsy/o explicit agent

debug1: SSH2_MSG_SERVICE_ACCEPT received

Connection closed by 157.230.199.75 port 22

No error or anything else - just a dead session.

@jas88 Does the connection get established when you don't limit access to specific github users?

@jas88
Copy link

jas88 commented Feb 3, 2022

@lhotari Yes - I removed the user list as a test, and it worked fine then. I've fixed the immediate issue I needed (turned out to be a regression in .Net 6.0.1's Kerberos handling, which was making our Github CI test hosts crash) - which was made much easier by having this action available, thank you.

@will-holley
Copy link

Can confirm this issue is still occurring on ubuntu-latest.

ssh -i ~/.ssh/gh_rsa [email protected]                    
Connection closed by 157.230.199.75 port 22

@sameerjethvani-alation
Copy link

sameerjethvani-alation commented Mar 7, 2022

Commenting here since this can help

I was trying this github action & was facing Connection closed by 157.230.199.75 port 22 when trying to ssh to ubuntu-latest github runner from my local machine . Upon further debugging came to know it was because of ssh-rsa public key being used (reference owenthereal/upterm#93 (comment))

Followed below steps , generating ed25519 key & using it for ssh to uptermd.upterm.dev worked fine for me.

ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "yourusername@company"
ssh -i ~/.ssh/id_ed25519 <somestring>:<somestring>[email protected]

@lhotari
Copy link
Owner

lhotari commented Mar 22, 2022

There's also some notes about RSA keys in the README of upterm.

@lhotari
Copy link
Owner

lhotari commented Mar 22, 2022

One of the commits removed the instructions for the workarounds: owenthereal/upterm@0f410ca

@ureciocais
Copy link

ureciocais commented Nov 29, 2022

Same issue. I'm not limiting connections to any actor.
I can actually connect from a different computer. Is there anything regarding ssh keys that's required even if you don't restrict actors?

@ureciocais
Copy link

I solved it by adding an ssh key to Github.
I had authenticated using only Github's CLI "gh" before

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

6 participants