Configure the VSftp server in Linux in eight steps

Source: Internet
Author: User

In Linux, configure the VSftp server. Step 1. Check whether vsftpd, rpm-qa | grep vsftp is installed.

Step 2. Create a user

Useradd test-g root-d/mpeg-s/sbin/nologin # This user is only used to support the FTP service, so he does not have to log on to the system

Note: Change the user's shell command to usermod-s/sbin/nologin coship.

Step 3. Set the password for VSftp server in Linux

Passwd test # enter the password twice in a row

Step 4. Modify SELinux Parameters

Setsebool ftpd_disable_trans 1

Service vsftpd restart

Note: If this parameter is not modified, a prompt is displayed during connection.

500 OOPS: cannot change directory:/mpeg

500 OOPS: child died

Step 5. Modify/mpeg permissions for VSftp server configuration in Linux

Chmod 775/mpegr

Step 6. Configure the VSftp server in Linux and set/etc/vsftpd. conf

Set anonymous_enable = NO to restrict anonymous user logon.

Local_enable = YES # enable local user logon

Write_enable = YES # Set the write operation.

Local_umask = 022 # Set the permission mask for uploaded files

Userlist_enable = YES # Enable User Logon Control

Local_root =/mpeg path custom) # define the root directory of all local users. When a local user logs in, it is replaced with this directory. Comment to access the user's own directory)

Otherwise, the system prompts 550 Failed to change directory when accessing other directories.

Chroot_local_user = NO

Chroot_list_enable = YES

Chroot_list_file =/etc/vsftpd/chroot_list # indicates the list files of users locked in their own directories. The file format is one user per row.

Note:

When chroot_local_user = NO and chroot_list_enable = YES, users in chroot_list are locked, that is, they cannot access other directories except their own directories.

When chroot_local_user = YES and chroot_list_enable = YES, users in chroot_list are non-locked and can access any other directories.

Step 7. Configure VSftp server in Linux and set vsftpd to start automatically

Chkconfig vsftpd on or

Run ntsysv to select vsftpd or

Echo "/usr/local/sbin/vsftpd &">/etc/rc. local

Step 8: configure the VSftp server in Linux. Disable the firewall and SELinux if the server cannot be accessed.

1. service iptables stop

2. edit/etc/selinux/config and set SELINUX to disabled, that is, SELINUX = disabled.

Or run system-config-securitylevel-tui in the terminal.

Or click "system"-> "administration"-> "security level and firewall to set the firewall and SELinux.

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.