Linux centos6.5 vsftpd configuration on the ftp page, centos6.5vsftpd

Source: Internet
Author: User

Linux centos6.5 vsftpd configuration on the ftp page, centos6.5vsftpd

Installation command
Yum install in centosVsftpD. "Complete!" appears !" The installation is complete. In Linux, the system is strictly case sensitive. For example, abc and ABC are completely different characters, so pay special attention to them.
Configure Vsftpd
Before using the vsftpd server, you need to configure the server by taking the following steps:
(1) generate a virtual user password library file.
(2) Configure to generate the authentication File For vsftpd.
(3) create a directory for virtual user access and set the corresponding access permissions.
(4) create a configuration file.
(5) restart the vsftpd server.
After installation, We need to configure it for normal use. Edit vsftpd configuration file vi/etc/vsftpd. conf
In the vi editor, the search mission is to slash "/", enter the content to be searched, and press enter to confirm. The following are the options to change
Add the # sign before "anonymous_enable = YES" in the configuration file to disable anonymous logon. Important! ESC, colon wq! Press enter.
Read the configuration that takes effect. Cat/etc/vsftpd. conf | grep ^ [^ #]
Local_enable = YES
Write_enable = YES
Local_umask = 022
Anon_upload_enable = YES
Anon_mkdir_write_enable = YES
Anon_umask = 022
Dirmessage_enable = YES
Xferlog_enable = YES
Connect_from_port_20 = YES
Xferlog_std_format = YES
Listen = YES
Pam_service_name = vsftpd
Userlist_enable = YES
Tcp_wrappers = YES
Start the vsftpd service. Service vsftpd start
Add automatic start upon startup, chkconfig vsftpd on
You can run chkconfig-list to check whether the startup item has been added.

Http://www.cnblogs.com/xiaobo-Linux/ QQ463431476 Wavelet
Set an FTP user account. After the setting is successful, you can log on to the FTP server using this account.
(1) set the FTP user's account, for example, the account is "ftpuser1", the directory is/home/ftpuser1, And the setting is not allowed to log on through ssh.
[Root @ VM_250_202_tlinux ~] # Useradd-d/home/ftpuser1-s/sbin/nologin ftpuser1
(2) set the account password, for example, "ftpuser1 ".
[Root @ VM_250_202_tlinux ~] # Passwd ftpuser1
Modify the pam Configuration of vsftpd so that you can connect to the ECS by using your own FTP user account and password.
(1) Modify pam.
[Root @ VM_250_202_tlinux ~] # Vim/etc/pam. d/vsftpd
Modify the content:
# % PAM-1.0
Auth required/lib64/security/pam_listfile.so item = user sense = deny file =/etc/ftpusers onerr = succeed
Auth required/lib64/security/pam_unix.so shadow nullok
Auth required/lib64/security/pam_shells.so
Account required/lib64/security/pam_unix.so
Session required/lib64/security/pam_unix.so
(2) check whether the modified file is correct.
[Root @ VM_250_202_tlinux ~] # Cat/etc/pam. d/vsftpd # % PAM-1.0
Auth required/lib64/security/pam_listfile.so item = user sense = deny file =/etc/ftpusers onerr = succeed
Auth required/lib64/security/pam_unix.so shadow nullok
Auth required/lib64/security/pam_shells.so
Account required/lib64/security/pam_unix.so
Session required/lib64/security/pam_unix.so
(3) restart the vsftpd service to make the modification take effect.
Service vsftpd restart
Shutting down vsftpd: [OK]
Starting vsftpd for vsftpd: [OK]
☆☆
Configure chroot in vsftpd Server
In the default settings of the vsftpd server, local users can switch to a directory other than the main directory for browsing and access, which is not safe for the server, because any user can view other users' private information at any time, the following describes how to use the chroot option to prevent this situation.
The options related to this function mainly include:
Chroot_local_user
Chroot_list_enable
Chroot_list_file
You can set the chroot using the following two methods to prevent the above insecure situations:
(1) set all local users to execute chroot. Set the value of chroot_local _ user in the/etc/vsftpd. con file to YES, that is, chroot_local_user = YES.
(2) set the specified user to execute the chroot command as follows:
Chroot_local_user = NO
Chroot_list_enable = YES
Chroot_list_file =/etc/vsftpd. chroot_list
After setting, only the user specified in the/etc/vsftpd. chroot_list file can execute the chroot command.
During the use of the FTP service, the service can work on non-standard ports (non-21 ports). However, to do this, the vsftpd server must run in an independent startup mode, the main configuration file/etc/vsftpd to be configured for vsftpd. conf, add the listen_port = 10003 or other port number options to the file, and then restart the vsftpd daemon:
# Service vsftpd restart
Download and install the connection software, such as FileZilla xftp.
The FTP channel of the ECS does not support automatic decompression and deletion of the tar package after the tar package is uploaded.

 

If vsftpd is installed by default, the following are the file location Conventions:/usr/sbin/vsftpd ---- main program of VSFTPD/etc/rc. d/init. d/vsftpd ---- start script/etc/vsftpd. conf ---- main configuration file/etc/pam. d/vsftpd ---- PAM Authentication file/etc/vsftpd. ftpusers ---- disable VSFTPD user list file/etc/vsftpd. user_list ---- disable or allow VSFTPD user list file/var/ftp ---- anonymous user home directory/var/ftp/pub ---- anonymous user download directory if you want to change the default download directory, modify/etc/vsftpd. conf, add the following three lines: local_root =/chroot_local_user = YES anon_root =/loc Al_root indicates the default directory anon_root when a local user logs on to ftp. It indicates the default directory on which an anonymous user logs on to ftp. Your chroot_list_file indicates the list of locked login users in the home directory, it takes effect only when chroot_list_enable = YES. In addition, as described in luo_rc, it is best not to set the default directory as/. We recommend that you use mount -- bind to mount the desired directory. If the following error occurs when vsftp is started: unrecognised variable in config file: local_root, check whether the configuration contains multiple spaces.

 

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.