Nolan's Blog

a PHP JS UI APP developer

ftp

Install / Setting vsftp in CentOS

1. Install
yum install vsftp

2. Config
vi vsftpd.conf


# turn off anonymous login
anonymous_enable=NO
# use userlist user for ftp
userlist_deny=NO
# open passive mode
pasv_enable=YES
pasv_min_port=10000
pasv_max_port=10010
# login banner
ftpd_banner=Welcome to Putike.cn

3. Create user for ftp
useradd –s /sbin/nologin –d /ftp/home/path username
passwd username

4. Add user to userlist
vi user_list

5. Virtual user if need
a. create virtual user list
touch vuser
eg:
username
password

b. build users db
db_load –T –t hash –f /etc/vsftpd/vuser /etc/vsftpd/vuser.db

c. edit /etc/pam.d/vsftpd, add lines:


auth required pam_userdb.so db=/etc/vsftpd/vuser
account required pam_userdb.so db=/etc/vsftpd/vuser

d. config vsftp


guest_enable=YES # enable guest
guest_username=vuser # user vuser db
pam_service_name=vsftpd # use pam

e. set virtual user config path
user_config_dir=/etc/vsftpd/vsftpd_user_conf

f. config the virtual user settings accoring to your needs.
touch username


anon_world_readable_only=NO # view ftp path
anon_upload_enable=YES # allow download
anon_mkdir_write_enable=YES # create and delete dir
anon_other_write_enable=YES # rename or delete file
local_root=/path/ # define user's root 

继续阅读》

, ,

Powered by WordPress.org.