Reprint: Mu Xin _
Address: http://bbs.csdn.net/topics/392186116
----------------------------------------------------------
Target: Install VSFTPD service
Use root mode for easy installation
First, step----------------------------------------------
1, switch the root user mode (in root mode, please ignore)
Sudo-i
#然后提示你输入当前用户密码, enter the password after the return if the correct password console will become [email protected]***:/#.
2. Update the SOFTWARE source
Apt-get Update
3, Installation vsftpd
Apt-get Install VSFTPD
#安装完成后vsftpd会创建一个用户组和一个用户, it is said that anonymous users will use Cat/etc/group to view the user group cat/etc/passwd can view the user and the user's default directory
#vsftpd默认创建的用户 FTP default directory is/SRV/FTP command line is False
4.0, the operation is convenient we create custom FTP directories and user groups for FTP
4.1, create the FTP directory/home/ftp of course you can also create to other directories
Mkdir/home/ftp
4.2. Create an FTP user group Ftp-g This you can also use other group names
Groupadd ftp-g
4.3, set the FTP directory read and Write permissions (note: The root directory of the user login if the permissions set too large to log in, the root directory subdirectory can give a lot of permissions)
chmod 755/home/ftp
4.4. Set folder attribution to root and our new FTP user group
Chown root:ftp-g/home/ftp
5.0. Set up FTP user directory and add FTP user
5.1. Create directory A and set permissions for user ftp_a
mkdir/home/ftp/a
chmod 755/home/ftp/a
5.2, add user ftp_a and set the attribution user group to FTP-G and set the default directory (FTP login directory)-s/sbin/nologin prohibit users to login to the console
Useradd-g ftp-g-d/home/ftp/a-s/sbin/nologin ftp_a
5.3, to the new user ftp_a set password (no password can not login)
passwd ftp_a
#然后按照提示输入两遍密码 For example, we set it to 123456798.
6. Open the external network port to FTP (default: TCP port 21)
UFW Allow 21/tcp
7. Start the FTP service
/ETC/INIT.D/VSFTPD start
8, using the user link created by US FTP server for file upload download test
Second, the question----------------------------------------------
Question 1, user login hint 530 login Incorrect workaround
Open/etc/vsftpd.conf
Change PAM_SERVICE_NAME=VSFTPD to Pam_service_name=ftp and save
Restart the VSFTPD service and then login
/ETC/INIT.D/VSFTPD restart
Issue 2, upload file 550 error
Modify/etc/vsftpd.conf
Uncomment the Write_enable=yes
Save Restart VSFTPD Service
3. Users can access the parent directory after they log in to FTP.
Modify the/etc/vsftpd.conf file to remove comments from the following options to prevent users from accessing the parent directory Chroot_local_user=yes Save Restart Service
4. Modify the default port to modify the/etc/vsftpd.conf file
Comment out #connect_from_port_20 =yes
Add listen_port= the port you want
Save Restart Service
Remember to start the firewall with the port
UBUNTU16 FTP Service VSFTP configuration