Commands / Services and tunnels

Services and tunnels

tftp

Also trivial file transfer, UDP 69, config backup, in.tftpd

Copies a file to or from a TFTP server: no login, no listing, no encryption.

tftp-hpa's client: -c get downloads, -c put uploads, by file name only (there is no listing). The request goes to UDP port 69, the file in 512-byte blocks on other ports. Anyone who reaches the server can do the same, and every byte is readable on the wire. The server here is in.tftpd, serving one directory (-s), allowing new files only with -c.

tftp command usage

tftp SERVER -c get REMOTE [LOCAL]
tftp SERVER -c put LOCAL [REMOTE]

Options

-c get REMOTE LOCAL
download a file
-c put LOCAL REMOTE
upload a file
-v
say what was sent or received

tftp examples

tftp 10.0.9.10 -c put /etc/frr/frr.conf officeRouter.conf
Backs the router's saved config up to the TFTP server.
tftp 10.0.9.10 -c get officeRouter.conf /tmp/restore.conf
Fetches it back.

Pitfalls

  • File must have global write permissions or File not found on a put: the server only accepts new files with -c, and existing ones only if they are world-writable.

Run it on real machines

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Open this lab