LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-12-2021, 10:39 AM   #1
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Question Various tftp errors using get and put commands


Using RHEL7 for tftp client, not able to put and get a basic text file via tftp. The tftp server is RHEL8 (we have self-support, so don't have the option to open a case).

I've disable SELinux and Firewalld on both server and client.

When using the get command, I'm able to download the text file, but its empty.

When I use the put command for a text file, I get a "client timed out" error.

I tail /var/log/messages and don't see anything odd.

systemd shows both a service and socket are active for tftp

Code:
[foo@foo xinetd.d]$ sudo systemctl status tftp.service
● tftp.service - Tftp Server
   Loaded: loaded (/usr/lib/systemd/system/tftp.service; linked; vendor preset: disabled)
   Active: active (running) since Fri 2021-02-12 11:16:31 EST; 6min ago
     Docs: man:in.tftpd
 Main PID: 8907 (in.tftpd)
    Tasks: 1 (limit: 45874)
   Memory: 320.0K
   CGroup: /system.slice/tftp.service
           └─8907 /usr/sbin/in.tftpd -c -p -s /var/lib/tftpboot

Feb 12 11:16:31 foo systemd[1]: Started Tftp Server.
[foo@foo xinetd.d]$ sudo systemctl status tftp.socket
● tftp.socket - Tftp Server Activation Socket
   Loaded: loaded (/usr/lib/systemd/system/tftp.socket; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2021-02-12 11:16:15 EST; 7min ago
   Listen: [::]:69 (Datagram)
   CGroup: /system.slice/tftp.socket

Feb 12 11:16:15 foo systemd[1]: Stopping Tftp Server Activation Socket.
Feb 12 11:16:15 foo systemd[1]: Listening on Tftp Server Activation Socket.
Using ss command from tftp server, show that the port 69 is listening

Code:
foo@foo xinetd.d]$ ss -aul | grep :69
UNCONN   0         0                         *:69                      *:*
From the tftp client, I've turned the following on:
Code:
status
verbose
trace
tftp content lives under /var/lib/tftpboot, I'm wondering if /etc/systemd/system/tftp.service files is correct or not on the tftp server.

Code:
 1 [Unit]
  2 Description=Tftp Server
  3 Requires=tftp.socket
  4 Documentation=man:in.tftpd
  5 
  6 [Service]
  7 ExecStart=/usr/sbin/in.tftpd -c -p -s /var/lib/tftpboot
  8 StandardInput=socket
  9 
 10 [Install]
 11 Also=tftp.socket
 
Old 02-14-2021, 07:38 PM   #3
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Thanks for the URLs.

Believe it or not, I used tecmint and compuatingforgeeks URLs for setup and troubleshooting.

Still having issues. I'm confused because Xinetd has a file under /etc/xinetd.d with settings for tftp, however systemd has a .socket and .service for both tftp. Not sure which one takes precedence.

Looks like I can setup logging via this Red Hat solutions (https://access.redhat.com/solutions/451773), however I didn't see anything going into /var/log/messages to begin with.

thanks

Last edited by JockVSJock; 02-14-2021 at 07:50 PM.
 
Old 02-14-2021, 07:58 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Quote:
--create, -c
Allow new files to be created. By default, tftpd will only allow upload of files that already exist. Files are created with default permissions allowing anyone to read or write them, unless the --permissive or --umask options are specified.

--user username, -u username
Specify the username which tftpd will run as; the default is "nobody". The user ID, group ID, and (if possible on the platform) the supplementary group IDs will be set to the ones specified in the system permission database for this username.

--permissive, -p
Perform no additional permissions checks above the normal system-provided access controls for the user specified via the --user option.
I believe it is a permission issue. If I understand the above because your using -p means any file not owned by nobody read/write is not allowed and therefore not transferred.
Try removing the -p option.

https://linux.die.net/man/8/tftpd
 
Old 02-15-2021, 07:48 AM   #5
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420

Original Poster
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
So I did the following, I remove the -p under /etc/systemd/system/tftp.service, so it now looks like this:

Code:
[Service]
ExecStart=/usr/sbin/in.tftpd -c -s /var/lib/tftpboot
StandardInput=socket
Once doing that reloaded all daemons with the following command:

Code:
systemctl daemon-reload
I fired up the tftp client,

Code:
tftp xx.xx.xx.xx
verbose
trace
get test_file1.txt

Was able to download the test .txt file and it was successful.

thanks

Last edited by JockVSJock; 02-15-2021 at 08:15 AM.
 
  


Reply

Tags
rhel, service, socket, tftp



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to change mode of tftp ,then get file and put file? programming in shell zobin Programming 3 02-25-2012 02:31 AM
in.tftp pxelinux.0_ fails with TFTP open timeout deadeyes Linux - Server 1 05-28-2010 10:07 AM
after re-create tftp dir, tftp doesn't work anymore lastguy Linux - Networking 2 11-16-2007 03:33 PM
tftp issue, unable to transfer kernel image using tftp to boot ltsp-client noobs4linux Linux - Networking 1 02-07-2007 01:53 AM
TFTP-Problem: TFTP timed out Bikerpete Linux - General 2 08-14-2003 05:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration