This article mainly describes how to install vsftp under CentOS and create a user's method, the need for friends can refer to the following
Rpm-qa | grep vsftpd See if VSFTP is installed
Run command start installation
Yum-y Install VSFTPD
CentOS will automatically download the installation.
After the installation is complete
Set up to run automatically every time you boot
Chkconfig vsftpd on
Manual start
Service VSFTPD Start
You can see if you are listening on port 21 through NETSTAT-TL.
Build new users
# useradd–d/var/www-g Ftp–s/sbin/nologin myftp
Description
-s/sbin/nologin is not allowed to log on to the system.
-D is the specified user directory for/var/www, which can be replaced with any directory you need.
-G FTP adds users to the FTP group (VSFTP created)
MYFTP is the FTP username, and when configured, replace this myftp with your FTP user name.
After you execute this command, if you receive this error message:
Useradd:warning:the home directory already exists.
Not copying any file from Skel directory into it.
This means that the user's directory already exists (/VAR/WWW, this can be any directory you set), you can no longer create this directory, not add a user failed to ignore.
Special reminder: Users established with Useradd, if the following does not add –s/sbin/nologin parameters, the establishment of users for the general system users, have the system landing CentOS server permissions, in a virtual host environment, this is very dangerous. Therefore, after the Useradd command with the parameter –s/sbin/nologin, for the CentOS server virtual host add can not login system FTP dedicated account (virtual account)
Set Password
# passwd Myftp
Tip: Repeat input 2 times
Modify the/var/www Directory properties: (or any directory of your own definition)
# Chown-r Myftp/var/www recursively sets the owner of all directories and files to the newly added FTP user
# Chmod-r 755/var/www recursively sets the full rights of the defenders, and only the other users have read and Execute permissions
This way, if the Web site runs with write access, it can be modified directly via the FTP username.
Configuration file/etc/vsftpd/vsftpd.conf
Setting up an account can only access its own directory, which is the directory that was set up when the user was built –d/var/www
Chroot_local_user=yes
Restart the VSFTPD service
# Service VSFTPD Restart