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 the tftp command in Linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Xiaobian to share with you how to use the tftp command in Linux, I believe most people still do not know how to use it, so share this article for your reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!

The Linux common command tftp is used to transfer files between the local computer and the tftp server using the TFTP protocol.

tftp Transfer files between local and tftp servers using the TFTP protocol

TFTP is the simplest network protocol used to download remote files, and it is implemented in UDP protocol. The tftp development environment for embedded linux includes two aspects: tftp-server support for linux server and tftp-client support for embedded target systems. Because u-boot itself has built-in support for tftp-client, the embedded target system does not need to be configured. The following is a detailed description of the linux server-side tftp-server configuration.

syntax tftp(option)(parameter) option-c: specifies instructions to execute immediately after a successful connection to the tftp server; -m: specifies file transfer mode. It can be ASCII or Binary; -v: Display the detailed execution process of the instruction; -V: Display the instruction version information. Parameter host: specifies the ip address or host name of the tftp server tftp is connecting to.

Example 1: Install tftp server

You need to install xinetd, tftp and tftp-server

If you have internet access, install via yum:

yum install xinetd yum install tftp yum install tftp-server If you cannot access the Internet, you can install the rpm package provided directly:

rpm -ivh xinetd-2.3.14-18.fc9.i386.rpm rpm -ivh tftp-0.48-3.fc9.i386.rpm rpm -ivh tftp-server-0.48-3.fc9.i386.rpm2, configure tftp server

Modify the/etc/xinetd.d/tftp file to change disable=yes to disable= no. Mainly set the root directory of the TFTP server, open the service. The revised document reads as follows:

service tftp { socket_type =dgram protocol =udp wait =yes user =root server =/usr/sbin/in.tftpd server_args =-s /home/mike/tftpboot -c disable =no per_source =11 cps =100 2 flags =IPv4 } Description: Modify the entry server_args= -s-c, where you can change the root directory of your tftp-server, the parameter-s specifies chroot, and-c specifies that files can be created.

3. Start tftp server and close firewall

/etc/init.d/iptables stop The requested URL/etc/init.d/xinetd/was not found on this server.

4. Check whether the tftp service is enabled

netstat -a |grep tftp displays udp 0 *:tftp *:* indicating that the service has been started, indicating that tftp configuration is successful.

5. Use of tftp

Copy a file to the tftp server directory, and then start tftp software on the host for a simple test.

tftp 192.168.1.2 tftp>get tftp>put tftp>q6, tftp command usage is as follows

tftp your-ip-address Enter TFTP operation:

connect: Connect to a remote tftp server

mode: file transfer mode

put: upload file

Get: Download the file

QUIT: Exit

verbose: Display detailed processing information

tarce: show package path

status: Display current status information

binary: binary transmission mode

ascii: ascii transfer mode

rexmt: Sets the timeout for packet transmission

timeout: Set timeout for retransmission

help: help information

? : Help information

7. If the error "AVC Denial, click icon to view" always appears, and the file cannot be transferred, the following modifications need to be made.

Modify/etc/sysconfig/selinux, set SELINUX to disable, and use the command setenforce 0 to make the selinux configuration file take effect.

8. Usage of tftp command in Busybox

The command format is:

tftp [option] ... host [port] If you want to download or upload files, you must use these options.

-g for download file (get) -p for upload file (put) -l for local file name (local file) -r for remote file name (remote file) For example, to download embedexpert from remote host 192.168.1.2, enter the following command

tftp -g -r embedeexpert 192.168.1.2 The above is "How to use tftp command in Linux" All the contents of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

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

Development

Wechat

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

12
Report