Nolan's Blog

a PHP JS UI APP developer

vsftp

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 nolanchou.com

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

in new centos. we need chmod a-w /ftp/home/path

4. Edit userlist.
vi user_list

5. Virtual user if you 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. edit vsftp config.


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/vuser_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=/ftp/home/pash/username # define user's root

继续阅读》

, ,

Powered by WordPress.org.