Operating System - HP-UX
1838074 Members
4489 Online
110124 Solutions
New Discussion

Allowing ftp user to delete

 
P-Dicky
Frequent Advisor

Allowing ftp user to delete

Good Morning,

I would like to let a certain user delete files using ftp. This user already has certain privileges setup with the ftp access file (their own class). Should I not just have to add a line to the ftpaccess file like


"delete yes classname" ?

Thanks
13 REPLIES 13
Reshma Malusare
Trusted Contributor

Re: Allowing ftp user to delete

Hi P-Dicky,
So you have already given ftp access to those users ( belonging to some class) & now you want them to delete some files.. right..
then, Its also possible by changing that particular group permissions by chmod.
P-Dicky
Frequent Advisor

Re: Allowing ftp user to delete

That is right, but they are trying to delete the files via an ftp client... So even when they file is 777. They can't remove or copy over.

Paul
Steven E. Protter
Exalted Contributor

Re: Allowing ftp user to delete

Shalom,

What a user can delete can be controlled with ownership of the resources involved and common group membership.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
P-Dicky
Frequent Advisor

Re: Allowing ftp user to delete

I think it is not a file system permission issue but has something to do with this section of my ftpaccess file

# all the following default to "yes" for everybody
delete no guest,anonymous # delete permission?
overwrite no guest,anonymous # overwrite permission?
rename no guest,anonymous # rename permission?
chmod no anonymous # chmod permission?
umask no anonymous # umask permission?
defumask 644 website
delete yes website
Bill Hassell
Honored Contributor

Re: Allowing ftp user to delete

> but they are trying to delete the files via an ftp client... So even when they file is 777. They can't remove or copy over.

No one on a Unix system (except root) can delete a file if the DIRECTORY does not allow deletions. Here are the rules:

- Only the contents of a file are controlled by it's permissions.

- The existence of a file (delete, move) are controlled by the directory.

In other words, setting a file to 777 is meaningless when you try to delete it. The directory must allow deletions and this is done by the write permissions of the directory. You can set a file to 000 permissions and anyone can delete the file if the directory is 777. Similarly, set the permissions of the file to 777 and no one can delete the file if the directory is 755 (and owned by root).

So the directory grants removal privileges.

NOTE: setting a file to 777 is always wrong. 777 means that the file is a script or program and HP-UX will try to execute the file when requested and can cause a number of error conditions. And by setting a file to 666, anyone on the system can trash the contents of the file.


Bill Hassell, sysadmin
Reshma Malusare
Trusted Contributor

Re: Allowing ftp user to delete

Hi P-Dicky,
Can you please check ACL entries ( Access control list) as these entries define which users, groups, and/or hosts have permission to access the objects.
Reshma Malusare
Trusted Contributor

Re: Allowing ftp user to delete

Hi,
If permissions cant solve the problem, then try this ftp user command

DELETE remotefilename
Deletes the remote file specified. A directory path may be included with remotefilename.

P-Dicky
Frequent Advisor

Re: Allowing ftp user to delete

Here is the parent dir

drwxrw-r-- 8 wwwftp http 2048 Feb 6 12:14 dcrs

The ftp user is wwwftp

Here is the file - an example

-rwxrwxrwx 1 wwwftp http 0 Feb 6 12:14 paul.txt

Ftp won't all the user to delete it

Not sure what Reshma what you mean by check the acl?
Reshma Malusare
Trusted Contributor

Re: Allowing ftp user to delete

Hi P-Dicky,
I suggested ACL because i thought its a problem related to access permissions.
but from data given by you, It is clear that its not permission problem.
Reshma Malusare
Trusted Contributor

Re: Allowing ftp user to delete

Hi P-Dicky,
As it is previously mentioned By Mr.Bill Hassell [ set the permissions of the file to 777 and no one can delete the file if the directory is 755 (and owned by root).]

Here data which you mentioned also saying that File is having 777 permission but Dir permission is not full.thats why users are not able to delete that file.
Reshma Malusare
Trusted Contributor

Re: Allowing ftp user to delete

Please check Dir owner is also ftp user.
Reshma Malusare
Trusted Contributor

Re: Allowing ftp user to delete

Please check dir ownership & permission.
P-Dicky
Frequent Advisor

Re: Allowing ftp user to delete

Well,

I overlooked the ftpaccess file again and then I added overwrite to go along with the delete. Restart ftp and it all works?