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.
Asked
Active
Viewed 68 times
0

Lajos Arpad
- 64,414
- 37
- 100
- 175
1 Answers
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
-
The solution was to run ssh -A. That way I was able to clone on the remote server. – Lajos Arpad Oct 19 '18 at 18:01