Davide Grandis
2007-Sep-13 15:56 UTC
[CentOS] [CentOS 5] tftp-server, unable to create new files (even with "-c" option)
Hi all, I'm trying to setup a TFTP server to serve as repository for the config of all my Cisco network devices. As per the the tftpd man, I've added the "-c" option into the /etc/ xinetd.d/tftp (as follows) but I still cannot get write access (unless the file is already present). [root at chl1 ~]# cd /etc/xinetd.d [root at chl1 xinetd.d]# cat tftp # default: off # description: The tftp server serves files using the trivial file transfer \ # protocol. The tftp protocol is often used to boot diskless \ # workstations, download configuration files to network-aware printers, \ # and to start the installation process for some operating systems. service tftp { disable = no socket_type = dgram protocol = udp wait = no user = root server = /usr/sbin/in.tftpd server_args = -s -c /tftpboot per_source = 11 cps = 100 2 flags = IPv4 } And here is it concerning the home path owner & permissions: [root at chl1 /]# ls -la ... drwxrwxrwx 2 root root 4096 Sep 13 10:18 tftpboot ... [root at chl1 /]# ls -la tftpboot/ drwxrwxrwx 2 root root 4096 Sep 13 10:18 . drwxr-xr-x 25 root root 4096 Sep 13 17:48 .. -rwxrwxrwx 1 nobody nobody 1811552 Sep 12 10:28 c3500xl-c3h2s-mz. 120-5.WC17.bin -rwxrwxrwx 1 nobody nobody 1181 Sep 13 17:51 pippo.config (pippo.config = fake file) This is what I get at the TFTP client side: LabTI-Infra-3524XL-01#copy running-config tftp: Address or name of remote host []? 10.58.2.204 Destination filename [labti-infra-3524xl-01-confg]? TFTP: error code 1 received - File not found %Error opening tftp://10.58.2.204/labti-infra-3524xl-01-confg (Undefined error) LabTI-Infra-3524XL-01# LabTI-Infra-3524XL-01#copy running-config tftp: Address or name of remote host []? 10.58.2.204 Destination filename [labti-infra-3524xl-01-confg]? pippo.config !! 2327 bytes copied in 0.831 secs So, it means that the TFTP client can only *re-write* an existing file but not creating new ones, and this is the expected behavior if the "-c" parameter is omitted! What am I missing? Any suggestion really appreciated! TIA, Davide
Mogens Kjaer
2007-Sep-13 16:04 UTC
[CentOS] [CentOS 5] tftp-server, unable to create new files (even with "-c" option)
Davide Grandis wrote: ...> What am I missing?SELinux? Mogens -- Mogens Kjaer, Carlsberg A/S, Computer Department Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark Phone: +45 33 27 53 25, Fax: +45 33 27 47 08 Email: mk at crc.dk Homepage: http://www.crc.dk
Ross S. W. Walker
2007-Sep-13 16:07 UTC
[CentOS] [CentOS 5] tftp-server, unable to create new files (even with "-c" option)
Davide Grandis wrote:> > Hi all, > > I'm trying to setup a TFTP server to serve as repository for the > config of all my Cisco network devices. > > As per the the tftpd man, I've added the "-c" option into the /etc/ > xinetd.d/tftp (as follows) but I still cannot get write access > (unless the file is already present). > > [root at chl1 ~]# cd /etc/xinetd.d > [root at chl1 xinetd.d]# cat tftp > # default: off > # description: The tftp server serves files using the trivial file > transfer \ > # protocol. The tftp protocol is often used to boot diskless \ > # workstations, download configuration files to network-aware > printers, \ > # and to start the installation process for some operating > systems. > service tftp > { > disable = no > socket_type = dgram > protocol = udp > wait = no > user = root > server = /usr/sbin/in.tftpd > server_args = -s -c /tftpboot > per_source = 11 > cps = 100 2 > flags = IPv4 > }Did you give xinetd the HUP signal after modifying the file? <snip> ______________________________________________________________________ This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, and any attachments thereto, is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender and permanently delete the original and any copy or printout thereof.
Grant McChesney
2007-Sep-13 17:27 UTC
[CentOS] [CentOS 5] tftp-server, unable to create new files (even with "-c" option)
On 9/13/07, Davide Grandis <davide.grandis at fastwebnet.it> wrote:> > Hi all, > > I'm trying to setup a TFTP server to serve as repository for the > config of all my Cisco network devices. > > As per the the tftpd man, I've added the "-c" option into the /etc/ > xinetd.d/tftp (as follows) but I still cannot get write access > (unless the file is already present). > > [root at chl1 ~]# cd /etc/xinetd.d > [root at chl1 xinetd.d]# cat tftp > # default: off > # description: The tftp server serves files using the trivial file > transfer \ > # protocol. The tftp protocol is often used to boot diskless \ > # workstations, download configuration files to network-aware > printers, \ > # and to start the installation process for some operating > systems. > service tftp > { > disable = no > socket_type = dgram > protocol = udp > wait = no > user = root > server = /usr/sbin/in.tftpd > server_args = -s -c /tftpboot > per_source = 11 > cps = 100 2 > flags = IPv4 > } > > And here is it concerning the home path owner & permissions: > > [root at chl1 /]# ls -la > ... > drwxrwxrwx 2 root root 4096 Sep 13 10:18 tftpboot > ... > [root at chl1 /]# ls -la tftpboot/ > drwxrwxrwx 2 root root 4096 Sep 13 10:18 . > drwxr-xr-x 25 root root 4096 Sep 13 17:48 .. > -rwxrwxrwx 1 nobody nobody 1811552 Sep 12 10:28 c3500xl-c3h2s-mz. > 120-5.WC17.bin > -rwxrwxrwx 1 nobody nobody 1181 Sep 13 17:51 pippo.config > > (pippo.config = fake file) > > This is what I get at the TFTP client side: > > LabTI-Infra-3524XL-01#copy running-config tftp: > Address or name of remote host []? 10.58.2.204 > Destination filename [labti-infra-3524xl-01-confg]? > TFTP: error code 1 received - File not found > > %Error opening tftp://10.58.2.204/labti-infra-3524xl-01-confg > (Undefined error) > > LabTI-Infra-3524XL-01# > LabTI-Infra-3524XL-01#copy running-config tftp: > Address or name of remote host []? 10.58.2.204 > Destination filename [labti-infra-3524xl-01-confg]? pippo.config > !! > 2327 bytes copied in 0.831 secs > > So, it means that the TFTP client can only *re-write* an existing > file but not creating new ones, and this is the expected behavior if > the "-c" parameter is omitted! > > What am I missing? > > Any suggestion really appreciated! > > TIA, > Davide > >I had this same problem when trying to back up my switch configs. After some googling, I found a workaround for RH-based systems. The workaround is disable tftp in xinetd, and run in.tftpd manually. I never figured out why it would not work with xinetd. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20070913/403389d9/attachment.html>
Connie Sieh
2007-Sep-13 18:46 UTC
[CentOS] [CentOS 5] tftp-server, unable to create new files (even with "-c" option)
On Thu, 13 Sep 2007, Grant McChesney wrote:> On 9/13/07, Davide Grandis <davide.grandis at fastwebnet.it> wrote: >> >> Hi all, >> >> I'm trying to setup a TFTP server to serve as repository for the >> config of all my Cisco network devices. >> >> As per the the tftpd man, I've added the "-c" option into the /etc/ >> xinetd.d/tftp (as follows) but I still cannot get write access >> (unless the file is already present). >> >> [root at chl1 ~]# cd /etc/xinetd.d >> [root at chl1 xinetd.d]# cat tftp >> # default: off >> # description: The tftp server serves files using the trivial file >> transfer \ >> # protocol. The tftp protocol is often used to boot diskless \ >> # workstations, download configuration files to network-aware >> printers, \ >> # and to start the installation process for some operating >> systems. >> service tftp >> { >> disable = no >> socket_type = dgram >> protocol = udp >> wait = no >> user = root >> server = /usr/sbin/in.tftpd >> server_args = -s -c /tftpboot >> per_source = 11 >> cps = 100 2 >> flags = IPv4 >> } >> >> And here is it concerning the home path owner & permissions: >> >> [root at chl1 /]# ls -la >> ... >> drwxrwxrwx 2 root root 4096 Sep 13 10:18 tftpboot >> ... >> [root at chl1 /]# ls -la tftpboot/ >> drwxrwxrwx 2 root root 4096 Sep 13 10:18 . >> drwxr-xr-x 25 root root 4096 Sep 13 17:48 .. >> -rwxrwxrwx 1 nobody nobody 1811552 Sep 12 10:28 c3500xl-c3h2s-mz. >> 120-5.WC17.bin >> -rwxrwxrwx 1 nobody nobody 1181 Sep 13 17:51 pippo.config >> >> (pippo.config = fake file) >> >> This is what I get at the TFTP client side: >> >> LabTI-Infra-3524XL-01#copy running-config tftp: >> Address or name of remote host []? 10.58.2.204 >> Destination filename [labti-infra-3524xl-01-confg]? >> TFTP: error code 1 received - File not found >> >> %Error opening tftp://10.58.2.204/labti-infra-3524xl-01-confg >> (Undefined error) >> >> LabTI-Infra-3524XL-01# >> LabTI-Infra-3524XL-01#copy running-config tftp: >> Address or name of remote host []? 10.58.2.204 >> Destination filename [labti-infra-3524xl-01-confg]? pippo.config >> !! >> 2327 bytes copied in 0.831 secs >> >> So, it means that the TFTP client can only *re-write* an existing >> file but not creating new ones, and this is the expected behavior if >> the "-c" parameter is omitted! >> >> What am I missing? >> >> Any suggestion really appreciated! >> >> TIA, >> Davide >> >> > > I had this same problem when trying to back up my switch configs. After > some googling, I found a workaround for RH-based systems. The workaround is > disable tftp in xinetd, and run in.tftpd manually. I never figured out why > it would not work with xinetd. >Is xinetd installed? -Connie Sieh