CentOS uses the yum command to install vsftp

Source: Internet
Author: User
1. install vsftp and use the yum command to install vsftp [root @ Cloud12347 ~] # Yuminstallvsftpd-y2, add ftp account and directory check nologin location first, usually under/usr/sbin/nologin or/sbin/nologin. Use the following command to create an account

1. install vsftp
Use the yum command to install vsftp

[root@Cloud12347 ~]# yum install vsftpd -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/nologin pwftp

Modify the account password:

[root@Cloud12347 ~]# passwd pwftp

 

Modify the permission of a specified directory

[root@Cloud12347 ~]# chown -R pwftp.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@Cloud12347 home]# 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 ~]# service vsftpd start

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-get install vsftpd -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/nologin pwftp

Modify the account password:

[root@Cloud12347 ~]# passwd pwftp

Modify the permission of a specified directory

[root@Cloud12347 ~]# chown -R pwftp.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@Cloud12347 home]# 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 ~]# service vsftpd start

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

Related Article

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.