zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    【SQLSERVER学习笔记】进攻式编程
    jQuery插件开发全解析
    淘宝前端框架kissyui
    JS获取MVC Attrbuate验证是否通用
    Asp.net MVC 自定义错误页面以及return HttpNotFound遇到的问题
    为类型“xxxx”多次调用了 Map,且其中至少有一个调用未指定目标表名称。
    Entity FreamWork 无法创建“System.Object”类型的常量值。此上下文仅支持基元类型或枚举类型错误解决
    Scala集合
    Scala面向对象
    scala函数
  • 原文地址:https://www.cnblogs.com/lcchuguo/p/5193612.html
Copyright © 2011-2022 走看看