How to install vsftd (ftp) server on centos

Source: Internet
Author: User
Tags ftp ssh centos ssh access

Overview:

Vsftpd is a well-known FTP server in Linux. Of course, it is preferred to build an FTP server. This article describes how to install vsftpd in CentOS 6.4 and configure a virtual user to log on to FTP.

Install vsftpd

Check whether vsftpd has been installed

Rpm-qa | grep vsftpd
If not, install and set the startup

Yum-y install vsftpd
Chkconfig vsftpd on
Modify configuration file

Vim/etc/vsftpd. conf
Anonymous_enable = NO // set that anonymous access is not allowed
Local_enable = YES // set that the local user can access. Note: if a virtual host user is used, all virtual users cannot access the project if the project is set to NO.
Chroot_list_enable = YES // prevents the user from leaving the main directory
Ascii_upload_enable = YES
Ascii_download_enable = YES // sets the support for uploading and downloading in ASCII mode.
Pam_service_name = vsftpd // PAM authentication file name. PAM will be authenticated according to/etc/pam. d/vsftpd

Add an ftp user

Add the ftpuser user and set the root directory to/home/wwwroot/ftpuser. Disable the user from logging on to SSH and restrict access to other directories.

Open the vsftpd configuration file.

# Chroot_list_enable = YES
# (Default follows)
# Chroot_list_file =/etc/vsftpd. chroot_list
Change

Chroot_list_enable = YES
# (Default follows)
Chroot_list_file =/etc/vsftpd/chroot_list
Add the user ftpuser to the/home/wwwroot/ftpuser directory to prohibit SSH access.

Useradd-d/home/wwwroot/ftpuser-g ftp-s/sbin/nologin ftpuser
Set user password

Passwd ftpuser
Edit the chroot_list file

Vi/etc/vsftpd/chroot_list
`
The content is the ftp user name, and each user occupies one line, for example:
Peter
John

Restart vsftpd

Service vsftpd restart
Error 1, 500 OOPS: cannot change directory
Solution:

Enter the following command on the terminal:

Setsebool-P ftpd_disable_trans 1
Service vsftpd restart
Cause: selinux is enabled on the server, which limits FTP logon.

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.