RHEL6.0FTP simple configuration

Source: Internet
Author: User
FTP installation and configuration of the system environment: RHEL6.0x86 _ 64 server: 192.168.0.4 #### as installation and testing are performed on the same Server, install the FTP server and client yuminstallvsftpdlftp-y #### vim/etc/vsftpd. conf .... chroot_local_user = YES & nb

FTP installation and configuration
System Environment: RHEL6.0 x86_64
Server: 192.168.0.4

#### Since installation and testing are performed on the same Server, you need to install the FTP Server and client
Yum install vsftpd lftp-y

####
Vim/etc/vsftpd. conf
....
Chroot_local_user = YES # this option only takes effect. Local Users can connect to the FTP server to switch to the root
Chroot_list_enable = YES # If you only comment out the preceding options, the user in chroot_list cannot be switched to the root after connecting to FTP.
Chroot_list_file =/etc/vsftpd/chroot_list # This file needs to be created. These three files take effect at the same time. They are only written in chroot_list to connect users to FTP and can be switched to the root.

#### Vsftpd virtual User Creation
Create a virtual user list and the corresponding password (this file is usually in/etc/vsftpd/or/root/or/home/), but no matter where
In the end, the *. db file will be generated through db_load-T-t hash-f users login. db and placed in/etc/vsftpd /.
Vim/etc/vsftpd/users
User1
Www.linuxidc.com
User2
Www.linuxidc.net

Db_load-T-t hash-f users login. db # generate the *. db file and place the database file in/etc/vsftpd/

Cd/etc/pam. d/
Vim virtual
Auth required pam_userdb.so db =/etc/vsftpd/login
Account required pam_userdb.so db =/etc/vsftpd/login

Vim/etc/vsftpd. conf
....
Pam_service_name = virtual # Change vsftpd here to virtual created in/etc/pam. d/
Userlist_enable = YES
Tcp_wrappers = YES
Guest_enable = YES
# Anon_max_rate = 1000 # maximum upload rate for anonymous users
# Local_max_reate = 1000 # maximum upload rate for Local Users
# Guest_enable = YES
# Max_per_ip = 1 # Number of connections simultaneously established at the same address
User_config_dir =/etc/vsftpd/userconf

Mkdir/var/ftp/user1
Mkdir/var/ftp/user2
Chown ftp/var/ftp/user *
Touch/var/ftp/user1/user1_home
Touch/var/ftp/user2/user2_home

Mkdir/etc/vsftpd/userconf
Vim/etc/vsftpd/userconf/user1
Local_root =/var/ftp/user1
Anon_other_write_enable = YES

Vim/etc/vsftpd/userconf/user2
Local_root =/var/ftp/user2

/Etc/init. d/vsftpd restart

#### Test
Lftp-u user1 localhost
Password: www.linuxidc.com
Lftp user1 @ localhost:-> ls
-Rw-r -- 1 0 0 0 OCT 17 20:19 user=home

Lftp-u user2 localhost
Password: www.linuxidc.net
Lftp user2 @ localhost:-> ls
-Rw-r -- 1 0 0 0 OCT 17 20:21 user2_home

Chroot changes the root directory

/Etc/vsftpd/ftpusers # prohibit FTP users from writing this file
User_list vsftpd # User-Defined blocking of access to a project. users who are not allowed to log on to FTP can be written to a file, combined with vsftpd. conf.
Userlist_deny = YES/NO in the configuration file
Listen = YES # Set yes to enable vsftpd in Stand alone mode
Listen_port = 21 # This setting value is only applicable to start in Stand alone mode and is invalid for super daemon mode.

For more information about RedHat, see RedHat topic page http://www.linuxidc.com/topicnews.aspx? Tid = 10

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.