5分钟在FreeBSD下建立简单的cvs服务器

本文详细介绍了如何在本地系统上搭建CVS版本控制系统仓库。包括创建CVS用户和组、初始化仓库、设置pserver访问方式等步骤。适用于希望了解CVS仓库搭建全过程的技术人员。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 建立cvs用户和组

 

Create a CVS user.

endor# adduser 
Enter username [a-z0-9_-]: cvs
Enter full name []: CVS User
Enter shell bash csh date no sh tcsh [sh]:

 

This means that anyone with the CVS user's password can access the repository without using their own username/password.

 

Enter home directory (full path) [/home/cvs]:
Uid [1003]:
Enter login class: default []:
Login group cvs [cvs]:

 

Everyone that you want to have access to the repository will belong to this group. If you already have such a group (for instance, you may have a coders group), you can use that group instead.

 

Login group is "cvs''. Invite cvs into other groups: guest no
[no]: 
Enter password []:
Enter password again []:

Name:     cvs
Password: ****
Fullname: CVS User
Uid:      1003
Gid:      1003 (cvs)
Class:
Groups:   cvs
HOME:     /home/cvs
Shell:    /bin/sh
OK? (y/n) [y]: 
Added user ``cvs''
Add another user? (y/n) [y]: n
endor#

Add any users that you wish to have access to the CVS repository to the CVS group.

cvs:*:1003:cvs,andrew

 

2. 创建cvs仓库

 

/exports/cvsroot seems to be the typical place to throw a CVS repository. As I didn't have a /exports, I created it under /usr and symlinked to it from /.

endor# mkdir /usr/exports
endor# cd /
endor# ln -s /usr/cvsroot

Create the CVS directory, owned by the user and group you just created, and writable by both.

endor# mkdir /exports/cvsroot
endor# chown cvs:cvs /exports/cvsroot
endor# chmod 775 /exports/cvsroot

As the CVS user, initialise the repository.

endor# su cvs
$ cvs -d /exports/cvsroot init

That's it! You can now use CVS as a local user, or as a remote user over SSH/RSH to import modules, add, update, commit, etc. As a local user, set the CVSROOT to /exports/cvsroot. As a remote user, set the CVSROOT to :ext:username@host:/exports/cvsroot.

If using SSH, under Unix you'll want to set CVS_RSH to ssh. From WinCvs on Windows using PuTTY, go into Admin->Preferences->Ports and type in the path to a copy of plink.exe as the "alternate rsh." Note that you'll need to set up private key authentication for this to work, as otherwise WinCvs will choke when plink asks for the password

3. 设定pserver

 

Pserver is an alternative to RSH/SSH access for users accessing the repository remotely.

Make sure the pserver port is in /etc/services. It already is in FBSD-4.5.

cvspserver      2401/tcp   #CVS network server

Add the pserver line in /etc/inetd.conf. It's already mostly there in FreeBSD 4.5 - uncomment it and point it to /exports/cvsroot. Note that tabs are commonly used between columns, spaces between the arguments to cvs.

cvspserver   stream   tcp   nowait   root   /usr/bin/cvs   cvs --allow-root=/exports/cvsroot pserver

Check to see if inetd is running, and if it is, send it a HUP signal so it re-reads /etc/inetd.conf.

endor# ps ax | grep inetd
20194  ??  Is     0:00.00 /usr/sbin/inetd
endor# kill -1 20194

If it isn't running, start it ...

endor# /usr/sbin/inetd

... and add the following line to /etc/rc.conf so it will be automatically started when the system comes up.

inetd_enable="YES"

You can now access the repository remotely using the pserver. Set CVSROOT to :pserver:username@host:/exports/cvsroot. When using the pserver you'll need to do a cvs login before anything else.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值