vsftpd installation and configuration instructions

2010-10-12  来源:本站原创  分类:OS  人气:137 

1. Wget ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.2.2.tar.gz
2. Tar-xvzf vsftpd-2.2.2.tar.gz
3. Cd vsftpd-2.2.2
4. Make
5. Make install
6. According to the situation the following modifications, save it as / etc / vsftpd.conf

Quote

# Disables anonymous FTP
anonymous_enable = NO

# Enables non-anonymous FTP
local_enable = YES

# Activates virtual users
guest_enable = YES
# Guest_username = ftp

# Virtual users to use local privs, not anon privs
virtual_use_local_privs = YES

# Enables uploads and new directories
write_enable = YES

# Disable downloads
download_enable = NO

# The PAM file used by authentication of virtual uses
pam_service_name = vsftpd-virtual

# In conjunction with 'local_root',
# Specifies a home directory for each virtual user
user_sub_token = $ USER
local_root = / home / pub / uploads / $ USER # ftp server to upload the root directory specified here

# The virtual user is restricted to the virtual FTP area
chroot_local_user = YES

# Hides the FTP server user IDs and just display "ftp" in directory listings
hide_ids = YES

# Runs vsftpd in standalone mode
listen = YES

# Listens on this port for incoming FTP connections
listen_port = 21

# The minimum port to allocate for PASV style data connections
pasv_min_port = 62222

# The maximum port to allocate for PASV style data connections
pasv_max_port = 63333

# Controls whether PORT style data connections use port 20 (ftp-data)
connect_from_port_20 = YES

# The umask for file creation
local_umask = 022

7. Yum install db4-utils
8. Touch / etc / virtual-users.txt
9. Db_load-T-t hash-f / etc / virtual-users.txt / etc / virtual-users.db
10. The following is saved as / etc / pam.d / vsftpd-virtual

auth required pam_userdb.so db = / etc / virtual-users
account required pam_userdb.so db = / etc / virtual-users

11. Vsftpd &

Note:
1. Virtual-users.txt format: first line is the user name, the second line is the password, and so on
2. If you need to test, you can add in the virtual-users.txt virtual users, and use the command in step 9 to generate a new virtual-users.db

相关文章