Use SVN+SSH under Windows and Linux

 

This post is a simple write-up of the process and problem during my experience. Note: Please replace username to what you need in this post!

Under Linux (Ubuntu here)

1. Create public and private key under Linux

1
ssh -keygen -t rsa -b 4096 -f <username>

You will see two new file under the directory.

2. You need to send the username.pub file to the server administrator and you keep the private key file username.

3. Test SSH

1
ssh -i username username@host(or IP)

Note: the first username is your private key file and the second one is the username for login.

4. Test SVN

1
svn co svn+ ssh : //username @host /path_to_repository

Under Windows (Win 7)

1. Get the copy of the private key file

2. Convert the key into Putty format. Start PuTTYgen and use Conversions -> Import key Browse to your file keyfile which you got from the server. Finally click on Save private key and save the file as keyfile.PPK.

3. Use this new key file for SSH. Start putty and on the Session tab set the hostname to the name or IP address of your server, the protocol to SSH and save the session as SvnConnection or whatever name you prefer. On the SSH tab set the preferred SSH protocol version to 2 and from Auth set the full path to the .PPK private key file you converted earlier. Go back to the Sessions tab and hit the Save button. You will now see SvnConnection in the list of saved sessions.  Click on Open and you should see a telnet style login prompt.

4. Test TortoiesSVN. One way to simplify the URL in TortoiseSVN is to set the user inside the PuTTY session. For this you have to load your already defined session SvnConnection in PuTTY and in the Connection tab set Auto login user to the user name, e.g. svnuser. Save your PuTTY session as before and try the following URL inside TortoiseSVN: svn+ssh://SvnConnection/repos

5. Check out the SVN use the same URL.

Reference: http://tortoisesvn.net/ssh_howto.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值