FTP is the file Transfer Protocol protocol, which is a protocol designed to transfer files. Simply put, a server that supports the FTP protocol is an FTP server.
FTP supports two modes: PORT (Active), PASV (passive).
Port mode: First the FTP client and the server TCP 21 port to establish a connection, and then send the port command on this channel, the command contains the client with a port connection, the server receives the command will use the data port (20) to connect the client that port.
PASV mode: When an FTP connection is turned on, the client randomly opens two non-privileged ports A and B, where a port establishes a connection to the server's TCP 21 port, and the client sends the PASV command to the server on the command channel, and the server receives a random open non-privileged port p. The port command is then sent to the client, and the client receives a P port that is connected to the server using B port to transmit the data.
Install FTP
#rpm-qa vsftpd See if you have installed
Installing vsftpd-y #yum Install
#service vsftpd start Start service
#ftp 192.168.254.5 (IP address) login
Response code
1XX: Information
2XX: Success Class Code
3xx: Prompt to further manipulate class code
4XX: Client Error
5XX: Service-side error
How to sign In
Configuration file/etc/vsftpd/vsftpd.conf
Anonymous user settings:
Anonymous_enable=yes whether anonymous users are enabled
Anon_upload_enable=yes Upload
Anon_mkdir_write_enable=yes Creating a Directory
Anon_other_write_enable=yes Delete
Restrict system users from locking home directories:
Chroot_list_enable=yes Limit All
Chroot_list_enable=yes part of the limit
Chroot_list_file=/etc/vsftpd/chroot_list will need to restrict users from writing to this file
System users in the/etc/vsftpd/ftpusers file will be blocked from logging in
Number of connections limit:
max_clients=# FTP Server maximum number of access clients
max_per_ip=# maximum number of connections per IP
Transfer Rate Limit:
anno_max_rate=# Maximum transfer rate for anonymous users
Anonymous users:
User name: FTP; password is empty; login directory:/var/ftp.
System users:
User name: local user; password: user password; login directory: User home directory.
Pam_service_name=vsftpd
Virtual Login
Create a custom name file under/etc/vsftpd/, odd-numbered user names, even-numbered behavior passwords; All virtual user directories are a system home directory.
1. Create User Password text
Vim/etc/vsftpd/vftpuser
User1
Redhat1
User2
Redhat2
2. Generate the Virtual user authentication db file
Db_load-t-T Hash-f/etc/vsftpd/vftpuser/etcvsftpd/vftpuser.db
3. Edit the Pam file
Method One, vi/etc/pam.d/vsftpd content all commented out, add the following two sentences
Auth Required/lib (/security/pam_userdb.so) db=/etc/vsftpd/vftpuser
Account Required/lib (/security/pam_userdb.so db=/etc/vsftpd/vftpuser)
Method Two, create a new file under/etc/pam.d/Vsftpdauth, write the above two sentences, and then edit the configuration file vsftpd.conf.
Pam_service_name=vsftpdauth change to the file name you created
4, create a system user, all virtual users are mapped to this system user
useradd-d/home/vftp-s/sbin/nologin Virtual user name is virtual
chmod 700/home/vftp Set permissions
5, enable the virtual user in the configuration file, add the following parameters:
Guest_enable=yes
Guest_username=virtual
Restarting the FTP service
Install and build FTP server under Linux system