1. Introduction to FTP servers
You must be familiar with the introduction of ftp. I will take the introduction on Baidu encyclopedia and discuss the concept with you.
FTP is short for File Transfer Protocol (File Transfer Protocol ". It is used for controlling two-way transmission of files over the Internet. It is also an Application ). There are different FTP applications based on different operating systems, and all these applications comply with the same protocol to transfer files. During FTP usage, users often encounter two concepts: "Download" and "Upload ). "Download" means to copy files from the remote host to your computer. "Upload" means to copy files from your computer to the remote host. In Internet language, users can upload (download) files to (from) remote hosts through client programs.
2. Set up an FTP server in LINUX
Generally, the default ftp software included in various linux releases is vsftp. From the recognition of vsftp in each linux release, we can see that vsftp should be a good ftp software.
(1) check whether the vsftpd software is installed
Run the following command to check whether the vsftpd software is installed: rpm-qa | grep vsftpd. For example, the result displayed in my centos 5.6 is as follows:
If no installation is available, you can download and install the software or use the software source. I will not go into details here.
(2) Use of vsftpd Software
The vsftpd software mainly includes the following commands:
Start ftp: service vsftpd start
Stop ftp: service vsftpd stop
Restart ftp: service vsftpd restart
Or use a command with a path:
(3) vsftpd Configuration
There are three ftp configuration files, which are located in the/etc/vsftpd/directory in centos5.6:
Ftpusers: specifies that users cannot access the ftp server.
User_list indicates that the default account cannot access ftp by default.
Main configuration file of vsftpd. conf vsftpd
(4) use vi to edit the vsftpd. conf file.
User Logon control:
Anonymous_enable = YES, allows anonymous users to log on.
No_anon_password = YES. You do not need to enter a password when logging on as an anonymous user.
Local_enable = YES, allow local users to log on.
Deny_email_enable = YES, you can create a file to save the blacklist of some anonymous emails to prevent these people from using Dos attacks.
Banned_email_file =/etc/vsftpd/banned_emails to save the email blacklist directory (default)
User permission control:
Write_enable = YES, enable global upload
Local_umask = 022. The umask for local file upload is set to 022, which is the default value.
Anon_upload_enable = YES, which allows anonymous users to upload data. Of course, when write_enable = YES. You must also create a directory that allows ftp users to read and write data.
Anon_mkdir_write_enable = YES, allowing anonymous users to create directories with flowers
Chown_uploads = YES. The file owner uploaded by an anonymous user is converted to another user. It is generally recommended to be root.
Chown_username = whoever. Change whoever to the owner to be converted. We recommend that you use root
Chroot_list_enable = YES. A list is used to specify which users can only be active in their own directories.
Chroot_list_enable =/etc/vsftpd/chroot_list, specifying the user list file
Nopriv_user = ft1_cure: Specifies a security account, allowing ftp to be completely isolated and unprivileged.
Other configurations are not recommended.
User connection and timeout settings:
Idle_session_timeout = 600, default timeout
Data_connection_timeout = 120, set the default data connection timeout time
(4) server logs and welcome information
Dirmessage_enable = YES, which allows displaying information for the configuration directory
Ftpd_banner = Welcome to blah FTP service. ftp Welcome information
Xferlog_enable = YES Enable Logging
Xferlog_file =/var/log/xferlog location of the log file
You can change the preceding settings and restart the ftp service to Configure ftp.
This article comes from "cloud computing, IT is no longer important ." Blog
PaddingU
? H :?? (? (Ding-bottom: 15px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "> 1. FTP server Overview
You must be familiar with the introduction of ftp. I will take the introduction on Baidu encyclopedia and discuss the concept with you.
FTP is short for File Transfer Protocol (File Transfer Protocol ". It is used for controlling two-way transmission of files over the Internet. It is also an Application ). There are different FTP applications based on different operating systems, and all these applications comply with the same protocol to transfer files. During FTP usage, users often encounter two concepts: "Download" and "Upload ). "Download" means to copy files from the remote host to your computer. "Upload" means to copy files from your computer to the remote host. In Internet language, users can upload (download) files to (from) remote hosts through client programs.
2. Set up an FTP server in LINUX
Generally, the default ftp software included in various linux releases is vsftp. From the recognition of vsftp in each linux release, we can see that vsftp should be a good ftp software.
(1) check whether the vsftpd software is installed
Run the following command to check whether the vsftpd software is installed: rpm-qa | grep vsftpd. For example, the result displayed in my centos 5.6 is as follows:
If no installation is available, you can download and install the software or use the software source. I will not go into details here.
(2) Use of vsftpd Software
The vsftpd software mainly includes the following commands:
Start ftp: service vsftpd start
Stop ftp: service vsftpd stop
Restart ftp: service vsftpd restart
Or use a command with a path:
(3) vsftpd Configuration
There are three ftp configuration files, which are located in the/etc/vsftpd/directory in centos5.6:
Ftpusers: specifies that users cannot access the ftp server.
User_list indicates that the default account cannot access ftp by default.
Main configuration file of vsftpd. conf vsftpd
(4) use vi to edit the vsftpd. conf file.
User Logon control:
Anonymous_enable = YES, allows anonymous users to log on.
No_anon_password = YES. You do not need to enter a password when logging on as an anonymous user.
Local_enable = YES, allow local users to log on.
Deny_email_enable = YES, you can create a file to save the blacklist of some anonymous emails to prevent these people from using Dos attacks.
Banned_email_file =/etc/vsftpd/banned_emails to save the email blacklist directory (default)
User permission control:
Write_enable = YES, enable global upload
Local_umask = 022. The umask for local file upload is set to 022, which is the default value.
Anon_upload_enable = YES, which allows anonymous users to upload data. Of course, when write_enable = YES. You must also create a directory that allows ftp users to read and write data.
Anon_mkdir_write_enable = YES, allowing anonymous users to create directories with flowers
Chown_uploads = YES. The file owner uploaded by an anonymous user is converted to another user. It is generally recommended to be root.
Chown_username = whoever. Change whoever to the owner to be converted. We recommend that you use root
Chroot_list_enable = YES. A list is used to specify which users can only be active in their own directories.
Chroot_list_enable =/etc/vsftpd/chroot_list, specifying the user list file
Nopriv_user = ft1_cure: Specifies a security account, allowing ftp to be completely isolated and unprivileged.
Other configurations are not recommended.
User connection and timeout settings:
Idle_session_timeout = 600, default timeout
Data_connection_timeout = 120, set the default data connection timeout time
(4) server logs and welcome information
Dirmessage_enable = YES, which allows displaying information for the configuration directory
Ftpd_banner = Welcome to blah FTP service. ftp Welcome information
Xferlog_enable = YES Enable Logging
Xferlog_file =/var/log/xferlog location of the log file
You can change the preceding settings and restart the ftp service to Configure ftp.
This article comes from "cloud computing, IT is no longer important ." Blog