When working in specialized networking environments—such as updating firmware on enterprise routers, pushing configuration files to VoIP phones, or managing PXE (Preboot Execution Environment) network boots—you will often encounter the Trivial File Transfer Protocol (TFTP). Unlike standard FTP or SCP, TFTP operates over UDP port 69, strips out all authentication mechanisms, and offers zero encryption. Because it is so lightweight, it is universally supported by embedded devices. To upload or download files to a TFTP server from a Linux machine, you use the tftp command.
How the tftp Command Works
The tftp utility provides an interactive, bare-bones command-line interface for communicating with a remote TFTP server. Because there is no authentication, you do not provide a username or password. You simply specify the IP address of the target server, establish the connection, and issue basic get or put commands.
Note: TFTP is entirely unencrypted. It should only ever be used on secure, isolated local area networks (LANs), never over the public internet.
Connecting and Downloading a File
To retrieve a file from a network device (such as pulling a backup configuration file from a Cisco switch), follow these steps:
- Open your Linux terminal.
- Start the interactive session by typing
tftpfollowed by the IP address of the remote device:tftp 192.168.1.50 - The prompt will change to
tftp>, indicating you are connected to the client interface. - TFTP supports two transfer modes:
netascii(for text) andoctet(for binary data like firmware images). It is generally safest to force binary mode to prevent file corruption. Type:tftp> mode binary - To download the file to your local machine, use the
getcommand followed by the filename exactly as it exists on the server:tftp> get router_config.bin - Once the transfer is complete, type
quitto exit the interface. The file will be saved in the directory where you originally executed thetftpcommand.
Uploading a File to the Server
If you need to push a new firmware image to a piece of hardware, the process is identical, but you will use the put command instead of get.
tftp 192.168.1.50
tftp> mode binary
tftp> put new_firmware_v2.bin
tftp> quit
Be aware that many TFTP servers are configured as read-only by default for security reasons. If your put command fails with an “Access violation” error, the administrator must modify the server daemon’s configuration to explicitly allow uploads.