Reputation: 203
I have a set up script that has parts that require root. Part of the setup is a svn+ssh
checkout (which does not need root but is still run as root). I have a special user for ssh and I set up the keys such that if run as that user no password is needed and the automation works. However, since its run with sudo as a different user, svn+ssh
looks in the wrong location for the key.
I know ssh has -i which allows me to specify the key file to use. Is there a way to sell svn+ssh to do that?
Upvotes: 4
Views: 2626
Reputation: 1
This one should work
SVN_SSH="ssh -i /home/otheruser/.ssh/id_rsa" svn co svn+ssh://otheruser@your_svn_url
Upvotes: 0
Reputation: 288200
You can use arbitrary programs instead of ssh. Simply add the following to your config
file (~/.subversion/config
):
[tunnels]
ssh-otheruser = ssh -i /home/otheruser/.ssh/id_rsa
Then, you can checkout with
svn co svn+ssh-otheruser://...
Upvotes: 5