まずは cvs をインストールして下さい。
現代的なやりかたは、これです。
openssh の設定にある ForceCommand オプションを利用します。
/usr/pkg/etc/ssh/sshd_config の最後に見本がついているので、 そのコメントをはずすだけでOKです。
# Example of overriding settings on a per-user basis Match User anoncvs X11Forwarding no AllowTcpForwarding no ForceCommand cvs server
ユーザには次のように使ってもらうことになります。
% cvs -d anoncvs@anoncvs.example.org:/cvsroot co REPOSITORY
動作: この場合 ssh anoncvs@anoncvs.example.org cvs server が起動されま す。CVSROOT は -d で指定している /cvsroot になるので、そこに準備してお く必要があります。別のパスでも問題ありません。ユーザにアナウンスする情 報が変わるだけです(例: anoncvs@anoncvs.example.org:/usr/local/cvsroot)。
注意: ユーザ anoncvs 以外は ssh で入れないことを要確認。
Caution |
pserver は昔の流儀です。 |
まず ユーザ anoncvs を作ります。
# useradd -u 32765 -g 32766 -m anoncvs
次に /exports/cvsroot ディレクトリを準備し、cvs init します。
# mkdir /exports/cvsroot # chown anoncvs /exports/cvsroot # su anoncvs % cvs -d /exports/cvsroot initそして、架空のパスワードファイルを設定してください。
% echo anoncvs: > passwdパスワードは必要ないので anoncvs: でかまいません。
次に、ロックファイルのための専用ディレクトリ /var/lock/cvs を作り、 オーナをユーザ anoncvs にします。 また SystemAuth=no に設定し、必要ならローカルタグ tag= も定義してくだ さい。
# Set this to "no" if pserver shouldn't check system users/passwords SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. LockDir=/var/lock/cvs # Set `TopLevelAdmin' to `yes' to create a CVS directory at the top # level of the new working directory when using the `cvs checkout' # command. #TopLevelAdmin=no # Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the # history file, or a subset as needed (ie `TMAR' logs all write operations) #LogHistory=TOFEWGCMAR # Set this to the name of a local tag to use in addition to Id tag=FML
/etc/inetd.conf に以下のエントリを加え inetd に HUP シグナルを送る。
# anonymous cvs cvspserver stream tcp nowait anoncvs /usr/pkg/bin/cvs cvs --allow-root=/exports/cvsroot pserver
Copyright (C) 1993-2025 Ken'ichi Fukamachi mail:< fukachan at fml.org >