tftp - bunnyamin/bunnix GitHub Wiki

TFTP (Trivial File Transfer Protocol)

Directory

The TFTP directory, for example /srv/tftp, is the root path for DHCPD.

  • Permission chmod -R 644 /srv/tftp, requires at least 644.
  • Ownership chown -R nobody:nobody /srv/tftp or change the user-group. For example:
    • --user x --group y ATFTP

Debug

Test Example
Does the TFTP server accept connections? $ nc -zv 192.168.0.101 69
Does the TFTP server accept upload? $ atftp 192.168.0.101, atftp> get test.txt
Can the TFTP client download from the server? $ atftp 192.168.0.101, atftp> get test.txt
Error Cause Remedy Comment
GRUB: File not found Change the permission for file to or above 644.
atftpd: failed to setgid to group 99 (nobody). If --user and, or --group is set then try removing them. Not confirmed exactly from when but at least from 0.7.2-1 the --user and, or --group seem to cause the error.
atftpd: <File> file not found. The file has no "read" permission

Netboot

  1. Enable logging to file. Recommended to disable when the TFTP server has been properly configured.
  2. Test (optional):
    • Verify connection to server nc -uvz 192.168.0.101 69. If the u (UDP) parameter is not assigned then nc assumes t (TCP), and the respons could be <HOST.LOCALDOMAIN> <IP> <PORT> (tftp) Connection refused because ATFTPD uses UDP.
    • Display all the sockets on the server (a) in numeric values (n) and if they are listining (l) or have a processes using them (p) ss -alnp.
    • Boot up the client computer, it attempts to download the bootloader, and it will fail. The attempt should be logged in assigned logfiler.
      • /var/atftpd.log
  3. Install and configure the bootlader.
    • Grub netboot
    • Ensure that the owner to the files are "nobody" chown -R nobody:nobody with rw permission to owner (6). execute and read (5) for other users chmod -R 655.
  4. Enable systemctl enable atftpd.
  5. Boot up the client computer, it attempts to download the bootloader, and it should succeed.
    • If error no DNS servers configured. then probably because the DCHP server is not set up, which is the next step; the error requires that the next-server <DNS IP>;.

ATFTP (Advanced Trivial File Transfer Protocol) [server]

A client/server implementation of the TFTP protocol that implements RFC: 1350, 2090, 2347, 2348, 2349.

Permanently initialize ATFTP on boot systemctl enable atftpd.

⚠️ **GitHub.com Fallback** ⚠️