Changing path for destination of file after using put command in tftp

1

0

I am using two linux machines to do tftp file transfer. The transfer is happening properly if server_args path is /var/lib/tftpboot(default path). But when i change it to some other path for eg(/home/user/dir), the put command does not work. So for configuring a path for destination what is the way. Thanks

manoj

Posted 2017-05-10T14:57:28.470

Reputation: 15

Answers

0

I believe this will do with permissions on the directory and who can write to them. If you run ls -al /var/lib | grep tftpboot, take a look at the permissions (probably drwxrwxrwx) as well as the owner of the directory. Then, look at the /home/user permissions and you'll see that it will be set to drwx------ which means that only the user who owns that directory can write to it - tftpd won't have permissions to write to that directory. If you're using Ubuntu, see here for how to properly configure the destination directory for tftpd especially the part about chown.

Edit: SELinux needed to be disabled (or configured) for tftp to write to the specified directory (/home/tftpd in this instance). Information on this can be found here: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Security-Enhanced_Linux/sect-Security-Enhanced_Linux-Enabling_and_Disabling_SELinux-Disabling_SELinux.html

Grave_Rose

Posted 2017-05-10T14:57:28.470

Reputation: 26

Thanks for early reply, but i had changed the permissions already and it did not helped. The permission for /home/user is also drwxrwxrwx. If i want to set a destination path where should i set it in the same destination sytem or another one? – manoj – 2017-05-10T15:29:04.320

Setting 777 on your home directory is a large security risk. If you want to put them in a $HOME directory, can I suggest creating /home/tftp then chown -R tftp /home/tftp and then modify your server_args to point to /home/tftp. – Grave_Rose – 2017-05-10T15:36:38.057

i tried chown -R tftp /home/tftp and then modified server_args to point to /home/tftp but it is not working still. Put command does not work and gives timeout at end. :( – manoj – 2017-05-11T07:10:36.690

By the way i am working on redhat 6 – manoj – 2017-05-11T09:03:31.450

Fantastic. :) I'll update my answer to include SELinux. After that, would you mind upvoting the answer for me and then we can delete our comments? – Grave_Rose – 2017-05-11T13:10:08.540

Okay, sure i will do it – manoj – 2017-05-11T13:12:36.773