Linuxϵͳѧϰ ʮˡVSFTPûʡ

2019-11-29 08:40:38Դ԰ Ķ ()

ǿߣٴȺLinuxʹ

û

Ҫرuserlist

 

 

 

ļҪʹЧ

ʵڸװvsftpʱļ޸ĵûʿõ

local_rootѡӰ

û¼Ŀ¼û¼Ŀ¼DzӰ

ΪֹӰ죬chrootҲע

 

 

û¼IJ裺

1ûļ

2û֤ļ

3༭vsftpPAM֤ļ

4ӳûĿ¼Ȩ

5޸ļ

6vsftp񣬲

7ûȨ

 

һûļļԽκҲԷκλã

vi /etc/vsftpd/vuser.txt  #

cangls  #û

123   #

bols  #û

123   #

ϵû벢ֱӵ¼ϵͳԲ½ȡ

 

 

 

 

ڶû֤ļ

yum –y install db4-utils    #ûаװ֤Ҫװ

db_load –T –t hash –f  /etc/vsftpd/vuser.txt  /etc/vsftpd/vuser.db   #ıĵתΪ֤ݿ

-Tת

-tָת

-fָļ

 

 

 

 

༭vsftpPAM֤ļ

vi /etc/pam.d/vsftpd

auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vuser

account required /lib/security/pam_userdb.so db=/etc/vsftpd/vuser

#ע͵Ум

#עУԽֹû¼Ϊû¼ʱ֤Ȼļ

ļбһЩ򣬶DZû֤

 

 

 

vsftpļһãpamļ

 

 

 

viн2~8#

 

 

 

 

޸ɺ

 

 

 

ʱûͲܵ¼

 

IJӳûĿ¼Ȩ

useradd –d /home/vftproot –s /sbin/nologin vuser   #ûҪ¼ֻӳû

#ûһļһ

chmod 775 /home/vftproot

 

 

 

ɺvftprootȨ700ȨDzûϴģҪȨΪ755

 

岽޸ļ

vi /etc/vsftpd/vsftpd.conf

guest_enable=YES      #û

guest_username=vuser     #FTPûӦϵͳûûҪǰһ

pam_service_name=vsftpd        #PAM֤ļĬϴڣ

 

 

 

 

vsftpd񲢲

service vsftpd restart

ʱûԵ¼鿴أϴ

ĬϴļλûļĿ¼

ȨʹõûȨ޽й

 

ע£ʱͿǰõû¼ftpˣǵ½ʧܣûҵˣ»ָͷ

 

߲ûȨޣϴ⣩

vi /etc/vsftpd/vsftpod.conf

anonymous_enable=NO     #رû¼ӰȫӰû¼

anon_upload_enable=YES

anon_mkdir_write_enable=YES

anon_other_write_enable=YES

#ûȨޣûϴ

ûļĿ¼ϴȨޣftpȨ⻹ҪϵͳļȨá

 

ܽ᣺

1°װyum install –y vsftpd

2رշǽSELinux

ùرշǽ

رգ chkconfig iptables off

chkconfig iptables on

3ùرSELinux

vi /etc/selinux/config

޸SELINUX=disabled

4رտӰftpķǽ

service iptables status    #鿴ǽ

iptables -D INPUT 4          #ɾftpйصIJ

5ϵͳ

6עuserlistѡ

7ûļ

vi /etc/vsftpd/vuser.txt

дûż

8û֤ļ

db_load -T -t hash -f /etc/vsftpd/vuser.txt  /etc/vsftpd/vuser.db

9༭vsftpPAMļ

ע͵е

һ

auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vuser

account required /lib/security/pam_userdb.so db=/etc/vsftpd/vuser

10ӳûĿ¼Ȩ

useradd -d /home/vftproot -s /sbin/nologin vuser

chmod 775 /home/vftproot/

11޸ļ

ӺͿѡ

guest_enable=YES

guest_username=vuser

pam_service_name=vsftpd

12vsftpd񣬲

13ûȨ

עûе¼ɹʵҲܳɹټ¼һ£


ԭ:https://www.cnblogs.com/Yuuki-/p/11957861.html
ԭϵ

ǩimgSpanϵͳQLinux

Ȩվ²磬Ȩϵwest999com@outlook.com
رע⣺վת۲վ۵㣬վṩӰƬ廭ƷʹãԭϵȨԭ

һƪNginx 밲װõļ

һƪcentos7װfail2ban