Ali Server Linux System FTP Server Setup Tutorial _ftp server

Source: Internet
Author: User

First, Redhat/centos installation vsftp software

1. Update Yum Source

First need to update the system's Yum source, convenient tool download address: http://www.jb51.net/article/54840.htm (shell script)

2. Install Vsftp

Install vsftp using the Yum command

Copy Code code as follows:

#yum Install Vsftpd-y

3. Add FTP Account and directory

Check the position of the nologin first, usually under/usr/sbin/nologin or/sbin/nologin.
Use the following command to create an account that specifies the home directory of/alidata/www/wwwroot as the user pwftp you can define your own account name and directory:

Copy Code code as follows:

#useradd-D/alidata/www/wwwroot-s/sbin/nologin pwftp

Modify the account password:
Copy Code code as follows:

#passwd pwftp

Modify permissions for the specified directory
Copy Code code as follows:

#chown-R Pwftp.pwftp/alidata/www/wwwroot

4. Configure Vsftp

Edit the Vsftp configuration file with the following command:

Copy Code code as follows:

#vi/etc/vsftpd/vsftpd.conf

Change "Anonymous_enable=yes" to "Anonymous_enable=no" in the configuration file
Remove the annotation symbol before the following configuration:
Copy Code code as follows:

Local_enable=yes
Write_enable=yes
Chroot_local_user=yes

Save changes, press ESC, enter: WQ

5. Modify Shell Configuration

VI Edit/etc/shells, if there is no/usr/sbin/nologin or/sbin/nologin in the file (see the current system configuration) append it

6. Start vsftp Service and test login

To start the VSFTP service with a command:

Copy Code code as follows:

#service vsftpd Start

Then use the Account PWFTP test whether can log on FTP. The directory is/alidata/www/wwwroot.

Second, Ubuntu/debian installation vsftp software

1. Update the SOFTWARE source

First need to update the system's software source, convenient tool download address: http://www.jb51.net/article/54840.htm (shell script)

2. Install Vsftp

Install vsftp using the Apt-get command

Copy Code code as follows:

#apt-get Install Vsftpd-y

3. Add FTP Account and directory

Check the position of the nologin first, usually under/usr/sbin/nologin or/sbin/nologin.
Use the following command to create an account that specifies the home directory of/alidata/www/wwwroot as the user pwftp you can define your own account name and directory:

Copy Code code as follows:

#useradd-D/alidata/www/wwwroot-s/sbin/nologin pwftp

Modify the account password:
Copy Code code as follows:

#passwd pwftp

Modify permissions for the specified directory
Copy Code code as follows:

#chown-R Pwftp.pwftp/alidata/www/wwwroot

4. Configure Vsftp

Edit the Vsftp configuration file with the following command:

Copy Code code as follows:

#vi/etc/vsftpd.conf

Change "Anonymous_enable=yes" to "Anonymous_enable=no" in the configuration file
Remove the annotation symbol before the following configuration:
Copy Code code as follows:

Local_enable=yes
Write_enable=yes
Chroot_local_user=yes
Chroot_list_enable=yes
Chroot_list_file=/etc/vsftpd.chroot_list

Save exit
Edit/etc/vsftpd.chroot_list file, add FTP account name, save exit

5. Modify Shell Configuration
VI Edit/etc/shells, if there is no/usr/sbin/nologin or/sbin/nologin in the file (see the current system configuration) append it

6. Restart VSFTP service and test login

To start the VSFTP service with a command:

Copy Code code as follows:

#service vsftpd Restart

Then use the Account PWFTP test whether can log on FTP. The directory is/alidata/www/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.