Aliyun Centos/debian Install the FTP software and set

Source: Internet
Author: User
Tags aliyun

First, Redhat/centos installation vsftp software

1. Update Yum Source

First need to update the system Yum source, convenient tool download address: http://help.aliyun.com/manual?spm=0.0.0.0.zJ3dBU&helpId=1692
2. Install Vsftp
Install vsftp using the Yum command
#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:
#useradd-D/alidata/www/wwwroot-s/sbin/nologin pwftp
Modify the account password:
#passwd pwftp
Modify permissions for the specified directory
#chown-R Pwftp.pwftp/alidata/www/wwwroot
4. Configure Vsftp
Edit the Vsftp configuration file with the following command:
#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:
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:
#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://help.aliyun.com/manual?spm=0.0.0.0.zJ3dBU&helpId=1692
2. Install Vsftp
Install vsftp using the Apt-get command
#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:
#useradd-D/alidata/www/wwwroot-s/sbin/nologin pwftp
Modify the account password:
#passwd pwftp
Modify permissions for the specified directory
#chown-R Pwftp.pwftp/alidata/www/wwwroot
4. Configure Vsftp
Edit the Vsftp configuration file with the following command:
#vi/etc/vsftpd.conf
Change "Anonymous_enable=yes" to "Anonymous_enable=no" in the configuration file
Remove the annotation symbol 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 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:
#service vsftpd Restart
Then use the Account PWFTP test whether can log on FTP. The directory is/alidata/www/wwwroot.


installed, let's say Linux user management , Linux User management The most important two files is/etc/passwd and/etc/shadow, the former is to save account related, the latter is to save the password.
    unscramble The passwd file, one line for a user, each field separated by a colon ":" such as:
    root:x:0:0:root:/root:/bin/ Bash
    These 7 fields represent:
1. Account name: That is, the user name when landing
2. Password: Because this file is all users can read, so late into X and the real password changed into/etc/shadow
3. UID: User id,uid Unique, usually uid=0 representing root admin
4. GID: Group ID, related to/etc/group,/etc/group is similar to/etc/passwd, which is used to standardize user group information
5. User Information Description Bar: The role of note accounts
6. Home directory: House directory, That is, user login to jump to the root directory, such as root user/root is its home directory after the first home "~"
7. Shell: The shell that the user uses, usually use/bin/bash this shell
    said the principle of user management, the next FTP configuration, can be much clearer.

VSFTP Operation Process:
1. Add FTP Account and directory
First check the position of the nologin, usually under/usr/sbin/nologin or/sbin/nologin, the system under/sbin/nologin.
To create an account command:
#useradd-D/alidata/www/juhuibu-s/sbin/nologin Ftpuser
(This command specifies the home directory of/alidata/www/juhuibu as the user Ftpuser, and can define the account name and directory yourself)
Modify the account password:
#passwd Ftpuser
(Enter two times password after return)
To modify permissions for the specified directory:
#chown-R Ftpuser.ftpuser/alidata/www/juhuibu
(The specified directory's recursive permissions are all for that user)

2. Configure Vsftp
Edit the Vsftp configuration file with the following command:
#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:
Local_enable=yes
Write_enable=yes
Chroot_local_user=yes
Save changes, press ESC, enter: WQ

3. 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

4. Restart the VSFTP service and test the login
Restart the VSFTP service using the command: #service vsftpd restart

Finally in the Linux vsftp end configuration even if completed, account Ftpuser can log on FTP. The top-level directory to log in is/alidata/www/juhuibu

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.