CentOS installation vsftp to build new users

Source: Internet
Author: User
Tags centos centos server

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.