Linux CVS確認(rèn)系統(tǒng)中是否安裝xinetd
Linux CVS對于電腦使用的玩家的常用軟件,然后我就學(xué)習(xí)及深入的研究Linux CVS,在這里和大家一起探討Linux CVS的使用方法,希望對大家有用。重裝了一次系統(tǒng),重裝了N次的Linux CVS,終于讓linux下的Linux CVS理論上可以進行開發(fā)。還要感謝超少在忙VB時熱心的做測試……雖然現(xiàn)在是凌晨3點整,還是得總結(jié)一下:
1、咱先把Linux CVS裝上吧
首先確定系統(tǒng)中沒有安裝Linux CVS,如果沒有則安裝:yum install Linux CVS 注:fedora中可以使用光盤安裝,個人認(rèn)為容易點哦
2、確認(rèn)系統(tǒng)中是否安裝xinetd,
在Fedora 6中這個沒有默認(rèn)安裝。如果沒有安裝則安裝:yum install xinetd 注:這個我是用命令行在網(wǎng)上自動下載安裝的,中間還出現(xiàn)了個錯誤,忽略了
3、修改/etc/xinetd.d/Linux CVS
- [root@fc6 Linux CVSROOT]# cat /etc/xinetd.d/Linux CVS
- # default: off
- # description: The Linux CVS service can record the history of your source \
- #files. Linux CVS stores all the versions of a file in a single \
- #file in a clever way that only stores the differences \
- #between versions.
- service Linux CVSpserver
- {
- disable = no
- port= 2401
- socket_type= stream
- protocol = tcp
- wait= no
- user= root
- passenv = PATH
- server = /usr/bin/Linux CVS
- #env= HOME=/zyf/Linux CVS
- server_args= -f --allow-root=/zyf/Linux CVS pserver
- #bind= 127.0.0.1
- }
4、初始化Linux CVS服務(wù)
Linux CVS -d /zyf/Linux CVS init注:這個路徑要和/etc/xinetd.d/Linux CVS中的一致,并且可以隨便根據(jù)自己的需要定制.
5、增加用戶
groupadd Linux CVS
useradd Linux CVSroot -g Linux CVS
6、設(shè)置目錄權(quán)限
chmod 777 /zyf/Linux CVS
7、修改/zyf/Linux CVS/Linux CVSROOT/config文件
- [root@fc6 Linux CVSROOT]# cat config
- # Set this to "no" if pserver shouldn't check system users/passwords
- SystemAuth=no 注:這里默認(rèn)是注釋掉的。
- # Put Linux CVS lock files in this directory rather than directly in the repository.
- #LockDir=/var/lock/Linux CVS
- # Set `TopLevelAdmin' to `yes' to create a Linux CVS directory at the top
- # level of the new working directory when using the `Linux CVS checkout'
- # command.
- #TopLevelAdmin=no
- # Set `LogHistory' to `all' or `TOEFWUPCGMAR' to log all transactions to the
- # history file, or a subset as needed (ie `TMAR' logs all write operations)
- #LogHistory=TOEFWUPCGMAR
- # Set `RereadLogAfterVerify' to `always' (the default) to allow the verifymsg
- # script to change the log message. Set it to `stat' to force Linux CVS to verify
- # that the file has changed before reading it (this can take up to an extra
- # second per directory being committed, so it is not recommended for large
- # repositories. Set it to `never' (the previous Linux CVS behavior) to prevent
- # verifymsg scripts from changing the log message.
- #RereadLogAfterVerify=always
注:這個更改是為了用戶驗證的時候忽略系統(tǒng)用戶,這樣可以避免建立很多的系統(tǒng)帳戶,而影響安全性。
8、增加/zyf/Linux CVS/Linux CVSROOT/passwd文件
[root@fc6 Linux CVSROOT]# cat passwd
zyf:woXRXXMqwnmWs:Linux CVSroot
注:這個密碼文件中第2段是md5的密碼。多個用戶為每行一個. 這個密碼真的不太好得到,每次都是建用戶。
9、增加/zyf/Linux CVS/Linux CVSROOT/readers文件
這個文件中存儲著所有只讀用戶的用戶名,一行一個.
10、增加/zyf/Linux CVS/Linux CVSROOT/writers文件
這個文件中存儲著所有可寫權(quán)限的用戶名,一行一個.注:同一個用戶不要在/zyf/Linux CVS/Linux CVSROOT/readers和/shanmin/Linux CVS/Linux CVSROOT/writers中都填寫,如果都填寫則以/zyf/Linux CVS/Linux CVSROOT/readers中的為準(zhǔn)。
11、關(guān)閉SELinux
[root@~]#setenforce 0注:Linux CVS和SELinux有“沖突”,必須關(guān)閉,不然客戶端會提示沒有權(quán)限。修改/etd/services文件 ,加入以下內(nèi)容:
- Linux CVSpserver 2401/tcp # Linux CVS client/server operations
- Linux CVSpserver 2401/udp # Linux CVS client/server operations
Linux CVS服務(wù)由inted來喚起,因此需要改動inetd提供的服務(wù),我的redhat使用的是inetd 方式則在文件/etc/inetd.conf中加入如下的內(nèi)容:Linux CVSpserver stream tcp nowait root /usr/bin/Linux CVS Linux CVS --allow-root=/home/Linux CVSroot pserver
FC6使用的是xinetd方式,所以在xinetd.d目錄下添加需要啟動的服務(wù):
- cd /etc/xinetd.d
- vi Linux CVSpserver
文件內(nèi)容:
- service Linux CVSpserver
- {
- disable = no
- flags = REUSE
- socket_type = stream
- wait = no
- user = root
- server = /usr/bin/Linux CVS
- server_args = -f --allow-root=/home/Linux CVSroot pserver
- log_on_failure += USERID
- }
12.重新啟動inetd或者xinetd:
/etc/rc.d/init.d/xinetd restart
13.檢查Linux CVSpserver服務(wù)是否已經(jīng)啟動
netstat -l |grep Linux CVSpserver
結(jié)果如下:tcp 0 0 *:Linux CVSpserver *:* LISTEN以上結(jié)果全部通過,但是在客戶機上執(zhí)行Linux CVS -d :pserver:steven@192.168.211.72:/home/Linux CVSroot login 輸入密碼后,沒有收到任何消息,即表示成功^_^ no news is a good news!!在客戶端,設(shè)置環(huán)境變量如下:export Linux CVS_RSH=ssh export Linux CVSROOT=:pserver:username@ip:/home/Linux CVSroot
你可以
- echo $Linux CVS_RSH
- ssh
- echo $Linux CVSROOT
- :pserver:username@ip:/home/Linux CVSroot
這樣你在客戶端就可以直接輸入 Linux CVS login登陸了其它操作都可以直接Linux CVS command 了
12、啟動服務(wù)
service xinetd start
13、防火墻開2401端口
注:我是把防火墻關(guān)了。還要注意:writers一定要設(shè)置好權(quán)限,為了這個頗費了一陣子勁兒。
【編輯推薦】