Fedora

How to Install and Configure the TFTP Server on Fedora Linux

A TFTP (Trivial File Transfer Protocol) server plays an important tool for network administrators and developers. It works as an easy-to-use alternative to FTP because a TFTP server does not require any authentication. A TFTP server allows a simple data transfer between the devices over a network. TFTP servers use the port 69 for the incoming requests from a TFP client.Configuring a TFTP server helps you to empower the users to efficiently manage the network devices, perform the firmware updates, and streamline the various technical processes.

However, installing and configuring the TFTP server is not easy as it requires the correct knowledge. In this tutorial, we will explain the best possible method to install and configure the TFTP server on Fedora Linux.

How to Install and Configure the TFTP Server on Fedora Linux

Let’s begin the process by installing the TFTP server utility through the following command:

sudo dnf install tftp-server

After the successful installation, start the TFTP service and configure it to start automatically at boot:

sudo systemctl start tftp

Once you start the TFTP service, it is time to enable it in the system. You can also check the running status of the TFTP service:

sudo systemctl enable tftp

sudo systemctl status tftp

Configure the TFTP Server

By default, TFTP uses the UDP port 69. You can run the following command:

sudo firewall-cmd --permanent --add-service=tftp

sudo firewall-cmd --reload

You can now modify the TFTP configuration file by opening it in the Nano editor:

sudo nano /etc/sysconfig/tftp

Here, add the following information and save the file to make the changes successful:

service tftp

{

socket_type = dgram

protocol = udp

wait = yes

user = root

server = /usr/sbin/in.tftpd

server_args = -c -s /<your_file>

disable = no

per_source = 11

cps = 100 2

flags = IPv4

}

Ensure that you modify the server_args line to indicate the directory from which you want TFTP to serve the files. For example, let’s create the “/tftpboot” directory:

sudo mkdir /tftpboot

Grant the TFTP server with the necessary permissions to write to the designated directory:

sudo chown -R nobody:nobody /tftpboot

Finally, apply the changes by restarting the TFTP service:

sudo systemctl restart tftp

TFTP Server Configuration (Alternative Method)

You can use this alternative method if the previous method does not work. First, run the following command to copy the system files of the TFTP server:

sudo cp /usr/lib/systemd/system/tftp.service /etc/systemd/system/tftp-server.service

sudo cp /usr/lib/systemd/system/tftp.socket /etc/systemd/system/tftp-server.socket

Now, run the following command to open the TFTP service config file:

sudo nano /etc/systemd/system/tftp-server.service

In this config file, change the ExectStart line with the TFTP destination file that you want to use for the server:

Once you are done, it is time to reload the TFTP server:

sudo systemctl daemon-reload

sudo systemctl enable --now tftp

Conclusion

This is all about the complete method to install and configure the TFTP server on Fedora Linux. A TFTP server lets you to quickly enhance your network management capabilities, efficiently perform the firmware updates, and streamline the file transfers. With the simplicity and efficiency of TFTP, Fedora Linux users can readily tackle a range of technical challenges.

About the author

Prateek Jangid

A passionate Linux user for personal and professional reasons, always exploring what is new in the world of Linux and sharing with my readers.