Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fedora - How to set up a TFTP server on Fedora

#1
How to set up a TFTP server on Fedora

TFTP, or Trivial File Transfer Protocol, allows users to transfer files between systems using the UDP protocol. By default, it uses UDP port 69. The TFTP protocol is extensively used to support remote booting of diskless devices. So, setting up a TFTP server on your own local network can be an interesting way to do Fedora installations, or other diskless operations.

TFTP can only read and write files to or from a remote system. It doesn’t have the capability to list files or make any changes on the remote server. There are also no provisions for user authentication. Because of security implications and the lack of advanced features, TFTP is generally only used on a local area network (LAN).

TFTP server installation


The first thing you will need to do is install the TFTP client and server packages:

dnf install tftp-server tftp -y

This creates a tftp service and socket file for systemd under /usr/lib/systemd/system.

/usr/lib/systemd/system/tftp.service
/usr/lib/systemd/system/tftp.socket

Next, copy and rename these files to /etc/systemd/system:

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

Making local changes


You need to edit these files from the new location after you’ve copied and renamed them, to add some additional parameters. Here is what the tftp-server.service file initially looks like:

[Unit]
Description=Tftp Server
Requires=tftp.socket
Documentation=man:in.tftpd [Service]
ExecStart=/usr/sbin/in.tftpd -s /var/lib/tftpboot
StandardInput=socket [Install]
Also=tftp.socket

Make the following changes to the [Unit] section:

Requires=tftp-server.socket

Make the following changes to the ExecStart line:

ExecStart=/usr/sbin/in.tftpd -c -p -s /var/lib/tftpboot

Here are what the options mean:

  • The -c option allows new files to be created.
  • The -p option is used to have no additional permissions checks performed above the normal system-provided access controls.
  • The -s option is recommended for security as well as compatibility with some boot ROMs which cannot be easily made to include a directory name in its request.

The default upload/download location for transferring the files is /var/lib/tftpboot.

Next, make the following changes to the [Install] section:

[Install]
WantedBy=multi-user.target
Also=tftp-server.socket

Don’t forget to save your changes!

Here is the completed /etc/systemd/system/tftp-server.service file:

[Unit]
Description=Tftp Server
Requires=tftp-server.socket
Documentation=man:in.tftpd [Service]
ExecStart=/usr/sbin/in.tftpd -c -p -s /var/lib/tftpboot
StandardInput=socket [Install]
WantedBy=multi-user.target
Also=tftp-server.socket

Starting the TFTP server


Reload the systemd daemon:

systemctl daemon-reload

Now start and enable the server:

systemctl enable --now tftp-server

To change the permissions of the TFTP server to allow upload and download functionality, use this command. Note TFTP is an inherently insecure protocol, so this may not be advised on a network you share with other people.

chmod 777 /var/lib/tftpboot

Configure your firewall to allow TFTP traffic:

firewall-cmd --add-service=tftp --perm
firewall-cmd --reload

Client Configuration


Install the TFTP client:

yum install tftp -y

Run the tftp command to connect to the TFTP server. Here is an example that enables the verbose option:

[client@thinclient:~ ]$ tftp 192.168.1.164
tftp> verbose
Verbose mode on.
tftp> get server.logs
getting from 192.168.1.164:server.logs to server.logs [netascii]
Received 7 bytes in 0.0 seconds [inf bits/sec]
tftp> quit
[client@thinclient:~ ]$

Remember, TFTP does not have the ability to list file names. So you’ll need to know the file name before running the get command to download any files.


Photo by Laika Notebooks on Unsplash.



https://www.sickgaming.net/blog/2019/09/...on-fedora/
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Fedora - Fedora Silverblue, an introduction for developers xSicKxBot 0 18 05-21-2020, 04:56 AM
Last Post: xSicKxBot
  Fedora - Using Fedora to implement REST API in JavaScript: part 2 xSicKxBot 0 27 05-19-2020, 12:23 AM
Last Post: xSicKxBot
  Fedora - The pieces of Fedora Silverblue xSicKxBot 0 27 05-16-2020, 02:08 AM
Last Post: xSicKxBot
  Fedora - How to manage network services with firewall-cmd xSicKxBot 0 33 05-12-2020, 02:01 AM
Last Post: xSicKxBot
  Fedora - How to rebase to Fedora 32 on Silverblue xSicKxBot 0 41 05-09-2020, 03:58 AM
Last Post: xSicKxBot
  Fedora - Fedora Classroom Session: IRC 101 xSicKxBot 0 37 05-08-2020, 02:41 AM
Last Post: xSicKxBot
  Fedora - 4 cool new projects to try in COPR for May 2020 xSicKxBot 0 43 05-05-2020, 04:42 AM
Last Post: xSicKxBot
  Fedora - Using mergerfs to increase your virtual storage xSicKxBot 0 46 05-02-2020, 02:37 AM
Last Post: xSicKxBot
  Fedora - What’s new in Fedora 32 Workstation xSicKxBot 0 44 05-01-2020, 04:42 AM
Last Post: xSicKxBot
  Fedora - Fedora 32 is officially here! xSicKxBot 0 56 04-29-2020, 11:44 PM
Last Post: xSicKxBot

Forum Jump:

[-]
Upcoming Events

[-]
Discord

[-]
Latest Threads
[Tut] How to Add Elements to a List in P...
Last Post: xSicKxBot
Today 07:22 AM
» Replies: 0
» Views: 0
(Indie Deal) Bundles & Sales Round-up
Last Post: xSicKxBot
Today 07:22 AM
» Replies: 0
» Views: 0
Heroic Labs Nakama Sponsor Defold
Last Post: xSicKxBot
Today 05:16 AM
» Replies: 0
» Views: 2
Microsoft - What’s new in Microsoft Team...
Last Post: xSicKxBot
Today 05:15 AM
» Replies: 0
» Views: 2
News - Four Unannounced Nintendo Games P...
Last Post: xSicKxBot
Today 05:14 AM
» Replies: 0
» Views: 2
News - Steam Free-Play Games For This We...
Last Post: xSicKxBot
Today 05:14 AM
» Replies: 0
» Views: 2
News - BETA: BEDROCK 1.16.0.64 (XBOX ONE...
Last Post: xSicKxBot
Today 01:19 AM
» Replies: 0
» Views: 2
Xbox Wire - Xbox Insiders are invited to...
Last Post: xSicKxBot
Today 01:19 AM
» Replies: 0
» Views: 2
News - Welcome to the Summer of Indie Ga...
Last Post: xSicKxBot
Today 01:18 AM
» Replies: 0
» Views: 3
News - Get a job: Join Moon Studios as a...
Last Post: xSicKxBot
Today 01:18 AM
» Replies: 0
» Views: 3

[-]
Twitter

[-]
Sponsored
Get the Deal of the Week at RefurBees.com

Copyright © SickGaming.net 2012-2019