Install vsftp in Ubuntu

Source: Internet
Author: User

1. Check whether the system has FTP service

PS-E | grep vsftpd

 

2. Mount vsftpd

Apt-Get install vsftpd

 

After the installation is complete, vsftpd is automatically enabled and an FTP user is created for the system.

 

3. Restart

/Etc/init. d/VsftpdRestart

 

4. default directory

By default, vsftp automatically enables anonymous accounts. You can view the directory columns corresponding to the FTP account in the/etc/passwd directory by default.

For example, here is

FTP: X: 114: 121: ftp daemon,:/srv/ftp:/bin/false
The default directory is/srv/FTP.

 

5. Configure vsftp

A. whether to allow anonymity (yes by default)

Anonymous_enable = Yes

B. whether to allow a local account to log on. (if it is commented out by default, it is not allowed)

# Local_enable = Yes

C. If a local user is enabled, set the FTP directory of the local user to its root directory.

# Chroot_local_user = Yes

D. If you want to reset an FTP directory for some local users (the file vsftpd. chroot_list has not been carefully studied)

# Chroot_local_user = Yes
# Chroot_list_enable = Yes
# (Default follows)
# Chroot_list_file =/etc/vsftpd. chroot_list

 

6. Add a user. If the local account is not enabled, add the user.

Add User net. Specify the user directory as/var/www/net, and the user cannot log on to the system.
# Mkdir/var/www/Net
# Useradd-S/sbin/nologin-D/var/www/Net
Note that-S/sbin/nologin makes it unable to log on to the system.-D specifies the user directory as/var/www/net.
# Passwd net
# Chown-r net: net/var/www/Net

Note: Set all and groups of User Directories and Their subdirectories to net.

 

7. Modify the listening port

/Etc/vsftpd. conf add listen_port = xxx

 

8. Modify the data port

Pasv_min_port = 50000
Pasvanderbilt max_port = 55000
Save and exit.
The meaning of these two statements tells vsftpd that the port range for data transmission is between 50000 and 55000.

 

 

OK.

 

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.