ProFTPD筆記二(虛擬使用者)

來源:互聯網
上載者:User
所謂虛擬,就是說這個使用者不是系統使用者,而只是ProFTPD自己的私人使用者。和windows中的FTP server軟體serv-U中的使用者很像。由於不是系統使用者,使用虛擬使用者可以提高安全性。

虛擬使用者的資訊可以從普通檔案、資料庫、LDAP伺服器等地方獲得。此處介紹最簡單的一種,讓ProFTPD從檔案獲得虛擬使用者資訊。

1. 在/etc/proftpd.conf中加入
RequireValidShell off
AuthOrder mod_auth_file.c
AuthUserFile /usr/local/etc/proftpd/passwd
AuthGroupFile /usr/local/etc/proftpd/group
其中,AuthOrder指定了許可權檢查的順序。這裡只使用虛擬使用者。AuthUserFile和AuthGroupFile的檔案格式看passwd(5)和group(5)。如果使用者名稱和組名與系統的重複,看DirFakeUser和DirFakeGroup。

2. 使用ftpasswd建立passwd和group檔案
$ ftpasswd --passwd --file=/usr/local/etc/proftpd/passwd --name=test1 --uid=2001 \
 --home=/home/nohome --shell=/bin/false
$ ftpasswd --passwd --file=/usr/local/etc/proftpd/passwd --name=test2 --uid=2002 \
 --home=/home/nohome --shell=/bin/false
建立了一個test1和test2使用者

$ ftpasswd --group --name=test --gid=2001
建立了一個test組

$ ftpasswd --group --name=test --gid=2001 --member=test1 --member=test2
把test1和test2加入test組

3. 重啟proftpd 

備忘:
ftpasswd命令在proftpd的原始碼包裡就有,比如我的就在:
/usr/src/proftpd-1.3.1/contrib/ftpasswd
把ftpasswd改為可執行,拷貝到你可以用的任意地方就行了。

參考:
http://www.castaglia.org/proftpd/doc/contrib/ProFTPD-mini-HOWTO-Authentication.html
http://www.castaglia.org/proftpd/contrib/ftpasswd.html
http://www.castaglia.org/proftpd/doc/contrib/ProFTPD-mini-HOWTO-AuthFiles.html
http://www.castaglia.org/proftpd/doc/contrib/ProFTPD-mini-HOWTO-VirtualUsers.html

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.