Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
a modified wrapper for ssh access to a limited set of mercurial repositories
Python
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README.md
hgssh2.conf
hgssh2.py

README.md

hgssh2

A python script to control ssh access to mercurial repositories.

modified from hg-ssh (http://www.selenic.com/repo/hg-stable/raw-file/tip/contrib/hg-ssh)

See http://mercurial.selenic.com/wiki/SharedSSH for more information.

How to

copy hgssh2.py to your $PATH (e.g./usr/local/bin).

Create a new user hg with home directory /home/hg, all your repositories will go here.

Create a config file at /home/hg/hgssh2.conf:

[YOURNAME]

repo2 = read     
repo3 = write    

Add a new entry to /home/hg/.ssh/authorized_keys

command="hgssh2.py YOURNAME hgssh2.conf" ssh-rsa your_ssh_rsa_public_key

Create the repositories:

cd /home/hg/ && hg init repo2 && hg init repo3

Now you can access (only) these two repositories using your ssh key:

ssh://hg@example.com/repo2  (readonly to you)
ssh://hg@example.com/repo3
Something went wrong with that request. Please try again.