Installation and configuration of tftp

Source: Internet
Author: User
Article Title: installation and configuration of tftp. 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.

1. Install

To install xinetd, tftp server & client

Run the following command:

$ Sudo apt-get install xinetd tftpd-hpa tftp-hpa

2. Set

A. xinetd will create the directory/etc/xinetd. d/. Next, you need to create

A new tftpd document and edit its content:

$ Sudo vim/etc/xinetd. d/tftpd

Change the document content:

Service tftp

{

Disable = no

Socket_type = dgram

Wait = no

User = root

Protocol = udp

Server =/usr/sbin/in. tftpd

Server_args =-s/tftpboot

Log_on_success = PID HOST DURATION

Log_on_failure = HOST

}

B. Create a tftp root path and set its permissions to 777. This path must be followed by/etc/xinetd. d/tftpd

In this document, the server_args row settings are consistent. In this example, the path is/tftpboot:

$ Sudo mkdir/tftpboot

$ Sudo chmod 777/tftpboot

C. Modify the/etc/inetd. conf file.

$ Sudo vim/etc/inetd. conf

Add the following line:

Tftp dgram udp wait root/usr/sbin/in. tftpd/usr/sbin/in. tftpd-s/var/lib/tftpboot

To:

Tftp dgram udp wait root/usr/sbin/in. tftpd/usr/sbin/in. tftpd-s/tftpboot

D. Modify/etc/default/tftpd-hpa

$ Sudo vim/etc/default/tftpd-hpa

Modify the document content:

# Defaults for tftpd-hpa

RUN_DAEMON = "yes"

OPTIONS = "-l-s/tftpboot"

3. Start

Restart the service

$ Sudo/etc/init. d/xinetd restart

$ Sudo/etc/init. d/tftpd-hpa restart

4. Test

You can perform a small test to check whether the tftp server is running properly:

In this test, the/tftpboot directory contains the document for testing (you can replace it with any document): uImage

First, record the IP address of the tftp server, for example, 192.168.5.192 (your IP address of the tftp server should be different from this,

You can use "ifconfig" on the server for viewing ).

Next, use the tftp protocol to log on to the tftp server (you can perform a test on the computer where the server is running or on another

Test on a computer running xinetd & tftp client ):

$ Tftp 192.168.5.192

After the operation is successful, a tftp prompt will appear:

Tftp>

Download the test document uImage through tftp:

Tftp> get uImage

If everything goes well, the downloaded uImage will appear in the current directory.

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.