1

I am ssh'd into a machine at work that has all github privs set up and working nominally when used either in person, or via remote desktop. That is to say that pushing and pulling work normally and no password is required to github.

When I SSH into the machine and try to interact with github, github asks me for the password for the ssh the keys that are being sent to github from the remote:

enter image description here

Is there any way to set my configuration so this doesn't happen? Is there a way to log into a machine and interact with github without it requiring the ssh key password? Maybe some kind of ssh key forwarding?

Otherwise, I end up having to log in via remote desktop and push/pull in a terminal from there.

Very waste of time.

Note I can partially solve the problem by doing:

ssh -A host

But this (agent forwarding) is just using my github keys from my local machine. This might be fine for now I guess.

pixelearth
  • 13,674
  • 10
  • 62
  • 110

1 Answers1

0

Normally, you do not push from GitHub to a remote SSH machine.

You are pushing from the remote SSH machine to GitHub, and you can do so either through an HTTPS URL or an SSH one (git@github.com:<me>/<myProject>).

The latter (sing a GitHub SSH URL) would necessitate its own private/public key pair, whose public key needs to be registered to the SSH settings of the remote GitHub account.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I appreciate the response, but I'm afraid you've misunderstood both parts of the question, and it's probably because I didn't make it super clear. Apparently it sounds like I've never used github, lol. The remote machine has all github privs set up and they work nominally when used either in person, or via remote desktop. Please understand "push/pull" to mean "push to / pull from". The issue is that when SSH'ed into the remote machine, interacting with github requests a password (for the keys set up), whereas it doesn't when interacting in person at the remote machine. – pixelearth Nov 01 '21 at 03:12
  • @pixelearth "The issue is that when SSH'ed into the remote machine, interacting with github requests a password (for the keys set up)" : if "The remote machine has all github privs set up and they work nominally when used either in person", then those same keys should work just fine from an ssh session on that same remote machine with the same remote user. – VonC Nov 01 '21 at 10:47
  • It seems like the keys DO work (note the reference to `id_rsa`), but there is some difference, because github wants the password for THAT KEY. So they don't work the same way. – pixelearth Nov 01 '21 at 14:43
  • @pixelearth Simply generate a key dedicated for that usage, without passphrase. Or use the ssh-agent explicitly. Using ssh means the .bashrc is not always executed, which explains why the private key is not added to the agent, and the passphrase is not cached. Reminder, in the GitHub context, there is no such thing as an "ssh password": I have made that clear recently in https://stackoverflow.com/a/66115245/6309. – VonC Nov 01 '21 at 16:23