Using VSFTPD to erect ftp in Linux

Source: Internet
Author: User

Installation Environment: centos-release-7-2.1511.el7.centos.2.10.x86_64
Installation path: Install via Yum online

Install VSFTPD:
[email protected] ~]# Yum Isntall vsftpd-y

Enable and shutdown of the service:
Start: Systemctl start Vsftpd.service
Close: Systemctl Stop Vsftpd.service
Restart: systemctl Restart Vsftpd.service
View status: Systemctl status Vsftpd.service

To view ports:
[Email protected] ~]# Netstat-nltp|grep 21
TCP6 0 0::: +:::* LISTEN 2504/vsftpd

Configuration file Description:
The configuration directory for VSFTPD is/ETC/VSFTPD and contains the following configuration files:
Vsftpd.conf as the primary configuration file
Ftpusers Configuring a list of users who are forbidden to access the FTP server
User_list Configuring user Access Control

Modify Permissions: vi/etc/vsftpd/vsftpd.conf
[Email protected] ~]# Cat/etc/vsftpd/vsftpd.conf|grep-ev "^#|^$"
#禁用匿名用户
Anonymous_enable=yes
#禁用本地账户
Local_enable=yes
#编辑权限
Write_enable=yes
local_umask=022
Dirmessage_enable=yes
Xferlog_enable=yes
Connect_from_port_20=yes
Xferlog_std_format=yes
#禁止切换根目录
Chroot_local_user=yes
#监听
Listen=no
Listen_ipv6=yes
Pam_service_name=vsftpd
Userlist_enable=yes
Tcp_wrappers=yes

After you have edited the configuration file, you need to restart the VSFTPD service: systemctl restart Vsftpd.service

Create an FTP user
Useradd ftpadmin
echo "Ftpadmin" |passwd ftpadmin--stdin

Restrict the user from FTP access only
Usermod-s/sbin/nologin Ftpadmin

Assign the user to the user ftpadmin to the main directory, and agree/data/ftp main directory
1. Create the/data/ftp/pub directory Mkdie-p/data/ftp/pub

2. Write Welcome file/data/ftp/welcome.txt

3.echo "Welcome to use FTP service." >/data/ftp/welcome.txt

Set access rights chmod a-w means not writable (All-write)
chmod a-w/data/ftp/&& chmod 777-r/data/ftp/pub

Set User home Directory
Usermod-d/datda/ftp/ftpadmin

Restarting the server
sudo systemctl restart Vsftpd.service

Finally, enter the FTP://IP address on the browser to

Using VSFTPD to erect ftp in Linux

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.