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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With