您現在的位置是:首頁 > 棋牌

本地使用者訪問FTP服務,拒絕匿名使用者訪問

  • 由 玩物生活事 發表于 棋牌
  • 2022-04-20
簡介配置本地使用者訪問FTP服務,拒絕匿名使用者訪問驗證黑白名單禁錮普通使用者在自己的主目錄裡面一、檢視安裝軟體包[root@localhost Server]# rpm -q vsftpdpackage vsftpd is not insta

匿名ftp服務的含義是什麼

配置本地使用者訪問FTP服務,拒絕匿名使用者訪問

驗證黑白名單

禁錮普通使用者在自己的主目錄裡面

一、檢視安裝軟體包

[root@localhost Server]# rpm -q vsftpd

package vsftpd is not installed

[root@localhost Server]# rpm -ivh vsftpd-2.0.5-28.el5.x86_64.rpm

warning: vsftpd-2.0.5-28.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Preparing... ########################################### [100%]

1:vsftpd ########################################### [100%]

[root@localhost ~]# useradd lili

[root@localhost ~]# useradd maka

[root@localhost ~]# useradd kaka

[root@localhost ~]# echo "123456" | passwd --stdin lili

Changing password for user lili.

passwd: all authentication tokens updated successfully.

[root@localhost Server]# useradd kaka

[root@localhost Server]# echo "123456" | passwd --stdin lili

Changing password for user lili.

passwd: all authentication tokens updated successfully.

[root@localhost ~]# echo "123456" | passwd --stdin maka

Changing password for user maka.

passwd: all authentication tokens updated successfully.

[root@localhost ~]# echo "123456" | passwd --stdin kaka

Changing password for user kaka.

passwd: all authentication tokens updated successfully.

二、修改主配置

[root@localhost ~]# vim /etc/vsftpd/vsftpd.conf

...

12 anonymous_enable=NO (拒絕匿名使用者登入)

...

[root@localhost ~]# vim /etc/vsftpd/ftpusers(設定黑名單)

...

lili

[root@localhost ~]# grep lili /etc/vsftpd/ftpusers

lili

[root@localhost ~]#Vim /etc/vsftpd/user_list

...

maka

[root@localhost ~]# grep maka /etc/vsftpd/user_list(設定黑白名單)

maka

[root@localhost ~]# vim /etc/vsftpd/vsftpd.conf

...

119 userlist_deny=NO (只允許user_list裡面的使用者訪問ftp)

[root@localhost ~]# grep userlist_deny /etc/vsftpd/vsftpd.conf

userlist_deny=NO

三、啟動服務

[root@localhost ~]# service vsftpd restart

關閉 vsftpd: [確定]

為 vsftpd 啟動 vsftpd: [確定]

[root@localhost ~]# chkconfig vsftpd on

四、客戶端測試

root@localhost ~]# ftp 192.168.10.10(只允許user_list裡面的使用者訪問FTP)

Connected to 192.168.10.10.

220 (vsFTPd 2.0.5)

530 Please login with USER and PASS.

530 Please login with USER and PASS.

KERBEROS_V4 rejected as an authentication type

Name (192.168.10.10:root): maka

331 Please specify the password.

Password:

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> pwd

257 "/home/maka"

五、將實驗環境還

...

12 anonymous_enable=YES(允許匿名使用者登入)

...

119 userlist_deny=YES(不允許userlist_deny裡的使用者登入)

(目前只有kaka能登陸訪問,lili使用者在黑名單裡,maka在黑白名單裡設定的不允許訪問ftp)

Top