0

I need to execute a git command on a remote server and I have a private key with a passphrase. How can I ssh-add my key to the server so I can run git commands there without copying the private key there? I've searched a lot for this, but did not find pages which would answer this question.

Lajos Arpad
  • 64,414
  • 37
  • 100
  • 175

1 Answers1

0

You have to put the public key content on the server in ~/.ssh/authorized_keys (the file can hold many keys from different people). Then, you can use ssh-add providing your private key so that it can be used when going with ssh against the server.... or you could use -i when using ssh to provide the private key file.

eftshift0
  • 26,375
  • 3
  • 36
  • 60