Linux伺服器中限制FTP使用者訪問方式

來源:互聯網
上載者:User

Linux伺服器中限制FTP使用者訪問方式
FTP(File Transfer Protocol)協議:是一個用於在電腦間上傳、下載檔案的協議。 FTP工作在用戶端/伺服器端的模式中. FTP伺服器持續監聽來自遠處用戶端的FTP需求,在收到遠處用戶端的需求後,它負責管理登陸及建立串連。建立會話期間,執行FTP用戶端發過來的命令。進入FTP伺服器可以用匿名或者鑒權兩種方式來管理。出於安全考慮,LINUX中的大部分系統,會考慮採用鑒權模式,即進入/訪問FTP伺服器,必須用使用者名稱或密碼的方式。

因為FTP不是一個安全性通訊協定,所以必須盡量被限制。出於安全考慮,因為很多系統會使用CHROOT jail(監牢),因此,FTP使用者除了使用自己的家目錄(/home/username)外,禁止訪問其他目錄。

下面說下如何配置,登陸伺服器,sudo到root使用者。

備份:/etc/vsftpd/vsftpd.conf檔案:

# cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.old 編輯:/etc/vsftpd/vsftpd.conf檔案:
# vi /etc/vsftpd/vsftpd.conf 如果沒有的話,增加下面的行:
userlist_enable=YES
userlist_deny=NO
anonymous_enable=NO

注釋:/etc/vsftpd/user_list中的使用者,僅保留必須使用FTP的使用者。這個使用者必須和具體的FTP登陸方式相匹配。 # vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file,
# and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks
#/etc/vsftpd.ftpusers
# for users that are denied.
ftpuse

在伺服器上,傳HUP掛起進程到vsftpd服務進程。 1.首先尋找PID進程
# ps -ef | grep vsftpd 2.然後輸入下面的命令 # kill -HUP <PID of vsftpd>

其他管理ftp服務的命令:

[root]# service vsftpd stop //-->停ftp服務
[root]# service vsftpd start //-->啟ftp服務
[root]# service vsftpd status //-->查看ftp服務狀態

聯繫我們

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