Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 28 |
Nodes: | 6 (0 / 6) |
Uptime: | 43:36:54 |
Calls: | 422 |
Calls today: | 1 |
Files: | 1,024 |
Messages: | 90,185 |
As per title, I can get neither tftp or tftpd - at least I think[snip]
neither but it's difficult to be sure - to work under Ubuntu 22. After
some initial difficulties, I decided to uninstall and reinstall. Upon reinstallation, I received a warning that the file '/etc/inetd.conf' did
not exist so I uninstalled them both again, 'touch'ed to create an empty '/etc/inetd.conf', and then reinstalled again, this time without undue warnings. The two config files now read as follows ...
May 16 11:37:42 Computer xinetd[1945]: added service tftp [file=/etc/inetd.conf] [line=1]
May 16 11:37:42 Computer xinetd[1945]: 2.3.15.3 started with libwrap
loadavg labeled-networking options compiled in.
May 16 11:37:42 Computer xinetd[1945]: Started working: 2 available services
... but no listener is found on port 69 ...
user@Computer:/home$ netstat -na | grep LIST | grep 69
unix 2 [ ACC ] STREAM LISTENING 9169 /var/run/samba/nmbd/unexpected
... and generally there is no evidence of any tftp service actually
running, for example ...
user@Computer:/home$ ps -aux | grep -v grep | grep tftp
user@Computer:/home$ systemctl list-units --no-pager | grep tftp user@Computer:/home$ sudo service --status-all | grep tftp
... all find nothing. Unsurprisingly therefore, when I try to set up a
test, nothing works ...
user@Computer:/home$ sudo echo "This is a TFTP test from $(hostname)" > /home/tftpboot/test.txt
user@Computer:/home$ sudo chown nobody:nogroup /home/tftpboot/test.txt user@Computer:/home$ ll /home/tftpboot/test.txt
-rw-r--r-- 1 nobody nogroup 36 2025-05-15 21:43 /home/tftpboot/test.txt user@Computer:/home$ cat /home/tftpboot/test.txt
This is a TFTP test from Computer
user@Computer:/home$ tftp localhost
tftp> get test.txt
tftp: test.txt: Permission denied
tftp> q
Using 127.0.0.1 instead of localhost suffers the same fate, as does an attempt to get a similar test text file from one of the Zyxel NSA221
NASs, as does an attempt for a non-existent file or a non-existent
server, so the error given could mean almost any type of failure and I
don't know whether I have one problem with the client on the Ubuntu PC,
or two problems with the service on each machine, PC and NAS, or all
three. I was going to install the windows TFTP client to test with
that, but for some reason or other that failed, and there's nothing in
the event logs to suggest why, so for the moment I'm stuck.
In uk.comp.os.linux Java Jive <java@evij.com.invalid> wrote:
[snip]
As per title, I can get neither tftp or tftpd - at least I think
neither but it's difficult to be sure - to work under Ubuntu 22. After
some initial difficulties, I decided to uninstall and reinstall. Upon
reinstallation, I received a warning that the file '/etc/inetd.conf' did
not exist so I uninstalled them both again, 'touch'ed to create an empty
'/etc/inetd.conf', and then reinstalled again, this time without undue
warnings. The two config files now read as follows ...
May 16 11:37:42 Computer xinetd[1945]: added service tftp
[file=/etc/inetd.conf] [line=1]
May 16 11:37:42 Computer xinetd[1945]: 2.3.15.3 started with libwrap
loadavg labeled-networking options compiled in.
May 16 11:37:42 Computer xinetd[1945]: Started working: 2 available services
OK, so xinetd is running and has seen your tftp config file.
... but no listener is found on port 69 ...
user@Computer:/home$ netstat -na | grep LIST | grep 69
unix 2 [ ACC ] STREAM LISTENING 9169
/var/run/samba/nmbd/unexpected
It's udp so it won't have a LISTEN state. I would expect a line similar to:
udp 0 0 0.0.0.0:69 0.0.0.0:*
Do ps/etc show that xinetd is running?
Does 'ss -lp' show xinetd listening on any sockets?
user@Computer:/home$ sudo echo "This is a TFTP test from $(hostname)" >
/home/tftpboot/test.txt
user@Computer:/home$ sudo chown nobody:nogroup /home/tftpboot/test.txt
user@Computer:/home$ ll /home/tftpboot/test.txt
-rw-r--r-- 1 nobody nogroup 36 2025-05-15 21:43 /home/tftpboot/test.txt
user@Computer:/home$ cat /home/tftpboot/test.txt
This is a TFTP test from Computer
user@Computer:/home$ tftp localhost
tftp> get test.txt
tftp: test.txt: Permission denied
tftp> q
Assuming this is tftp-hpa,
It will however do this behaviour even to a nonexistent tftp server:
I think you can tell xinetd to log incoming connections, ie times it started up in.tftpd - it may already do that. Check logs.
That's odd, I've not changed anything since this morning, except that I
shut down the PC when I went out for a walk, but the behaviour has
changed slightly since then:
user@Computer:/home$ tftp localhost
tftp> get test.txt
Transfer timed out.
tftp> q
... resulting in a 0-length file in my home folder, and now when I check syslog, whereas previously it had been unhelpfully free of anything
relevant, now I see the following 5 times ...
May 16 17:17:09 Computer xinetd[1991]: execv( /usr/sbin/tcpd ) failed:
No such file or directory (errno = 2)
... and indeed the following doesn't find tcpd anywhere at all on the
system partition:
user@Computer:/home$ sudo find / -xdev -name tcpd
In uk.comp.os.linux Java Jive <java@evij.com.invalid> wrote:
That's odd, I've not changed anything since this morning, except that I
shut down the PC when I went out for a walk, but the behaviour has
changed slightly since then:
user@Computer:/home$ tftp localhost
tftp> get test.txt
Transfer timed out.
tftp> q
... resulting in a 0-length file in my home folder, and now when I check
syslog, whereas previously it had been unhelpfully free of anything
relevant, now I see the following 5 times ...
May 16 17:17:09 Computer xinetd[1991]: execv( /usr/sbin/tcpd ) failed:
No such file or directory (errno = 2)
... and indeed the following doesn't find tcpd anywhere at all on the
system partition:
user@Computer:/home$ sudo find / -xdev -name tcpd
So it looks like you've configured tftpd in both inetd.conf and xinetd.conf, and the one in inetd.conf has taken priority but isn't working. According
to the man page the inetd.conf format has the following fields, tab or space separated, one service per line:
service name
socket type
protocol[,sndbuf=size][,rcvbuf=size]
wait/nowait[.max]
user[.group] or user[:group]
server program
server program arguments
It looks like you're trying to run a server command:
"/usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp"
tcpd was a very old way to do access control, ie allow/deny certain hosts. Nowadays you'd do that in the firewall. That's probably why you don't have that binary.
Also that command is setting the root of your TFTP files to be /srv/tftp and I think you want it to be /home/tftpboot
I think you need to remove one or other of the inetd.conf and xinetd.conf as otherwise you're trying to start the service twice. Try deleting the inetd.conf line, rebooting and trying again?
That's odd, I've not changed anything since this morning, except that I
shut down the PC when I went out for a walk, but the behaviour has
changed slightly since then:
user@Computer:/home$ tftp localhost
tftp> get test.txt
Transfer timed out.
tftp> q
... resulting in a 0-length file in my home folder, and now when I check syslog, whereas previously it had been unhelpfully free of anything
relevant, now I see the following 5 times ...
May 16 17:17:09 Computer xinetd[1991]: execv( /usr/sbin/tcpd ) failed:
No such file or directory (errno = 2)
... and indeed the following doesn't find tcpd anywhere at all on the
system partition:
user@Computer:/home$ sudo find / -xdev -name tcpd
First I commented out the line in /etc/inetd.conf and rebooted, but
still got 'Permission denied' when trying to get the test file. Next I renamed the file and rebooted, with exactly the same result.
However, in both cases, the 5 lines in syslog are now not generated, in
fact now nothing at all appears in syslog as a result of the failed attempt. I guess that perhaps that may be considered as an improvement,
but unfortunately the service is still not working.
... has the same effect as renaming the file or commenting out the line, nothing in syslog, but still 'Permission denied'. However, expanding on this, realising that it was necessary to give the correct parameters to[...]
to in.tftpd, the following works:
user@Computer:/home$ cat /etc/inetd.conf
tftp dgram udp wait nobody /usr/sbin/in.tftpd -s /home/tftpboot
Thanks very much for your help, which was instrumental in setting on the right track.