Article Title: configure a vsftp server in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
1. Check whether vsftpd, rpm-qa | grep vsftp is installed.
2. Create a user
Useradd test-g root-d/mpeg-s/sbin/nologin # This user is only used to support the FTP service, so he does not have to log on to the system
Note: Change the user's shell command to usermod-s/sbin/nologin coship.
3. Set a password
Passwd test # enter the password twice in a row
4. Modify SELinux Parameters
Setsebool ftpd_disable_trans 1
Service vsftpd restart
Note: If this parameter is not modified, a prompt is displayed during connection.
500 OOPS: cannot change directory:/mpeg
500 OOPS: child died
5. Modify/mpeg Permissions
Chmod 775/mpegr
6. Set/etc/vsftpd. conf
Set anonymous_enable = NO to restrict anonymous user logon.
Local_enable = YES # enable local user logon
Write_enable = YES # Set the write operation.
Local_umask = 022 # Set the permission mask for uploaded files
Userlist_enable = YES # Enable User Logon Control
Local_root =/mpeg (custom path) # define the root directory of all local users. When a local user logs in, it is replaced with this directory. (Comment to access the user's own directory)
Otherwise, the system prompts 550 Failed to change directory when accessing other directories.
Chroot_local_user = NO
Chroot_list_enable = YES
Chroot_list_file =/etc/vsftpd/chroot_list # indicates the list files of users locked in their own directories. The file format is one user per row.
Note:
When chroot_local_user = NO and chroot_list_enable = YES, users in chroot_list are locked, that is, they cannot access other directories except their own directories.
When chroot_local_user = YES and chroot_list_enable = YES, users in chroot_list are non-locked and can access any other directories.
VII. Set vsftpd to start automatically
Chkconfig vsftpd on or
Run ntsysv to select vsftpd or
Echo "/usr/local/sbin/vsftpd &">/etc/rc. local
8. Disable the firewall and SELinux if access is unavailable.
1. service iptables stop
2. edit/etc/selinux/config and set SELINUX to disabled, that is, SELINUX = disabled.
Or run system-config-securitylevel-tui in the terminal.
Or click "system"-> "administration"-> "security level and firewall to set the firewall and SELinux.