开发者

use non default ssh key with svn+ssh

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 k开发者_JAVA技巧ey.

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?


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://...


This one should work

SVN_SSH="ssh -i /home/otheruser/.ssh/id_rsa" svn co svn+ssh://otheruser@your_svn_url
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜