Showing posts with label tftp. Show all posts
Showing posts with label tftp. Show all posts

Saturday, November 26, 2016

Understanding how tftpd put works - Error code 2: Access violation

Trying to install a tftp server onto Debian? Yet, not succeeding in uploading files onto the tftp server? Getting the following error?  Error code 2: Access violation

You are likely running into the following "feature" (issue) that is being described in the tftpd documentation.

The use of tftp(1) does not require an account or password on the remote system.  Due to the lack of authentication information, tftpd will allow only publicly readable files to be accessed.  Files may be written  only if they already exist and are publicly writable.  Note that this extends the concept of “public” to include all users on all hosts that can be reached through the network;

To fix this, before putting any new file in your /tftpboot directory it has to:
  1. exist 
  2. be world writable and optionally be owned by nobody
Note: Certain tftp servers for Windows do allow the direct put of a file, even if it does not exist. I did not found any that do that under Linux.

Tip from: http://myhomelab.blogspot.be/2013/09/installing-tftp-server-in-linux.html

Monday, September 19, 2016

Error installing tftpd-hpa onto Raspian: action "start" failed

What is the issue?

When trying to install the tftpd-hpa package, the installation isn't completed succesfully and the daemon is not running or cannot be started.

root@raspberrypi:/srv/tftp# apt-get install tftpd-hpa
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  ffmpeg openbsd-inetd
Use 'apt-get autoremove' to remove them.
Suggested packages:
  syslinux-common
The following NEW packages will be installed:
  tftpd-hpa
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 0 B/46.1 kB of archives.
After this operation, 142 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package tftpd-hpa.
(Reading database ... 85095 files and directories currently installed.)
Unpacking tftpd-hpa (from .../tftpd-hpa_5.2-4_armhf.deb) ...
Processing triggers for man-db ...
Setting up tftpd-hpa (5.2-4) ...

tftpd-hpa directory (/srv/tftp) already exists, doing nothing.
[....] Starting HPA's tftpd: in.tftpdinvoke-rc.d: initscript tftpd-hpa, action "start" failed.
dpkg: error processing tftpd-hpa (--configure):
 subprocess installed post-installation script returned error exit status 71
Errors were encountered while processing:
 tftpd-hpa
E: Sub-process /usr/bin/dpkg returned an error code (1)

How to fix?

Edit the tftpd-hpa config file, which is normally located under /etc/default:
vi /etc/default/tftpd-hpa
Change the IP from 0.0.0.0 to the real IP of you tftpd-hpa server machine.
Add into the option parameter "--ipv4"

Force a re-installation of tftpd-hpa.

root@raspberrypi:/srv/tftp# apt-get install -f tftpd-hpa
Reading package lists... Done
Building dependency tree
Reading state information... Done
tftpd-hpa is already the newest version.
The following packages were automatically installed and are no longer required:
  ffmpeg openbsd-inetd
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
Setting up tftpd-hpa (5.2-4) ...
tftpd user (tftp) already exists, doing nothing.
tftpd-hpa directory (/srv/tftp) already exists, doing nothing.
[ ok ] Starting HPA's tftpd: in.tftpd.

Now tftpd-hpa is starting properly and by default listening onto UDP port 69.