Install vsftp in centos

Source: Internet
Author: User
Install vsftp1 in centos: install vsftp and run chkconfig -- list to check whether the vsftpd service is installed. run the yum command to directly install: yum-yinstallvsftpd and then create a log file for it: touch/var/log/vsftpd. log2: Enable and configure auto-enable... install vsftp 1 in centos: install vsftp and run chkconfig -- list to check whether the vsftpd service is installed. run the yum command to directly install: yum-y install vsftpd and then create a log file for it: touch/var/log/vsftpd. log2: start and configure automatic startup use chkconfig -- list to view the vsftpd service startup items. if you see the following results: vsftpd 0: off 1: off 2: off 3: off 4: off 5: off 6: off all services are off. Note that off indicates Whether the service will be automatically started when the server is started. We use the following command to configure its auto-start: chkconfig -- level 2345 vsftpd on #2345 corresponds to the above 0-6 items. view and manage the ftp service: start the ftp service: service vsftpd start to view the ftp service status: service vsftpd status restart ftp service: service vsftpd restart disable ftp service: service vsftpd stop3. configure vsftp service edit/etc/vsftpd. conf file to configure the vsftp service: # vi/etc/vsftpd. conf 3.1 edit and modify the following items: anonymous_enable = NO # set not to allow anonymous access to local_enable = YES # set that the local user can access. Note: if a virtual host user is used, all virtual users cannot access the project if the project is set to NO. Chroot_list_enable = YES # the user cannot leave the main directory xferlog_file =/var/log/vsftpd. log # set the path for saving vsftpd service logs. Note: This file does not exist by default. You must manually touch ascii_upload_enable = YES # Allow uploading in ASCII mode ascii_download_enable = YES # set to support the upload and download functions in ASCII mode. Pam_service_name = vsftpd # PAM authentication file name. PAM will perform authentication based on/etc/pam. d/vsftpd. The following are important CentOS FTP service configuration items for Vsftpd virtual user support. By default, vsftpd. conf does not contain these Configuration Items. you must manually add the RHEL/CentOS FTP service configuration. Guest_enable = YES # enable the virtual user function. Guest_username = ftp # specifies the host user of the virtual user. -In RHEL/CentOS, the built-in ftp user user_config_dir =/etc/vsftpd/vuser_conf # sets the path for storing the RHEL/CentOS FTP service file of the virtual user's personal vsftp. CentOS FTP service file (configuration file name = virtual user name) that stores Virtual User personality 3.2 Create a chroot list and add ftp users to it: touch/etc/vsftpd/chroot_list echo ftp>/etc/vsftpd/chroot_list 3.3 for authentication: first, install the Berkeley DB Tool, many people cannot find db_load. The problem is that this package is not installed. Yum install db4 db4-utils then, create the user password text/etc/vsftpd/vuser_passwd.txt, note that the odd line is the user name, even the password test1pwd1 followed ,. generate the database file db_load-T-t hash-f/etc/vsftpd/vuser_passwd.txt/etc/vsftpd/vuser_passwd.db for virtual user authentication, and then edit the authentication file/etc/pam. d/vsftpd, comment out all the original statements and add the following two statements auth required pam_userdb.so db =/etc/vsftpd/vuser_passwd account required pam_userdb.so db =/etc/vsftpd/vuser_passwd, create a virtual user profile RHEL/CentOS FTP service file mkdir/etc/vsftpd/vus Er_conf/vi/etc/vsftpd/vuser_conf/test1 contains the following content: local_root =/opt/var/ftp # root directory of the virtual user (based on actual modification) write_enable = YES # writable anon_umask = 022 # mask anon_world_readable_only = NO anon_upload_enable = YES anon_mkdir_write_enable = YES anon_other_write_enable = YES 4. attach permissions to the directory and restart the vsftp service: mkdir/opt/var/ftpchmod 777/opt/var/ftp ********. If this parameter is not set, the error 530 may be reported. the root directory uploaded by the test1 user is the file service vsftpd restart5. FAQ: 5.1 553 cocould not cr The eate file is generally a SELinux problem. set the value of SELinux and restart the server. Setsebool-P ftpd_disable_trans 1 service vsftpd restart may also be the red text above. The setting is incorrect. 5.2 500 OOPS: bad bool value in config file: write_enable note: ensure that there is no space at the end of each line in your CentOS FTP service file. Generally, the error is caused by extra spaces. 5.3 after a virtual user uploads a file, the default permission is 600. the user cannot download the file and add or modify the value of anon_umask in the configuration file. For example, anon_umask = 022 or 000. in this way, you can use an ftp client to connect to windows. 1. when virtual_use_local_privs is set to virtual_use_local_privs = YES, the virtual user has the same permissions as the local user. when virtual_use_local_privs = NO, the virtual user and anonymous user have the same permissions. the default value is NO. When virtual_use_local_privs = YES and write_enable = YES, the virtual user has the write permission (upload, download, delete, and rename ). When virtual_use_local_privs = NO, write_enable = YES, anon_world_readable_only = YES, anon_upload_enable = YES, the virtual user cannot browse the directory, but can only upload files without other permissions. When virtual_use_local_privs = NO, write_enable = YES, anon_world_readable_only = NO, and anon_upload_enable = NO, the virtual user can only download files without other permissions. When virtual_use_local_privs = NO, write_enable = YES, anon_world_readable_only = NO, and anon_upload_enable = YES, virtual users can only upload and download files without other permissions. When virtual_use_local_privs = NO, write_enable = YES, anon_world_readable_only = NO, and anon_mkdir_write_enable = YES, the virtual user can only download files and create folders without other permissions. When virtual_use_local_privs = NO, write_enable = YES, anon_world_readable_only = NO, and anon_other_write_enable = YES, virtual users can only download, delete, and rename files without other permissions.
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.