1827378 Members
3791 Online
109963 Solutions
New Discussion

Re: TFTP Server

 
avik
Valued Contributor

TFTP Server

I want to setup an hpux server as the TFTP server. I have followed the docs & made the changes in configuration file as follows

/etc/passwd
===========
tftp:*:510:20:TFTP User:/home/tftp:/usr/bin/false

/etc/inetd.conf
================
tftp dgram udp wait root /usr/lbin/tftpd tftpd /opt/test_tftp

Now that I am able to get the file from the tftp server but when I put the file, its throwing an access violation error as given below.

root@fc2:/tmp#tftp fc2
tftp> get file.out
Received 117 bytes in 0.0 seconds
tftp> quit
root@fc2:/tmp#
\root@fc2:/tmp#tftp fc2
tftp> put file.out
Error code 2: Access violation
tftp> quit


The permissions are set properly

root@fc2:/tmp#ll -d /home/tftp
drwx------ 2 tftp users 96 Jul 18 22:06 /home/tftp
root@fc2:/tmp#

Any idea whats hapening ?

Thanks in anticipation
1 REPLY 1
Ivan Ferreira
Honored Contributor

Re: TFTP Server

tftpd uses a call to chroot() to change its root directory to be the same as the home directory of the pseudo-user tftp. This restricts access by tftp clients to only those files found below the tftp home directory (see chroot(2)).

Furthermore, tftp clients can only read files in that directory if they are readable by the pseudo-user tftp, and tftp clients can only write files in that directory if they exist and are writable by the pseudo-user tftp.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?