Build an FTP server in Linux for the two working groups to keep the files in use. Disables anonymity. The first group uses the FTP account: FTP1, working directory in:/VAR/FTP/FTP1; the second group uses FTP2, working directory in:/VAR/FTP/FTP2.
Two groups cannot access each other's files and need to restrict users from leaving their working directory.
"Implementation Steps"
1. Check the installation VSFTPD server
After entering the terminal as root (the other account enters the terminal can enter the root mode with the SU root password), enter the following command in the Terminal command window to verify: # Rpm–qa | grep vsftpd. If the results are displayed as "Vsftpd-1.1.3-8", the system already has the VSFTPD server installed. If there is no reply, the system is not installed.
The 2.rhel version of the system CD has a VSFTPD installation package, so the next step is to mount the system CD to/media for tuning.
3. The above shows that the system does not have a VSFTPD server installed, then use the rpm command to install.
That is, the command to install VSFTPD in the Terminal command window: #rpm-IVH vsftpd-1.1.3-8.i386.rpm.
(1) First Mount Optical drive, in the/mnt/cdrom/server directory there are RPM,RPM-IVH vsftpd*
4. Create a user
(1) Start the service first
(2) Creation of two users
Configuration of 5.VSFTPD
After installation, there will be three configuration files under the/etc/vsftpd/path.
Vsftpd.conf: Master configuration file
Ftpusers: Specifies which users do not have access to the FTP server, where the user includes some important users, including root.
User_list: Specifies whether the user can access the FTP server, through the configuration of the Userlist_deny in the vsftpd.conf file to determine whether the user in the configuration can access, Userlist_enable=yes, Userlist_deny =yes, userlist_file=/etc/vsftpd/user_list These three configurations allow users in a file to access FTP.
(1) View the default configuration of the Master profile:
(using: cat/etc/vsftpd/vsftpd.conf |grep-v ' ^# ';)
(2) Modify the configuration file:
Login to FTP will find that users can access other directories, and have the MPSP group permissions, this is not allowed, we need to control the user's access to their home directory. Here's how:
A. vi/etc/vsftpd/vsftpd.conf into the FTP profile directory and edit this file,
B. Find #chroot_list_enable=yes, delete the previous # number, indicating that the limit function is turned on;
Find Chroot_list_file:chroot_list_file=/etc/vsftpd/chroot_list, delete the previous # number, indicating the ability to turn on this restriction; Join Chroot_local_use=no
(Press I to start editing after entering the edit box)
C. After entering the configuration file, add the following three lines at the end:
①userlist_enable=yes
Userlist_deny=no
Userlist_file=/etc/vsftpd/vsftpd.user_list
D. prohibit anonymous user Login
(after editing, press ESC and use ": Wq" to save and exit)
E. Editing some files
① find vsftpd.chroot_list file in etc directory, enter Edit status
Join the user name you want to restrict, one user at a line, such as FTP2
(after editing, press ESC and use ": Wq" to save and exit)
② Enter the VSFTPD directory, locate vsftpd.user_list, type ftp11, meaning allow FTP11 to log on to the FTP server
(after editing, press ESC and use ": Wq" to save and exit)
On this machine, through the console, with FTP1 through the FTP access system, the user successfully logged in, and successfully restricted to their own home directory, unable to access other directories.
The method creates 2 users, FTP1, FTP2.
View FTP Status Sestatus-b | grep ftp:
Then enter:
To turn off the firewall:
The following steps are to ping each other on the host and virtual machines:
Final Result:
Build an FTP server in Linux