github / gh-net

A network bridge between a Codespace and a local machine.
https://github.com/github/gh-net
285 stars 21 forks source link

Documentation on how to setup ssh #21

Closed KyleJamesWalker closed 2 years ago

KyleJamesWalker commented 2 years ago

Is your feature request related to a problem? Please describe. Can you explain how to setup sudo gh codespace ssh, I have gh codespace ssh working just fine, but I'm not sure what's needed to get it working on mac with sudo. I tried generating a new ssh key, and then adding that to /var/root/.ssh but that doesn't seem to work, and I can hack an ownership in my current ~/.ssh to get a little closer, but overall I can't figure out what might be needed to get this setup with the correct ssh key with sudo.

Describe the solution you'd like A small document showing how to setup sudo with your gh ssh key.

legomushroom commented 2 years ago

Hey @KyleJamesWalker 👋

Did you use ssh-add -K ~/.ssh/id_ed25519 as suggested in step 3 of Adding your SSH key to the ssh-agent instructions? It resolved the issue for me last time I had it 🤞

If that does not help, try using the /root/.ssh folder for the config/private key files.

Files: 👉

/root/.ssh/config:

Match all
    IdentityFile ~/.ssh/private-key

/root/.ssh/private-key:

-----BEGIN OPENSSH PRIVATE KEY-----
<reducted>
-----END OPENSSH PRIVATE KEY-----
legomushroom commented 2 years ago

This issue also contains some debugging steps: https://github.com/github/gh-net/issues/9

KyleJamesWalker commented 2 years ago

Thank you so much this should get me up and running 🥳

legomushroom commented 2 years ago

@KyleJamesWalker thanks for confirming that the solution works 👍