Zettel 202109140245: Setting Up a TFTP Server for RHEL/CentOS7/8/Fedora

To set up a tftp server in RHEL/CentOS7/8/Fedora, do the following:

# dnf install tftp-server
Last metadata expiration check: 0:13:11 ago on Tue 14 Sep 2021 08:31:55 PM CDT.
Dependencies resolved.
======================================================================================================================================================================================================
 Package                                           Architecture                                 Version                                            Repository                                    Size
======================================================================================================================================================================================================
Installing:
 tftp-server                                       x86_64                                       5.2-32.fc34                                        fedora                                        40 k

Transaction Summary
======================================================================================================================================================================================================
Install  1 Package

Total download size: 40 k
Installed size: 64 k
Is this ok [y/N]: y
Downloading Packages:
tftp-server-5.2-32.fc34.x86_64.rpm                                                                                                                                     73 kB/s |  40 kB     00:00    
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                  26 kB/s |  40 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                              1/1 
  Installing       : tftp-server-5.2-32.fc34.x86_64                                                                                                                                               1/1 
  Running scriptlet: tftp-server-5.2-32.fc34.x86_64                                                                                                                                               1/1 
  Verifying        : tftp-server-5.2-32.fc34.x86_64                                                                                                                                               1/1 

Installed:
  tftp-server-5.2-32.fc34.x86_64                                                                                                                                                                      

Complete!

Next, start and enable the service:


# systemctl --now enable tftp.service
Created symlink /etc/systemd/system/sockets.target.wants/tftp.socket → /usr/lib/systemd/system/tftp.socket.
# systemctl status tftp.service
● tftp.service - Tftp Server
     Loaded: loaded (/usr/lib/systemd/system/tftp.service; indirect; vendor preset: disabled)
     Active: active (running) since Tue 2021-09-14 20:52:48 CDT; 8s ago
TriggeredBy: ● tftp.socket
       Docs: man:in.tftpd
   Main PID: 2893775 (in.tftpd)
      Tasks: 1 (limit: 4525)
     Memory: 188.0K
        CPU: 3ms
     CGroup: /system.slice/tftp.service
             └─2893775 /usr/sbin/in.tftpd -s /var/lib/tftpboot

Sep 14 20:52:48 localhost systemd[1]: Started Tftp Server.

I get stumped by the fact that you install tftp-server but you start tftp.service. I’d like some consistency with the naming, here. Oh well . . .

Notice your default home directory is /var/lib/tftpboot. Place the files that you want to serve with tftp in that directory.

If you’re running firewalld, you’ll need to allow the service:

# firewall-cmd --zone=public --add-service=tftp --permanent

success

All done. If you’re still having problems after these steps, check for the following:

  • Did you forget to install tftp on the client device?
  • Is a firewall running on the client device?
  • Is a network firewall or router preventing the server and client from talking over port 69 UDP?
  • Remember, TCPDUMP is your friend.

September 14, 2021 unlinked cli


Previous post
Zettel 202109141140 : Helpful mv Command Options The b flag creates a backup of the destination file. The mv command creates a backup in the destination directory. This protects against overwrites.
Next post
Here’s a formula about information. I was interested in this. I started reading and watching videos about Information Therory. I feel a zettel coming . . . H = n log s or H = log Where n is the number of symbols from the syntax or language we’re using. Where s is the number of different symbols