Have a Question?
< All Topics
Print

How to Install TFTP on Debian 10

Tutorial on how to install TFTP on Debian 10

Install TFTPD-HPA (Trivial File Transfer Protocol Server)

Install tftpd-hpa and enable the tftp to start automatically during bootup

$ sudo apt install tftpd-hpa
$ sudo systemctl enable tftpd-hpa

Modify the tftpd-hpa configuration file

$ sudo nano /etc/default/tftpd-hpa
    # /etc/default/tftpd-hpa
    TFTP_USERNAME="tftp" 
    TFTP_DIRECTORY="/tftp" 
    TFTP_ADDRESS="192.168.1.230:69"
    TFTP_OPTIONS="--secure --create" 
  • TFTP_USERNAME – TFTP Server is running as tftp user
  • TFTP_DIRECTORY – Directory accessible via tftp
  • TFTP_OPTIONS
    • –secure option means change the TFTP directory to what is set on the TFTP_DIRECTORY variable when you connect to the TFTP server automatically.
    • -create option to allow create or upload new files to TFTP Server

Create /tftp and change the owner to tftp

$ sudo mkdir /tftp
$ sudo chown tftp:tftp /tftp

Allow inbound tftp (69/udp) in ufw firewall and restart tftp services

$ sudo ufw allow tftp
$ sudo systemctl restart tftpd-hpa

Install TFTP Client

Install TFTP Client on Debian 10

$ sudo apt install tftp

Create a dummy file in /tftp and download it using tftp client

# Create a dummy file 
$ sudo nano /tftp/tftp.txt

# Download tftp.txt via tftp
$ tftp 192.168.1.230
tftp> get tftp.txt
Received 22 bytes in 0.0 seconds

Create a dummy file in /home/kwyong and upload it using tftp client

# Create a dummy file 
$ sudo nano /home/kwyong/123.txt

# Upload the file to tftp server
$ tftp 192.168.1.230
tftp> put 123.txt

Table of Contents
Scroll to Top