CentOS uses the yum command to install vsftp

Source: Internet
Author: User

CentOS uses the yum command to install vsftp

1. Install vsftp
Use the yum command to install vsftp

[root@Cloud12347~]#yuminstallvsftpd-y

2. Add an ftp account and Directory
First check the location of nologin, usually under/usr/sbin/nologin or/sbin/nologin.
Use the following command to create an account. The command specifies/home/wwwroot as the root directory of user pwftp. You can define the account name and directory by yourself:

[root@Cloud12347~]#useradd-d/home/wwwroot-s/sbin/nologinpwftp

Modify the account password:

[root@Cloud12347~]#passwdpwftp

Modify the permission of a specified directory

[root@Cloud12347~]#chown-Rpwftp.pwftp/home/wwwroot

3. Configure vsftp
To edit the vsftp configuration file, run the following command:

[root@Cloud12347~]#vi/etc/vsftpd/vsftpd.conf

Change "anonymous_enable = YES" in the configuration file to "anonymous_enable = NO"
Cancel the annotator before the following Configuration:

local_enable=YES write_enable=YES chroot_local_user=YES

Save the modification, Press ESC, and enter: wq

If the configuration file does not contain "chroot_local_user = YES", enter the following command and press Enter.

[root@Cloud12347home]#echo'chroot_local_user=YES'>>/etc/vsftpd/vsftpd.conf

4. Modify shell configurations
Vi edit/etc/shells. If the file does not contain/usr/sbin/nologin or/sbin/nologin (depending on the current system configuration), append it
5. Start vsftp and test Logon
Run the following command to start the vsftp service:

[root@Cloud12347~]#servicevsftpdstart

Then, use the account pwftp to test whether ftp can be logged on. The directory is/home/wwwroot.

Ii. Install vsftp in Ubuntu/Debian

1. Install vsftp
Use the apt-get command to install vsftp

[root@Cloud12347~]#apt-getinstallvsftpd-y

2. Add an ftp account and Directory
First check the location of nologin, usually under/usr/sbin/nologin or/sbin/nologin.
Use the following command to create an account. The command specifies/home/wwwroot as the root directory of user pwftp. You can define the account name and directory by yourself:

[root@Cloud12347~]#useradd-d/home/wwwroot-s/sbin/nologinpwftp

Modify the account password:

[root@Cloud12347~]#passwdpwftp

Modify the permission of a specified directory

[root@Cloud12347~]#chown-Rpwftp.pwftp/home/wwwroot

3. Configure vsftp
To edit the vsftp configuration file, run the following command:

[root@Cloud12347~]#vi/etc/vsftpd/vsftpd.conf

Change "anonymous_enable = YES" in the configuration file to "anonymous_enable = NO"
Cancel the annotator before the following Configuration:

local_enable=YES write_enable=YES chroot_local_user=YES chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list

Save the modification, Press ESC, and enter: wq

If the configuration file does not contain "chroot_local_user = YES", enter the following command and press Enter.

[root@Cloud12347home]#echo'chroot_local_user=YES'>>/etc/vsftpd/vsftpd.conf
Edit the/etc/vsftpd. chroot_list file, add the ftp account name, save and exit.

4. Modify shell configurations
Vi edit/etc/shells. If the file does not contain/usr/sbin/nologin or/sbin/nologin (depending on the current system configuration), append it
5. Start vsftp and test Logon
Run the following command to start the vsftp service:

[root@Cloud12347~]#servicevsftpdstart

Then, use the account pwftp to test whether ftp can be logged on. The directory is/home/wwwroot.

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.