Linux實踐工程師學習筆記十五

來源:互聯網
上載者:User

使用者控制

#vi /etc/vsftpd.conf添加

userlist_enable=YES      啟用使用者列表

userlist_file=/etc/ftpusers      定義使用者列表檔案位置

userlist_deny   =YES                    拒絕列表的使用者

                   =NO                     只允許清單的使用者登入

 

#vi /etc/ftpusers

編緝使用者列表,將要進行控制的使用者添加進去,一行一個使用者

#ldd vsftpd     顯示依賴的共用庫

預設編譯安裝沒有支援PAM模組,通過ldd /usr/sbin/vsftpd看是否在依賴於libpam.so.0,如果有證明服務支援PAM。

 

通過光碟片RPM安裝(第二張)

#rpm -ivh vsftpd-2.0.4-1.2.i386.rpm

設定檔及使用者列表在/etc/vsftpd目錄下

pam服務名 /etc/pam.d/vsftpd

vsftpd在/usr/sbin/vsftpd

ftp預設拒絕id 500以下的使用者登入

 

虛擬帳號

對於用DB庫儲存使用者及密碼,先看系統是否有相應軟體包

#rpm -qa | grep db4

db4-devel              第三張盤

db4                第一張盤

db4-utils         第4張盤

 

1.建虛擬帳號users.txt

tom

123

jack

123

使用者密碼各佔一行

#db_load -T -t hash -f users.txt /etc/vsftpd/vsftpd_login.db

#chmod 600 /etc/vsftpd/vsftpd_login.db

2.修改/etc/pam.d/vsftpd 增加(將其他注釋掉)

auth        required   pam_userdb.so       db=/etc/vsftpd/vsftpd_login

account   required pam_userdb.so       db=/etc/vsftpd/vsftpd_login

3.建虛擬帳號目錄

#useradd vuser

!!注意,編譯安裝vsftpd時,首先檢查是否安裝了pam-devel(FC5在第4張盤),否則編譯選項定義了pam,但依然無法使用pam服務,最好用ldd確定一下

4.編緝/etc/vsftpd/vsftpd.conf

anonymous_enable = NO

local_enable =YES

write_enable=YES

anon_upload_enable=NO

anon_mkdir_write_enable=NO

anon_other_write_enable=NO

guest_enable=YES

guest_username=vuser

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.