相忘于江湖

泉涸,鱼相与处于陆,相呴以湿,相濡以沫,不如相忘于江湖。《庄子.大宗师篇》

access Mercurial over ssh tunnel

Monday Apr 09, 2007

Accessing Mercurial through http/apache is handy, but it requests the workspace is owned by the same user with httpd (webservd:webservd on solaris). So accessing Mercurial over ssh tunnel is a better choice (this is also the way http://www.opensolaris.org/ chose).

Client side:

  1. $ ssh-keygen -b 1024 -t dsa
    [ create id_dsa.pub for server side ]
  2. $ cat <<EOF > $HOME/.hgrc
    [ui]
    username = User Name <user.name@example.com>

 
Server side:

  1. $ cat <<EOF > $HOME/.ssh/authorized_keys

    command="cd /workspace/scm/hg/hgroot; /usr/demo/mercurial/hg-ssh g11n",\ no-port-forwarding,no-X11-forwarding,no-agent-forwarding ssh-[type] [key] 

    EOF

 

Client side:

  1. $ hg clone ssh://agc163.prc.sun.com/g11n
  2. [play with it]
  3. $ hg ci
  4. $ hg push

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed