FTP Server Installation and Configuration
1. switch to root: SU root
2. Check whether the system is installed vsftpd, you can execute the command: RPM -qa | grep vsftpd
3. If no vsftpd installed, the installation: yum -Y the install vsftpd
4. Create ftp users, such ftp_test. Command: useradd -s / sbin / nologin -d / Home / ftp_test ftp_test
5. Set ftp_test user password. Command: passwd ftp_test enter the password twice to confirm it set up a password after performing.
6. vim / etc / vsftpd / user_list , the last line to add a user name you just added: ftp_test
7. Change the configuration files vim /etc/vsftpd/vsftpd.conf reads as follows:
local_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES xferlog_std_format=YES idle_session_timeout=600 data_connection_timeout=120 ascii_upload_enable=YES ascii_download_enable=YES ftpd_banner=Welcome to lightnear FTP service. chroot_local_user=YES ls_recurse_enable=YES listen=YES pam_service_name=vsftpd userlist_enable=YES userlist_deny=NO local_root=/home/ftp_test tcp_wrappers=YES use_localtime=YES allow_writeable_chroot=YES
8. Change directory permissions ftp the chmod -R & lt 777 / Home / ftp_test
8. Start vsftp service command: systemctl Start vsftpd.service
9. Check the ftp service status, commands: systemctl Status vsftpd.service
FTP client installation
FTP server configuration documentation:
anonymous_enable = NO to cancel the anonymous FTP login, the default is YES, modified to NO, it represents not allow anonymous user login.
userlist_enable=YES
= NO userlist_deny userlist_deny = / NO in the list of people do not refuse, reject others (including anonymous)
= local_root / Home / ftp_test local_root defined local user = root. When the local user login, will be replaced this directory.
chroot_local_users = YES local user to lock the main heads.
allow_writeable_chroot = YES from after 2.3.5, vsftpd enhanced security checks, if a user is defined in the main directory, the home directory of the user no longer has permission to write a! If the inspection found that there are write permission, it will report the error.
To fix this error, you can use the command chmod aw / home / user to remove write permissions to the user's home directory, pay attention to replace the directory into your own.
If you want a user can access the root directory, the user name added to / etc / vsftpd / chroot_list create this file does not exist, a line a user name.
note:
1. Try not to choose a directory under the root directory, here is the / home / ftp_test, and ftp_test Do not manually create this directory, otherwise there will be problems permission, when executing the command automatically creates
2. Note the directory permissions, if necessary, should set the appropriate permissions.
3. If the connection is not likely to be blocked by a firewall, and try to turn off the firewall
systemctl stop firewalld.service # Stop firewall
systemctl disable firewalld.service # prohibit firewall startup
firewall -cmd --state # view the default firewall status (turn off the display after notrunning, display running after opening)
If this remote folder can not be displayed, please use active mode connections, set up on your ftp tool.
3. This article ftp server environment CentOS7.2, ftp client environment for MacOS.
Reference documents:
Set up an FTP server under Linux environment to configure a local user's personal configuration