svn+ssh

According to official document, svn+ssh is supposed to be somehow faster than apache+dav_svn, however based on my setup, it's slower.

# install subversion if missing
sudo apt-get install subversion

# add a system user for all incoming ssh connections
useradd -m svnuser

# create the SVN repository
 sudo svnadmin create /var/svn/repoOne
 sudo chown -R svnuser repoOne
 svnuser will be essentially the account to interact with svnserve, so need to grant it all the relevant permissions to the repositories.

# Create Keys using ssh-keygen and append pub key to authorized_keys of the user above

ssh-keygen -b 1024 -t dsa -N passphrase -f keyfile

cat keyfile.pub >> /home/svnuser/.ssh/authorized_keys

# download the key to local(say windows), convert the private key using putty for later tortoisesvn client to use.
# or can create locally first using puttygen and then upload it server and do the attach of pub key, both ways works(make sure delete the first line and last line in the pub key if generated using puttygen)

# edit the command in authorized_keys

vi /home/svnuser/.ssh/authorized_keys
## find the line whose pub key is specically for svn access, update it as below for example:
command="/usr/bin/svnserve -t -r /var/svn --tunnel-user=userOneWhoDoesCheckIn" ssh-rsa [pub key] [optional comment]
## note:
1. userOneWhoDoesCheckIn is the user who will appear on the svn audit info, but actually it delegates operation to svnuser.
2. command here can be complex, e.g. you might want to specify some additional options here:
no-port-forwarding,no-agent-forwarding,no-X11-forwarding, no-pty

# download pageant.exe from putty official website if missing.
# add the private key into pageant.exe(client authentication depends on it, so it needs to be running before any client svn access)
# note: if you had previously specified a password for the ssh key, then here you will be prompted to input the same pwd here when adding.

# put below link into tortoisesvn
svn+ssh://svnuser@serverIPAddress/repoOne
the first time you will be prompted to cache the pub key, choose yes, so you won't be any more.



Reference:

http://svnbook.red-bean.com/en/1.5/svn-book.html#svn.serverconfig.choosing.svn-ssh

http://tortoisesvn.net/ssh_howto.html

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值