A practical and simple way to configure the tftp server in Linux

Source: Internet
Author: User

In the network protocol, we should be familiar with the TFTP protocol. Today, we will focus on the configuration of the tftp server. TFTP (Trivial File Transfer Protocol simple File Transfer Protocol) is a Protocol used in the TCP/IP Protocol family for simple File Transfer between the client and the server, provides File Transfer services that are not complex and costly. TFTP is carried on UDP and provides unreliable data stream transmission services. It does not provide access authorization and authentication mechanisms, and uses the timeout retransmission method to ensure data arrival. Compared with FTP, TFTP is much smaller, and TFTP is the simplest network protocol used to download remote files. It is implemented based on UDP protocol. It uses UDP port 69.

Configure the tftp Server 1. Check whether the system has installed the tftp service.

[Root @ wk ~] # Rpm-qa | grep tftp tftp-0.42-3.1.el5.centos tftp-server-0.42-3.1.el5.centos if not installed can mount CentOS5.2 disc Installation

[Root @ wk ~] # Mount-t auto/dev/cdrom/mnt/cdrom mount: block device/dev/cdrom is write-protected mounting read-only [root @ wk ~] # Cd/mnt/cdrom/CentOS [root @ wk CentOS] # rpm-ivh tftp-0.42-3.1.el5.centos.i386.rpm [root @ wk CentOS] # rpm-ivh tftp-server-0.42-3.1.el5.centos.i386.rpm configure tftp Server 2. Modify the startup configuration file

By default, the TFTP service is disabled, so you need to modify the file to enable the Service.

Modify the/etc/xinetd. d/tftp file. It mainly sets the root directory of the TFTP server and enables the service.

The modified configuration file is as follows:

Service tftp {disable = yes Change yes here to no socket_type = dgram protocol = udp wait = yes user = root server =/usr/sbin/in. tftpd server_args =-s/tftpboot-c per_source = 11 cps = 100 2 flags = IPv4} specify/tftpboot as the root directory of the tftp server.

The-s parameter specifies the chroot and-c specifies the file to be created.

Configure the tftp server 3. Create the tftp root directory, disable the firewall, and start the tftp-server

[Root @ wk ~] # Mkdir/tftpboot [root @ wk ~] # Chmod-R 777/tftpboot [root @ wk ~] #/Etc/init. d/iptables stop [root @ wk ~] # Service xinetd restart the xinetd service. Because the TFTP service is controlled by the xinetd service, xinetd is a service that manages services and does not open ports.

Check whether port 69 is enabled for TFTP:

[Root @ wk ~] # Netstat-nlp udp 0 0 0.0.0.0: 67 0.0.0.0: * 5172/dnsmasq udp 0 0 0.0.0.0: 67 0.0.0.0: * 4745/dhcpd udp 0 0 0.0.0.0: 69 0.0.0.0: * 6171/xinetd udp 0 0 0.0.0.0: 994 0.0.0.0: * 4633/rpc. rquotad configure tftp Server 4. Test tftp Server

[Root @ wk ~] # Tftp 192.168.0.110 tftp> get tftp> put tftp> q

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.