# HG changeset patch # User Paul Crowley # Date 1255528305 -3600 # Node ID 05b676684c7e83beb5808f9e6f0e5bf210309e67 # Parent 62185dc7d0c9208c00dc1d20c2a257399122d9e3 Call the user jay rather than user, and use pat instead of other-user diff -r 62185dc7d0c9 -r 05b676684c7e doc/manual.docbook --- a/doc/manual.docbook Wed Oct 14 14:48:33 2009 +0100 +++ b/doc/manual.docbook Wed Oct 14 14:51:45 2009 +0100 @@ -69,7 +69,8 @@
Creating a repository host -In what follows, we assume that you usually sit at a machine called +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 @@ -78,48 +79,48 @@ this. -user@my-workstation:~$ ssh-keygen +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/user/.ssh/id_rsa. -Your public key has been saved in /home/user/.ssh/id_rsa.pub. +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 user@my-workstation -user@my-workstation:~$ ssh-add -Enter passphrase for /home/user/.ssh/id_rsa: -Identity added: /home/user/.ssh/id_rsa (/home/user/.ssh/id_rsa) -user@my-workstation:~$ +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 -user@my-workstation:~$ ssh-copy-id repository-host -user@repository-host's password: +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. -user@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% -user@my-workstation:~$ ssh -A repository-host -user@repository-host:~$ sudo dpkg -i ../mercurial-server_0.6.1_amd64.deb -[sudo] password for user: +jay@my-workstation:~$ ssh -A repository-host +jay@repository-host:~$ sudo dpkg -i ../mercurial-server_0.6.1_amd64.deb +[sudo] password for jay: Selecting previously deselected package mercurial-server. (Reading database ... 144805 files and directories currently installed.) Unpacking mercurial-server (from .../mercurial-server_0.6.1_amd64.deb) ... Setting up mercurial-server (0.6.1) ... -user@repository-host:~$ +jay@repository-host:~$ mercurial-server is now installed on the repository host. Next, we need to give you permission to access its repositories. -user@repository-host:~$ ssh-add -L > my-key -user@repository-host:~$ sudo mkdir -p /etc/mercurial-server/keys/root/user -user@repository-host:~$ sudo cp my-key /etc/mercurial-server/keys/root/user/my-workstation -user@repository-host:~$ sudo -u hg /usr/share/mercurial-server/refresh-auth -user@repository-host:~$ exit +jay@repository-host:~$ ssh-add -L > my-key +jay@repository-host:~$ sudo mkdir -p /etc/mercurial-server/keys/root/jay +jay@repository-host:~$ sudo cp my-key /etc/mercurial-server/keys/root/jay/my-workstation +jay@repository-host:~$ sudo -u hg /usr/share/mercurial-server/refresh-auth +jay@repository-host:~$ exit Connection to shell closed. -user@my-workstation:~$ +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 Creating repositories -user@my-workstation:~$ cd my-mercurial-project -user@my-workstation:~/my-mercurial-project$ hg clone . ssh://hg@repository-host/repository/name +jay@my-workstation:~$ cd my-mercurial-project +jay@my-workstation:~/my-mercurial-project$ hg clone . ssh://hg@repository-host/repository/name searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 119 changesets with 284 changes to 61 files -user@my-workstation:~/my-mercurial-project$ hg pull ssh://hg@repository-host/repository/name +jay@my-workstation:~/my-mercurial-project$ hg pull ssh://hg@repository-host/repository/name pulling from ssh://hg@repository-host/repository/name searching for changes no changes found -user@my-workstation:~/my-mercurial-project$ +jay@my-workstation:~/my-mercurial-project$
Adding other users @@ -156,26 +157,26 @@ However, there's a more convenient way. -user@my-workstation:~/my-mercurial-project$ cd .. -user@my-workstation:~$ hg clone ssh://hg@repository-host/hgadmin +jay@my-workstation:~/my-mercurial-project$ cd .. +jay@my-workstation:~$ hg clone ssh://hg@repository-host/hgadmin destination directory: hgadmin no changes found updating working directory 0 files updated, 0 files merged, 0 files removed, 0 files unresolved -user@my-workstation:~$ cd hgadmin -user@my-workstation:~/hgadmin$ mkdir -p keys/users/other-user -user@my-workstation:~/hgadmin$ cp ~/other-users-key.pub keys/users/other-user/their-workstation -user@my-workstation:~/hgadmin$ hg add -adding keys/users/other-user/their-workstation -user@my-workstation:~/hgadmin$ hg commit -m "Add other user" -user@my-workstation:~/hgadmin$ hg push +jay@my-workstation:~$ cd hgadmin +jay@my-workstation:~/hgadmin$ mkdir -p keys/users/pat +jay@my-workstation:~/hgadmin$ cp ~/other-users-key.pub keys/users/pat/their-workstation +jay@my-workstation:~/hgadmin$ hg add +adding keys/users/pat/their-workstation +jay@my-workstation:~/hgadmin$ hg commit -m "Add other jay" +jay@my-workstation:~/hgadmin$ hg push pushing to ssh://hg@repository-host/hgadmin searching for changes remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files -user@my-workstation:~/hgadmin$ +jay@my-workstation:~/hgadmin$ The new user can now read and write to your ssh://hg@repository-host/repository/name repository.