Reputation: 199
Suppose that I have a remote server and GitLab private repository.
I do not want to add key from my server to ssh keys in GitLab account, so I make ssh key forwarding.
However, when I try to run my initial installation scripts with sudo
, I cannot pull the repository because with sudo my ssh keys are not accessible on the server.
How can I handle it?
Upvotes: 3
Views: 215
Reputation: 1323803
Check first, as in here, if you can allow the other user (sudo -u otheruser
) to access $SSH_AUTH_SOCK
file, and it's directory.
That way, you would still benefit from the original SSH tunnel: simply giving more permission to $(dirname $SSH_AUTH_SOCK)
can be enough.
Upvotes: 1