How to Install tftp Server on Ubuntu 20.04
In this article, we are going to teach you How to Install TFTP Server on Ubuntu 20.04. TFTP is an absolutely essential communication device when exchanging data between two computer systems on a network. One of the simplest protocols developed specifically for this purpose is the Trivial File Transfer Protocol or TFTP, which has played an important role in the development of the Internet. To install and operate tftp server, you can visit the Linux VPS plans offered in NeuronVM.
What is TFTP?
TFTP is a Trivial File Transfer Protocol on a computer network and is a simplified version of the file transfer protocol or FTP that does not use the TCP protocol but uses UDP over IP port 69. It is a bit slower because the TFTP protocol does not support framing. As a result, if the latency in the network is high, its efficiency will decrease. This is why it is commonly using in local area networks.
TFTP is using where it is unnecessary to authenticate the user and view the directory. The original TFTP specification was released in June 1981 on RFC 783. The current standard was published in 1992 in RFC 1350. TFTP cannot list directories or permissions via chmod.
Setup TFTP Server on Ubuntu 20.04
Update the APT package repository cache by entering the following command:
sudo apt update
Then you can install the tftpd-hpa package:
sudo apt install tftpd-hpa
Check the status of tftpd-hpa service:
sudo systemctl status tftpd-hpa
How to Configure TFTP Server on Ubuntu 20.04
The default configuration tftpd-hpa file is /etc/default/tftpd-hpa.
First, you need to open your desired text editor and modify the configuration file:
sudo nano /etc/default/tftpd-hpa
Remember to restart the tftpd-hpa service.
Then the configuration file is opened for editing, which is the default configuration of the TFTP server.
TFTP_USERNAME is set to tftp to run the TFTP server as the user tftp.
TFTP_DIRECTORY is set to /var/lib/tftpboot so that you can access it via TFTP.
TFTP_ADDRESS is set to 69 which means TFTP will run on port 69.
TFTP_OPTIONS is set to –secure which sets the TFTP options. The –secure option is a security feature that means changing the TFTP directory to something set on the TFTP_DIRECTORY variable when automatically connecting to the TFTP server.
You should add the –create option to TFTP_OPTIONS to change TFTP_DIRECTORY to /tftp.
You can create or upload new files to the TFTP server by adding –create to TFTP_OPTIONS.
Now you should press Ctrl+X, type”y“, and Enter to save the changes.
In the next step, you need to create a new /tftp directory:
sudo mkdir /tftp
Then you should change the owner and group of the /tftp directory to tftp:
sudo chown tftp:tftp /tftp
Now you need to restart the tftpd-hpa:
sudo systemctl restart tftpd-hpa
Finally, you can check if the service is running:
sudo systemctl status tftpd-hpa
How to Test TFTP Server on Ubuntu 20.04
A TFTP client program is requiring to access the TFTP server. There are many TFTP client programs. Devices that use the TFTP server already have the client program installed on them.
First, you should install the tftp-hpa TFTP client:
sudo apt update
sudo apt install tftp-hpa
Now you should find the IP address of the TFTP server:
ip a
You can connect to the TFTP server from your other computer:
tftp 'IP-address'
Note: Remember to replace your IP address with the IP address in the command.
In this step, you need to enable verbose mode:
tftp> verbose
Next, you should upload a file from the current working directory:
tftp> put rancheros.iso
You can download the file rancheros.iso:
tftp> get rancheros.iso
Finally, you can exit out of the tftp shell:
tftp> quit
Conclusion
In this article, we have shown you how to install TFTP server on Ubuntu 20.04. TFTP is a simple and lightweight file transfer protocol that is useful for transferring small files in a network environment. By following the steps outlined in this guide, you can easily set up a TFTP server and start transferring files between devices on your network.
You might like it
Windows Tutorials
How to Install MinGW on Windows 10
Ubuntu Tutorials
Introduction and How to use Iftop on Ubuntu 20.04
Almalinux Tutorials
How To Install Mono On Almalinux