$ sudo yum -y install mercurial $ hg version Mercurial - 分散構成管理ツール(バージョン 1.8.2) (詳細は http://mercurial.selenic.com を参照のこと) Copyright (C) 2005-2011 Matt Mackall 他 本製品はフリーソフトウェアです。 頒布条件に関しては同梱されるライセンス条項をお読みください。 市場適合性や特定用途への可否を含め、 本製品は無保証です。
$ su パスワード: # useradd hguser # passwd hguser ユーザー hguser のパスワードを変更。 新しいパスワード: 新しいパスワードを再入力してください: passwd: 全ての認証トークンが正しく更新できました。
# su hguser $ cd /home/hguser/ $ mkdir -p hgrepository/ourwork $ cd hgrepository/ourwork/ $ hg init
各ユーザに秘密鍵と公開鍵のペアを作ってもらう
[~]$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/Users/Atsushi/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /Users/Atsushi/.ssh/id_rsa. Your public key has been saved in /Users/Atsushi/.ssh/id_rsa.pub. The key fingerprint is: 38:cd:b8:cf:71:18:31:82:62:07:12:2f:dd:d4:dc:4a Atsushi@hondou-atsushi-no-MacBook.local The key's randomart image is: +--[ RSA 2048]----+ |o.. .o . | | + + .E . | |. = +...o | | o o .* o | | + S | | o o | | . o . | | o o | | o | +-----------------+ [~]$ ls ~/.ssh/ id_rsa id_rsa.pub known_hosts [~]$ mv ~/.ssh/id_rsa ~/.ssh/hguser_id_rsa [~]$ mv ~/.ssh/id_rsa ~/.ssh/atsushi_id_rsa.pub
/.ssh/authorized_keys を作成する
(サーバ側)
$ whoami hguser $ mkdir .ssh $ chmod 700 .ssh $ cd .ssh $ touch authorized_keys $ chmod 600 authorized_keys
/.ssh/authorized_keys に公開鍵を登録する
(サーバ側)
$ cat ~/atsushi_id_rsa.pub >> authorized_keys $ rm ~/atsushi_id_rsa.pub
[~/.ssh]$ ssh-add ~/.ssh/hguser_id_rsa Enter passphrase for /Users/Atsushi/.ssh/hguser_id_rsa: Identity added: /Users/Atsushi/.ssh/hguser_id_rsa (/Users/Atsushi/.ssh/hguser_id_rsa) [~/.ssh]$ uname -a Darwin hondou-atsushi-no-MacBook.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386 i386 [~/.ssh]$ ssh hguser@192.168.1.2 -i ~/.ssh/hguser_id_rsa [hguser@orange ~]$ uname -a Linux orange.homelan 2.6.34.9-69.fc13.i686.PAE #1 SMP Tue May 3 09:13:56 UTC 2011 i686 i686 i386 GNU/Linux [hguser@orange ~]$ exit logout Connection to 192.168.1.2 closed.
アクセスできない場合 (Permission denied) には、サーバ側の /var/log/secure を見る