Vsftpd installation and configuration experience

Source: Internet
Author: User
Tags ftp file

    • Prerequisites

1. Operating System: Red Hat guest iselinux server 6.4

2. vsftpd-2.2.2-11.el6.x86_64.rpm

    • Install/uninstall

1. rpm-IVH vsftpd-2.2.2-11.el6.x86_64.rpm -- force # force option ensures successful installation

2. rpm-e vsftpd-2.2.2-11.el6.x86_64 # uninstall vsftpd

3. Other uninstall Methods: Find/-name vsftpd, and then RM retrieves the file

    • Configuration, VI/etc/vsftpd. conf

1. Create an FTP user

    • Useradd FTP

    • Usermod-S/sbin/nologin FTP # Only FTP is allowed

    • CD/etc/vsftpd

    • VI ftpusers

    • Add a new user FTP at the end of the file # make the user FTP accessible

2. Change port 21 to 678.

    • Add listen_port = 678 to the configuration file.

    • VI/etc/services, change FTP 21/tcp to FTP 678/tcp, and change ftp21-udp to FTP 678/udp

3. Set other options in vsftpd

    • Anonymous_enable = Yes

    • Local_enable = Yes

    • Write_enable = Yes

    • Local_umask = 022

    • Anon_upload_enable = Yes

    • Anon_mkdir_write_enable = Yes

    • Dirmessage_enable = Yes

    • Xferlog_enable = Yes

    • Connect_from_port_20 = Yes

    • Chown_uploads = Yes

    • Chown_username = FTP

    • Xferlog_file =/var/log/xferlog

    • Xferlog_std_format = Yes

    • Chroot_local_user = Yes

    • Listen = Yes

    • Pam_service_name = vsftpd

    • Userlist_enable = Yes

    • Tcp_wrappers = Yes

    • Listen_port= 834

4. Configure the FTP File Upload path

    • VI/etc/passwd

    • FTP: X: 14: 50: ftpuser:/home/ftp:/sbin/nologin # Home/FTP is the path of the uploaded file

    • The access permission for the upload file is changed to 755, but not 777;

    • Create an upload subdirectory under the uploaded file and grant permissions to it.

Chown ftp: Root. chmod755 ftp: Root.

5. Upload permission settings (unable to upload, caused by SELinux (Security-enhancedlinux)

Setsebool-P ftpd_disable_trans 1

Setsebool ftp_use_passive_mode 1

Setsebool ftpd_use_passive_mode 1

Setsebool httpd_enable_ftp_server 1

Setsebool tftp_anon_write 1

Setsebool allow_ftpd_anon_write 1

Setsebool allow_ftpd_use_cifs 1

Setsebool ftpd_connect_db 1

Setsebool allow_ftpd_use_nfs 1

6. If the problem persists, disable the firewall)

    • Start/stop/restart

1. Service vsftpd start # Start the vsftpd service

2. Service vsftpd stop # Stop the vsftpd service

3. Service vsftpd restart # restart the vsftpd service

    • Related Test commands

1. test whether the service is started and whether the port is listening? Netstat-ntpl | grep vsftpd

2. getsebool-A | grep FTP # view the setting status

3. Service iptables status # view the Firewall Status

4. FTP

5. Open xxx

6. Put xxx


OK!



This article is from the blog of "Yi Zi AK's blog", please be sure to keep this source http://lifudong.blog.51cto.com/2357095/1562291

Vsftpd installation and configuration experience

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.