Installing an FTP server in Ubuntu

Source: Internet
Author: User
Tags ftp access

1. Experimental environment

ubuntu14.04

2.VSFTPD Introduction

VSFTPD is the "very secure FTP daemon" abbreviation, is a Linux distribution in the most respected FTP server program, security is one of its biggest features.

Installation of 3.VSFTPD

3.1 Open Terminal (CTRL + ALT + T)

Input:

4. Configure VSFTPD

4.1 Modify the VSFTPD configuration file. This type of configuration file is usually located in the/etc directory

sudo gedit/etc/vsftpd.conf

Many of the instructions in the original file are commented, as long as the Enable section, the command is enabled (in the configuration file for each article is specified)

Listen=yes       # server snooping anonymous_enable=yes       # Anonymous Access allows Local_enable=yes    # Local Host access allow Write_enable=yes    # Write allow anon_upload_enable=yes# anonymous upload allow, default is no, too troublesome can open up. I'm not responsible for the problem. ~anon_mkdir_write_enable=yes  # Anonymous Create folder allow Dirmessage_enable=yes  # go to folder allow Xferlog_enable=yes   #  FTP logging allows Connect_from_port_20=yes     # to allow Port 20th to be used as a port for data transfer SECURE_CHROOT_DIR=/VAR/RUN/VSFTPD/EMPTYPAM_ Service_name=vsftpdrsa_cert_file=/etc/ssl/private/vsftpd.pem

Hold Back exit

4.2 Setting up FTP-related directories

After installation, an FTP directory will be added under/srv

At the same time, the system will add a user group named FTP, which can be viewed by the following code:

sudo cat    /etc/shadow

As follows:

In the/srv/ftp directory, we created two directories named upload and download, respectively, for uploading and downloading:

Cd/srv/ftp/sudo mkdir downloadsudo mkdir upload

Next we set permissions for several of the directories we just created

The command reference is as follows:

sudo chmod 755/srv/ftpsudo chmod 777/srv/ftp/uploadsudo chmod 755/srv/ftp/download

So, on the one hand we allow the user group FTP access/home/ftp (anonymous access), on the one hand to the user group FTP/srv/ftp/upload write rights, so users on the network can easily upload files, but note that when they upload, upload the Files have only root permissions on these files, that is, this directory can only be used for uploading, unable to download the files, in addition to the user group FTP to/home/ftp/download read rights, and we copy into the directory of the file for the user group usually have read rights, Therefore, users on the network can and can only download files from this directory. So as to meet our prior requirements.

4.3 Start ftp:

sudo service vsftpd start

View all current processes:

Ps-e

As follows

The most basic configuration of server-side vsftp has been completed, VSFTPD is turned on (Ubuntu does not have a firewall installed by default, if there is an installation, please temporarily shut down)

And by the way, the command to turn off ftp:

sudo service vsftpd stop

Process vsftpd View command:

Pgrep vsftpd

4.4 vsftpd Set up the user directory, if you set up anonymous users can also log in to upload words ~ This can save the ~

    • Add Group
sudo groupadd ftpgroup
    • Modify Vsftpd.conf
sudo gedit/etc/vsftpd.conf will be the bottom three lines #chroot_list_enable=yes# (default follows) #chroot_list_file =/etc/vsftpd/chroot_ List changed to chroot_list_enable=yes# (default follows) Chroot_list_file=/etc/vsftpd/chroot_list
    • Add user Ftpuser and set its directory to/home/nation/ftp/upload
sudo useradd-g ftpgroup-d/home/nation/ftp/upload-m ftpuser

(Note: G: The user's Group D: the location to create the user's own directory given m: Do not establish the default home directory, that is, there is no own directory under//)

    • Set User password
passwd Ftpuser
    • Edit Chroot_list File
sudo gedit/etc/vsftpd.chroot_list
    • Restart VSFTPD
sudo service vsftpd start

Original reference http://blog.csdn.net/nation_chen/article/details/7066277

Installing an FTP server in Ubuntu

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.