Enable the ftp service in centos, and enable the ftp service in centos

Source: Internet
Author: User
Tags ftp connection ftp login

Enable the ftp service in centos, and enable the ftp service in centos

If you need to install the ftp service to access linux through ftp, vsftpd is a better FTP server in Linux.

1. Check and install vsftp

1 // check whether vsftpd 2 rpm-qa is installed | grep vsftpd3 // if not, install vsftpd4 yum-y install vsftpd5 chkconfig vsftpd on

Ii. Edit vsftp configuration items

Configure to enable the virtual account (only ftp login, not system login) and set the Access Directory

1 vim/etc/vsftpd. conf 2 anonymous_enable = NO // set not to allow anonymous access 3 local_enable = YES // set local users to access. 4 chroot_list_enable = YES // the user cannot leave the home directory 5 ascii_upload_enable = YES 6 ascii_download_enable = YES // set the file name that supports ASCII mode upload and download 7 pam_service_name = vsftpd // PAM Authentication. PAM will be based on/etc/pam. d/vsftpd for authentication 8 9 // manually add 10 guest_enable = YES // set to enable the virtual User Function 11 12 user_config_dir =/etc/vsftpd/vuser_conf // set the virtual user's personal vsftp centOS FTP service file storage path 13 // perform authentication 14 chroot_list_file =/etc/vsftpd/vuser_passwd.txt15 16 local_root = // set access directory not configured default is/var/ftp

3. Install the Berkeley DB tool (for file databases, we use files to store the account and password of virtual users)

yum install db4 db4-utils

4. Create the User Password text/etc/vsftpd/vuser_passwd.txt. The odd line is the user name, and the even line is the password

1 vim /etc/vsftpd/vuser_passwd.txt
2 test3 123456

5. Generate the database file of the virtual user account and password and associate it with the data db File

1 db_load -T -t hash -f /etc/vsftpd/vuser_passwd.txt /etc/vsftpd/vuser_passwd.db

Edit the authentication file/etc/pam. d/vsftpd,All commentsDrop the original statement and add the following two more statements:

1 auth required pam_userdb.so db=/etc/vsftpd/vuser_passwd2 account required pam_userdb.so db=/etc/vsftpd/vuser_passwd

 

6. Restart the vsftpd service

1 service vsftpd restart

Finally, create an ftp connection to the ftp server

  

 

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.