Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux綜合 >> Linux資訊 >> Linux文化

CVS 伺服器登入被拒?pserver 架設與權限排查

環境是 Fedora Core 5,已建立 cvs 群組與 cvsroot 使用者並授權,chkconfig --list 顯示 cvspserver 為 on,但用 cvsroot 登入時輸入密碼後被拒。

先確認服務真的在聽

用 netstat -l | grep cvspserver 確認連接埠有沒有起來。若沒有,問題在 xinetd 設定;有起來但仍被拒,問題在驗證。

xinetd 設定檔

在 /etc/xinetd.d/cvspserver 寫入:

service cvspserver
{
  disable = no
  socket_type = stream
  wait = no
  user = root
  env = HOME=
  server = /usr/bin/cvs
  server_args = -f --allow-root=/home/cvsroot pserver
}

改完重啟 xinetd。--allow-root 指定 repository 位置,可列多個。

驗證失敗的常見原因

多數「refused」其實是 CVS 的驗證檔沒設對。做法是:

1. 修改 /home/cvsroot/CVSROOT/config,把 #SystemAuth = no 前面的註解號拿掉,改為 SystemAuth = no,讓 CVS 用自己的 passwd 檔驗證。
2. 建立沒有家目錄的虛擬帳號:useradd -g cvs -M bogus 並設密碼。
3. 把 /etc/shadow 複製為 /home/cvsroot/CVSROOT/passwd,權限設 644。
4. 編輯該檔,只留要開放的使用者,並把每行第二個冒號之後的內容刪掉、加上 cvsroot,格式如 bogus:加密後的雜湊:cvsroot。
5. 刪除系統中那個暫時帳號:userdel -f bogus。

別忘了權限

repository 目錄的擁有者需為 cvsroot 且群組為 cvs:chown -R cvsroot.cvs /home/cvsroot,並給予群組寫入權限,否則能登入卻無法 commit。

Copyright © Linux教程網 All Rights Reserved