Implementation of FTP and DHCP services in Linux

Source: Internet
Author: User
Article title: Implementation of FTP and DHCP services in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Compared with windows, Linux is relatively secure, with fewer system vulnerabilities and fewer viruses targeting the system, making it difficult to launch external attacks. Therefore, it is ideal to use linux for various network services. This article only discusses ftp and dhcp services in detail.

System: Redflag linux 4.1

  FTP service implementation

First download the ftp service package vsftpd-1.1.3-8.i386.rpm to install it. The command is as follows:
[Root @ localhost lxjun] # rpm-ivh vsftpd-1.1.3-8.i386.rpm. After the installation is complete, the vsftpd. conf file is automatically generated in the/etc/vsftpd directory. When ntsysv is started, the vsftpd item is displayed in the service list. Select this option to restart the server.

The vsftpd. conf configuration file set by the author is as follows:
Anonymous_enable = YES
Local_enable = YES
Write_enable = YES
Local_umask = 022
Anon_upload_enable = no
Anon_mkdir_write_enable = no
Dirmessage_enable = YES
Xferlog_enable = YES
Connect_from_port_20 = YES
Xferlog_file =/var/log/vsftpd. log
Ascii_upload_enable = YES
Ascii_download_enable = YES
Pam_service_name = vsftpd
Userlist_enable = YES
Listen = YES
Tcp_wrappers = YES

FTP services

After configuration, you can implement the basic FTP service. The following are some questions.

Problem 1: files under/var/ftp/pub cannot be downloaded. The ftp client displays "files cannot be opened by the server !".
Solution: view the attributes of other files in the directory that can be downloaded. The value is 644, and the attribute of this file is 600. change the attribute of this file to 644. Run the following command:
[Root @ localhost pub] # chmod 644 vsftpd. conf
Or [root @ localhost pub] # chmod go + r vsftpd. conf
That is, all users have read permission on the file. Download again.

Question 2: How can I upload an anonymous user?
Most FTP servers do not allow anonymous users to upload files. this is understandable for the sake of server security. However, technically speaking, anonymity can enable the upload function. The description is as follows:
Add the following command line to the vsftpd. conf file:
Anon_upload_enable = yes
Anon_mkdir_write_enable = yes
Anon_world_readable_only = no
Anon_other_write_enable = yes
That is, the maximum permission is granted to anonymous users.

I. create an upload directory for anonymous users
[Root @ localhost ftp] # mkdir incoming
II. modify Upload directory permissions
[Root @ localhost ftp] # chmod o + w incoming
III. REBOOT server
Note: it is best for anonymous users to set a separate directory for uploads. do not upload files to the/var/ftp/pub directory, which will bring great convenience to file management. Do not grant the "o + w" permission to the/var/ftp/pub directory.

Question 3: Can I use another port instead of the default FTP port to provide services?

The default port number of the FTP service is 21. to reduce external attacks, you can provide an uncommon port number for the service. Port 10021 is used as an example. The method is as follows:
Add the following statement to/etc/vsftpd. conf:
Listen_port= 10021
In this way, the FTP service can be provided through port 10021 on the server.

Disable port 21
Run the following command to view the port number used by FTP:
[Root @ localhost vsftpd] # netstat-anp | grep 21
Tcp 0 0 0.0.0.0: 10021 0.0.0.0: * LISTEN 562/vsftpd
Tcp 0 0 0.0.0.0: 21 0.0.0.0: * LISTEN 549/xinetd
It can be seen that both port 10021 and port 21 are in the listening status and port 21 is disabled.
[Root @ localhost vsftpd] # kill-9 549 (PID)
In this way, the FTP client can only log on to port 10021. Some illegal users cannot forcibly log on through the guessing port. Enhances system security.

[1] [2] Next page

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.