# HG changeset patch # User Paul Crowley # Date 1255536413 -3600 # Node ID e8bf13d06582679d44674df934bc59f0b00fb278 # Parent 850d46ca28cafe63744aed9f4683eababbe12c44 Assume they have SSH set up; talk about hgadmin first diff -r 850d46ca28ca -r e8bf13d06582 doc/manual.docbook --- a/doc/manual.docbook Wed Oct 14 16:43:36 2009 +0100 +++ b/doc/manual.docbook Wed Oct 14 17:06:53 2009 +0100 @@ -31,48 +31,28 @@ mercurial-server authenticates users not using passwords but using SSH public keys; everyone who wants access to a mercurial-server repository -will need such a key, so you'll need to familiarize yourself with them -before proceeding. In combination with ssh-agent (or +will need such a key. In combination with ssh-agent (or equivalents such as the Windows program Pageant), this means that users will not need to type in a password to access the repository.
-Creating a repository host +Installing mercurial-server In what follows, we assume that your username is jay, that you usually sit at a machine called my-workstation and you wish to install mercurial-server on repository-host. First, you'll need to -create an SSH public key if you haven't already. You should consult your -system documentation on how to do this, but it should look something like -this. +class="systemname">repository-host. We assume that you have created your SSH public key, set up your SSH agent with this key, and that this key gives you access to repository-host. If you're not familiar with SSH public keys, the OpenSSH Public +Key Authentication tutorial may be helpful. +First install mercurial-server on repository-host: -jay@my-workstation:~$ ssh-keygen -Generating public/private rsa key pair. -Enter passphrase (empty for no passphrase): -Enter same passphrase again: -Your identification has been saved in /home/jay/.ssh/id_rsa. -Your public key has been saved in /home/jay/.ssh/id_rsa.pub. -The key fingerprint is: -8b:aa:0a:98:fe:e7:84:48:a3:fe:5f:31:4b:16:e6:0b jay@my-workstation -jay@my-workstation:~$ ssh-add -Enter passphrase for /home/jay/.ssh/id_rsa: -Identity added: /home/jay/.ssh/id_rsa (/home/jay/.ssh/id_rsa) -jay@my-workstation:~$ -Now copy the files you're going to need over to your target system, and install mercurial-server - -jay@my-workstation:~$ ssh-copy-id repository-host -jay@repository-host's password: -Now try logging into the machine, with "ssh 'repository-host'", and check in: - - .ssh/authorized_keys - -to make sure we haven't added extra keys that you weren't expecting. -jay@my-workstation:~$ scp mercurial-server_0.6.1_amd64.deb repository-host: +jay@my-workstation:~$ scp mercurial-server_0.6.1_amd64.deb repository-host: mercurial-server_0.6.1_amd64.deb 100% jay@my-workstation:~$ ssh -A repository-host jay@repository-host:~$ sudo dpkg -i ../mercurial-server_0.6.1_amd64.deb @@ -95,12 +75,14 @@ jay@my-workstation:~$ You can now create repositories on the remote machine and have complete -read-write access to all of them; you need never log on to repository-host again. +read-write access to all of them.
Creating repositories + +To store a repository on the server, clone it over. + jay@my-workstation:~$ cd my-mercurial-project jay@my-workstation:~/my-mercurial-project$ hg clone . ssh://hg@repository-host/repository/name @@ -121,12 +103,7 @@ As things stand, no-one but you has any access to any repositories you create on this system. In order to give anyone else access, you'll need a copy of their SSH public key; we'll assume you have that key in -~/sam-key.pub. You could give them access by -logging into repository-host, -putting the key in the right place under /etc/mercurial-server/keys, and re-running -sudo -u hg /usr/share/mercurial-server/refresh-auth. -However, there's a more convenient way. +~/sam-key.pub. To manage access, you make changes to the special hgadmin repository. jay@my-workstation:~/my-mercurial-project$ cd .. @@ -156,6 +133,14 @@ pushing changes to hgadmin, and you can use Mercurial to cooperate with other root users in the normal way. + +If you prefer, you could give them access by +logging into repository-host, +putting the key in the right place under /etc/mercurial-server/keys, and re-running +sudo -u hg /usr/share/mercurial-server/refresh-auth. +However, using hgadmin is usually more convenient if you need to make more than a very few changes; it also makes it easier to share administration with others and provides a log of all changes. +
Basic access control