1823250 Members
3279 Online
109648 Solutions
New Discussion юеВ

TFTP: Error code 2

 
SOLVED
Go to solution
S-un-B-ix-S
Advisor

TFTP: Error code 2

I have configured tftp on my HPUX 11i box, but I am receiving the following error when I attempt to transfer files to this box.


tftp> get testfile /export/testfile
getting from systemA:testfile to /export/testfile [netascii]
sent RRQ
received ERROR
Error code 2: Access violation

I followed these instructions (Still having issues though):

http://docs.hp.com/en/B2355-90147/ch05s04.html

Here are the necessary outputs:


# grep tftp /etc/passwd
tftp:*:119:128:TFTP:/home/tftpdir:/usr/bin/false

# grep tftp /etc/group
tftp::128:
##grep tftp /etc/inetd.conf


tftp dgram udp wait root /usr/lbin/tftpd tftpd\
/home/tftpdir
#

Any help would be much appreciated.




7 REPLIES 7
Jeff_Traigle
Honored Contributor

Re: TFTP: Error code 2

What's the ownership of the /home/tftpdir and file you're trying to retrieve. As it states in that doc, the file must be readable by the tftp user.
--
Jeff Traigle
S-un-B-ix-S
Advisor

Re: TFTP: Error code 2

# ll /home

drw------- 2 tftp tftp 96 Feb 8 15:45 tftpdir


# ll /home/tftpdir
total 16
-rwxrwxrwx 1 tftp tftp 4 Feb 8 15:45 testfile
#

Jeff_Traigle
Honored Contributor
Solution

Re: TFTP: Error code 2

Think you need the execute bit on the directory as it states in the doc. Try it after "chmod u+x /home/tftpdir".
--
Jeff Traigle
S-un-B-ix-S
Advisor

Re: TFTP: Error code 2


# ll

drwx------ 2 tftp tftp 96 Feb 8 15:45 tftpdir

Same thing as before ...

ftp> get testfile /export/testfile
getting from systemA:testfile to /export/testfile [netascii]
sent RRQ
received ERROR
Error code 2: Access violation
OldSchool
Honored Contributor

Re: TFTP: Error code 2

Look at the permissions on the file at the "other" end:

from http://docs.hp.com/en/B2355-90147/ch05s08.html

Symptom:
File transfer fails with Access Violation, Permission Denied, or TFTP Error Code 2 message.

Cause:
tftpd does not have permission to read the file.

Action:
If the transfer is a get operation where the client is attempting to read the file from the server, then the server does not have read permissions on the file that it is trying to send. Ensure that the file the client is reading has read permissions for the user tftp. For example, if the client was attempting to read the file named xterm, xterm should be mode 0400 and owned by the user tftp:


$ ll /home/tftpdir/xterm-r-------- 1 tftp guest 438 May 10 1989 xterm


If the transfer is a put operation (which is not something a BOOTP client will be doing as part of the BOOTP protocol), then this message means that the file did not have sufficient write permissions for the server to write to the file. If the server is to receive a file, it must already exist and be writeable by the user tftp. For example, if a tftp client is sending the file named fontlist, the file must be mode 0600 and owned by tftp:


$ ll /home/tftpdir/fonts-rw------- 1 tftp guest 0 May 10 1989 fonts

S-un-B-ix-S
Advisor

Re: TFTP: Error code 2

Turns out it was a permission issue - thanks again!
S-un-B-ix-S
Advisor

Re: TFTP: Error code 2

It was a permissions issue with the directory.