Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use TFTP in Linux system

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to use TFTP in the Linux system". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use TFTP in the Linux system".

TFTP (Trivial File Transfer Protocol, simple File transfer Protocol), is a real based on UDP protocol.

The current protocol for simple file transfer between client and server is suitable for low-cost and uncomplex application fields.

Close. TFTP protocol is specially designed for small file transfer. It can only get files from the server or write text to the server.

You cannot list a catalogue or authenticate it.

1.1 build a server

Open the virtual machine Ubuntu terminal, enter the root user, and enter the "sudo apt-get install xinetd" command

Install xinetd, and the installation is complete as shown below. (if you report an error, check the spelling of the command: xinetd)

Next, type "sudo apt-get install tftp tftpd" to install tftp and tftpd, and the installation is completed as shown below.

Then set up the configuration file for TFTP and use the command "vi / etc/xinetd.d/tftp" to create the file, as shown in the following figure.

Write the following:

Service tftp

{

Socket_type = dgram

Protocol = udp

Wait = yes

User = root

Server = / usr/sbin/in.tftpd

Server_args =-s / var/tftpboot/

Disable = no

Per_source = 11

Cps = 100 2

Flags = IPv4

}

As shown in the following picture.

Note: as shown in the image above, this file must be strictly aligned according to the above format after pasting the contents.

Exit and save. The / var/tftpboot directory set by server_args is the directory of the tftp server, TFTP

The client gets the files on the server from this directory. Use the command "mkdir / var/tftpboot" to establish

The directory of the tftp server, and then set the access rights of / var/tftpboot to 777, as shown in the following figure.

Enter the "sudo / etc/init.d/xinetd restart" command to restart the xinetd service, as shown in the following figure.

The server is set up at this point, so let's test it.

2.1 Server testing

2.1.1 Native test

Local test: create a file test under / var/tftpboot, type hello world in it, and then save it

The file is shown below.

Start another terminal and enter tftp 127.0.0.1, as shown below.

Enter get test to get the test file, and then enter Q to exit tftp, as shown in the following figure.

As you can see from the figure above, a 13-byte test is obtained.

Then enter ls to check whether there is a test file in the current directory. By checking, it is found that there is already test in the current directory.

File, this is the test file in the / var/tftpboot directory. Then use the cat command to check

The content of test, as shown in the following figure.

Through the screenshot above, we can see that the content in the test file is hello world, and the / var/tftpboot directory

The test is the same, so the configuration and testing of the TFTP server side is complete.

2.1.2 implementation of TFTP file transfer on the development board

After the iMX6 development board enters the system, enter the "ifconfig" command to view the board ip, and then enter "ping"

192.168.3.183 "command to test the network between the board and the virtual machine Ubuntu, as shown in the following figure.

As can be seen from the figure above, the network between the development board and the virtual machine is connected. Here "192.168.3.183" ip is a virtual machine.

Ip for Ubuntu. If the ip of the development board ip and the virtual machine Ubuntu you can see with ifconfig are not on the same network segment, then

You can modify the ip by modifying the "/ etc/eth0-setting" file of the development board, as shown below.

After the modification, restart the development board. Check with ifconfig to see that the ip modification is valid.

Enter "tftp-g-l test-r test 192.168.3.183" in the serial port of the development board, and view it with the cat command, as shown in the following figure.

Thank you for your reading, the above is the content of "how to use TFTP in Linux system". After the study of this article, I believe you have a deeper understanding of how to use TFTP in Linux system, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report