How to Set up an FTP server in Red Hat Linux 9

Source: Internet
Author: User
Tags best ftp

Nowadays, more and more people choose open-source Linux operating systems, which is not inferior to Windows performance and approachable price, which is the best reason for people to choose it, red Hat Linux 9 is one of the most widely used Linux operating systems. Red Hat Linux 9 uses its simple configuration and graphical interface to provide a wide range of Internet services. FTP is one of the services it provides. FTP plays an important role in many network applications. Most of the various software resources on the Internet are stored on FTP servers. Like most Internet services, FTP is also a client/server system. Next, I will give you a brief introduction of how to set up an FTP server under Red Hat Linux 9.

1. Install the vsftpd Server

Vsftpd is currently one of the best FTP server tools in Linux. Among them, vs is short for "Very Secure" (Very Secure). It can be seen that its biggest advantage is security. In addition, it also has the advantages of small size, customizable, and high efficiency.

If you choose to fully install Red Hat Linux 9.0, the system will install the vsftpd server by default. In the terminal command window, enter the following command for verification:

[Root @ ahpeng root] rpm-qagrep vsftpd

If the result shows as a vsftpd-1.1.3-8, it indicates that the vsftpd server is installed. If you do not select a vsftpd server when installing Red Hat Linux 9.0, you can click the "Main Menu> system Settings> add or delete application" menu in the graphic environment, in the "software package management" dialog box that appears, make sure that the "FTP server" option is selected, and then click the "Update" button. Follow the on-screen prompts to insert 3rd installation discs to start installation.

Alternatively, you can insert 3rd installation discs, locate the vsftpd-1.1.3-8.i386.rpm installation package under/RedHat/RPMS, and then run the following command in the terminal command window to start the installation process:

[Root @ ahpeng RPMS] rpm-ivh vsftpd-1.1.3-8.i386.rpm

2. Start/restart/stop the vsftpd service

From Red Hat Linux 9.0, vsftpd starts the vsftpd service in standalone mode by default by running the following command in the terminal command window:

[Root @ ahpeng root]/etc/rc. d/init. d/vsftpd start

Restart the vsftpd service:

[Root @ ahpeng root]/etc/rc. d/init. d/vsftpd restart

Disable the vsftpd service:

[Root @ ahpeng root]/etc/rc. d/init. d/vsftpd stop

After confirming that the vsftpd service has been started, we can enter "ftp FTPAddres" in the DOS command window of any Windows host (replace FTPAddres with the actual FTP Server IP address or domain name ), note that the username and password are all ftp (ftp is the ing of anonymous users to user accounts), as described below:

Microsoft Windows XP [version 5.1.2600]

(C) Copyright 1985-2001 Microsoft Corp.

F: Peter> ftp FTPAddress

Connected to FTPAddress

220 (vsFTPd 1.1.3) // vsftpd Response Request

User (FTPAddress :( none): ftp // enter the User account ftp

331 Please specify the password.

Password: // enter the ftp Password

230 Login successful. Have fun.

Ftp>

3. vsftpd Configuration

In Red Hat Linux 9.0, vsftpd has three configuration files:

Vsftpd. ftpusers: located in the/etc directory. It specifies which user accounts cannot access the FTP server, such as root.

Vsftpd. user_list: located in the/etc directory. The user account in this file cannot access the FTP server by default. Access is allowed only when the userlist_enable = NO option is enabled in the vsftpd. conf configuration file.

Vsftpd. conf: located in the/etc/vsftpd directory. It is a text file. We can use text editing tools such as Kate and Vi to modify it, to customize FTP server configurations, such as user logon control, user permission control, timeout settings, server function options, server performance options, and server response messages.

(1) 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. When the deny_email_enable function is enabled, the required path for saving the email blacklist is/etc/vsftpd. banned_emails by default ).

(2) user permission Control

Write_enable = YES. enable the global upload permission.

Local_umask = 022. The umask of the local user's uploaded file is set to 022 (the default value is 077. Generally, it can be changed to 022 ).

Anon_upload_enable = YES, which allows anonymous users to have the upload permission. Obviously, you must enable write_enable = YES to use this option. At the same time, we must create a directory that allows ftp users to read and write data (as mentioned earlier, ftp is mapped to user accounts by anonymous users ).
Configure the telnet service:

(1) Use the vi command to edit the/etc/hosts. deny file and open the telnet logon permission control.

# Vi/etc/hosts. deny

Add the "#" comment before the ALL: ALL row to cancel the row.

(2) Use the vi command to edit the/etc/hosts. allow file and open the root user logon permission control.

Add ALL: ALL

(3) run the vi command to edit the/etc/xinetd. d/telnet file and open telnet.

Use "#" to log out disable = yes, or change it to disble = no

(4) edit the/etc/pam. d/login file by running the command, and release the root user logon permission control.

# Vi/etc/pam. d/login

Add the "#" comment in front of the auth required/lib/security/pam_securetty.so line to cancel the line.

(5) Start the xinetd service

#/Etc/init. d/xinetd restart


Configure the ftp service:

(1) Use the vi command to edit the/etc/xinetd. d/tftp file and open telnet.

Use "#" to log out disable = yes, or change it to disble = no

(2) Start the ftp service

# Service xinetd restart

# Service iptables stop

# Service vsftp start

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.