1. Check whether the system has FTP service
PS-E | grep vsftpd
2. Mount vsftpd
Apt-Get install vsftpd
After the installation is complete, vsftpd is automatically enabled and an FTP user is created for the system.
3. Restart
/Etc/init. d/VsftpdRestart
4. default directory
By default, vsftp automatically enables anonymous accounts. You can view the directory columns corresponding to the FTP account in the/etc/passwd directory by default.
For example, here is
FTP: X: 114: 121: ftp daemon,:/srv/ftp:/bin/false
The default directory is/srv/FTP.
5. Configure vsftp
A. whether to allow anonymity (yes by default)
Anonymous_enable = Yes
B. whether to allow a local account to log on. (if it is commented out by default, it is not allowed)
# Local_enable = Yes
C. If a local user is enabled, set the FTP directory of the local user to its root directory.
# Chroot_local_user = Yes
D. If you want to reset an FTP directory for some local users (the file vsftpd. chroot_list has not been carefully studied)
# Chroot_local_user = Yes
# Chroot_list_enable = Yes
# (Default follows)
# Chroot_list_file =/etc/vsftpd. chroot_list
6. Add a user. If the local account is not enabled, add the user.
Add User net. Specify the user directory as/var/www/net, and the user cannot log on to the system.
# Mkdir/var/www/Net
# Useradd-S/sbin/nologin-D/var/www/Net
Note that-S/sbin/nologin makes it unable to log on to the system.-D specifies the user directory as/var/www/net.
# Passwd net
# Chown-r net: net/var/www/Net
Note: Set all and groups of User Directories and Their subdirectories to net.
7. Modify the listening port
/Etc/vsftpd. conf add listen_port = xxx
8. Modify the data port
Pasv_min_port = 50000
Pasvanderbilt max_port = 55000
Save and exit.
The meaning of these two statements tells vsftpd that the port range for data transmission is between 50000 and 55000.
OK.