Operating System - HP-UX
1832420 Members
3004 Online
110042 Solutions
New Discussion

ftp service - very strange behaviour

 
ITeam
Super Advisor

ftp service - very strange behaviour

We have been running an rx2600 server with 11.23 since January. Anonymous FTP configured to our specific configuration and has been working fine until recently.
Up until a few weeks ago we have been able to ftp to the server as any user and anonymous and specify the full path of the file to put onto the server without any problems. Now, anonymous user will connect okay but will not allow any transfers to the server. All other users (appart from root) when using the put command - put /data/TEST - we get the follwoing error message - 553 /data/TEST: Permission denied on server. (Upload) - yet if we start from the /data directory and just use - put TEST - the transfer is successful. Root is always successful.

Any suggestions as I now feel as if I'm banging my head against a brick wall.

Many thanks in advance, Graeme.
18 REPLIES 18
Mark Grant
Honored Contributor

Re: ftp service - very strange behaviour

First place I'd look in would be /etc/ftpd/ftpaccess and see if it has been modified recently and maybe see if upload permissions have changed.
Never preceed any demonstration with anything more predictive than "watch this"
G. Vrijhoeven
Honored Contributor

Re: ftp service - very strange behaviour

Hi Graeme,

Can you display an output of ll of the dir.
Can it be that permissions on the dir the anon tries to write to have changed?

Gideon
Sridhar Bhaskarla
Honored Contributor

Re: ftp service - very strange behaviour

Hi,

I agree with the previous suggestions. 'ftpaccess' is in use. Looks like /data is not given permissions to be uploaded into.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
ITeam
Super Advisor

Re: ftp service - very strange behaviour

Gideon,

As you can see below there is full permissions on the public directory.
drwxrwxrwx 2 root sys 1024 Jun 16 12:38 public

Mark,

We do not use the ftpaccess file. There is no file on the server and never has been.
ITeam
Super Advisor

Re: ftp service - very strange behaviour

I'm sorry if I have misled, but the file TEST resides on another server under a directory called /data. The error happens when the user is on the other server, where the TEST file resides, and from their own home directory, on that server, try to put the TEST file using the explicite path to the TEST file - put /data/TEST - to the rx2600 server. If they change directory to /data before entering ftp and use - put TEST - it works fine.
ITeam
Super Advisor

Re: ftp service - very strange behaviour

Having now setup the ftpaccess file in /etc/ftpd, allowing full access to anyone who uses ftp to the server, the problem is still persisting, all users apart from root are unable to put anything onto the server using explicite paths for the source file name. Any suggestions?
Dan Martin_1
Frequent Advisor

Re: ftp service - very strange behaviour

Graeme,

Your FTP server is HPUX 11.23, correct. What type of boxes are you FTP'ing from?

Dan
Dan Martin_1
Frequent Advisor

Re: ftp service - very strange behaviour

Graeme,

When you use an ftp put with a full pathname, the client will attempt to use that full path on the server. So if there is no /data dir on the server, you will not be able to upload. However, it looks like there is a /data dir on the server but it is not writable by ordinary users, only by root.

You should change the permissions on the /data director on the server if you want users to be able to ftp to it.

Dan
Fred Ruffet
Honored Contributor

Re: ftp service - very strange behaviour

As Dan semms to point at, it may depend on the client, and at the commands it passes to the FTP server. It maybe tries to put a file calles data/TEST in /, what the server may correctly interpret, except that they don't have write permission to /.

Just for test (and change it back after), try to issue a chmod a+w / on the HP server, and then test the ftp commands.

If this is the case, it may have 2 causes :
. The ftp clients have change and they don't send the same commands as before. (Even a single update on windows could have done this)
. An admin issued a chmod a-w on /

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Fred Ruffet
Honored Contributor

Re: ftp service - very strange behaviour

Dan,
it can't be the solution : they can issue a cd to /data and put TEST. Only put /data/TEST doesn't work.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Dan Martin_1
Frequent Advisor

Re: ftp service - very strange behaviour

Fred,

No, they are changing directory to /data on the client machine BEFORE the ftp.

> If they change directory to /data before
> entering ftp and use - put TEST - it
> works fine.

Dan
Fred Ruffet
Honored Contributor

Re: ftp service - very strange behaviour

You're right Dan ! I missed it all !
/data/TEST is on client...
thanks !

However, you still have the problem of the client : It tries to put a file called "/data/TEST" on /. IMHO problem is not on server side...

What is OS on clients ?

regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Dan Martin_1
Frequent Advisor

Re: ftp service - very strange behaviour

Fred,

Even blind hogs . . . :)

We agree that it is trying to put the file in /data/TEST on the server. I don't know what could have changed to cause this, but I have noticed similar behavior using the 11.11 ftp client, and ran a few tests which confirmed that it would exhibit this type of behavior.

Graeme,

Is it possible that different clients are responsible for differing behavior?

Dan
ITeam
Super Advisor

Re: ftp service - very strange behaviour

Dan,

Correct, HPUX 11.23, we usually only ftp from a HPUX 10.20 server and it has been from this that I have been testing. I have just done some testing from an XP Pro PC and found the following.

If I specify put /test/PATTERN PATTERN or put /test/PATTERN /tmp/PATTERN, all works fine. Except for anonymous, still gives the same error when I use put /test/PATTERN PATTERN.

Just tried same from 10.20 server with the same results.

At present the only user now having the problem is the anonymous user. I have rechecked the permissions on the public directory and they are full permissions for everyone.
It would appear to be a permissions problem but everything I check regarding permissions appear to be correct.

Again, thanks for your assistance.
Dan Martin_1
Frequent Advisor

Re: ftp service - very strange behaviour

Graeme,

According to my documentation, for an anonymous session HPUX's ftpd does a chroot to the home directory of the user "ftp". Unless /data is the ftp user's home directory and there is a subdirectory /data/data, you would not be able to do a put using the full path of /data/TEST, because it would actually be trying to put it at /data/data/TEST.

Dan
ITeam
Super Advisor

Re: ftp service - very strange behaviour

Dan,

You are correct, but the tests I have been doing lately have been specifying the name of the file to call it at the remote end. Example, put /test/PATTERN PATTERN. Doing this as anonymous is still producing the error, but as any other user is working fine.
Dan Martin_1
Frequent Advisor

Re: ftp service - very strange behaviour

Graeme,

What are the permissions on the ftp user's home directory? If they are dr-xr-xr-x (555) as the manual calls for, then you will not be able to create a new file in that directory and a put will fail with permission error.

However, if there is already a file there you will be able to write over it.

Sorry if I am repeating the obvious . . .

Dan
ITeam
Super Advisor

Re: ftp service - very strange behaviour

Dan,

The ftp users home dir is drwxrwxrwx (777). So in theory there shouldn't be a problem writing to it, but in this case theory is wrong.