Operating System - HP-UX
1838458 Members
3033 Online
110126 Solutions
New Discussion

Re: Secure ftp - can a user rm/del

 
SOLVED
Go to solution
Tim O'Connell
Regular Advisor

Secure ftp - can a user rm/del

Hi,

I have secure ftp running on my HPUX11 server. Users can send & receive files from one dir and are allowed only to run the ls unix command. I now need to allow a ftp user to remotely delete a file once he has received it. If I try to rm or del the file, I get
ftp> del filename
553 filename: Permission denied. (Delete)
ftp> rm filename
553 filename: Permission denied. (Delete)
ftp>
Is there anyway to allow the user to do this?

Thanks,

Tim
6 REPLIES 6
David Child_1
Honored Contributor
Solution

Re: Secure ftp - can a user rm/del

Tim,

Take a look at /etc/ftpd/ftpaccess. There is a lot that can be configured in there. What version of ftp are you running?

David
Florian Heigl (new acc)
Honored Contributor

Re: Secure ftp - can a user rm/del

Obviously he does not own the file - please check the permission.

If the file is automatically created, try to:

put the creating_user to a group ftpusers together where the accessing user is also a member.
then have the file be created group writable
(umask)
and chown it to
creating_user:ftpusers.
yesterday I stood at the edge. Today I'm one step ahead.
Steven E. Protter
Exalted Contributor

Re: Secure ftp - can a user rm/del

file permissions could be an issue as well.

Does the user have permissions to the file they are trying to delete. You always need to check that.

If they can delete the file at the shell prompt an not via ftp or sftp, then there is something to do on the ftpaccess and ftpusers file, if this is ftp and not secure ftp. Secure ftp sftp, part of openssh/secure shell does not rely on those configuration files as far as I know.

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
David Child_1
Honored Contributor

Re: Secure ftp - can a user rm/del

Good call Florian. I think I'm running a bit slow this morning.

Actually I believe you will need to check the permissions on the directory these files are placed in. Even if you own the file you won't be able to delete it if you don't have the correct directory permissions.

As Florian sugguested, put both the create_user and ftp_user in the same group (e.g. ftpgrp) and then change the directory permissions to 775. To go a step further you may want to get the SGID bit on the directory so all files put in there will automatically be owned by the group (ftpgrp).

David
Tim O'Connell
Regular Advisor

Re: Secure ftp - can a user rm/del

Thanks for responses. I should have mentioned that Unix permissions are OK. Have even tried it with 777 perms for file & directory. Will take a look at recommendations on ftpaccess. Will award points later.

Thanks,

Tim
Tim O'Connell
Regular Advisor

Re: Secure ftp - can a user rm/del

Have given delete access to the ftp group thru' /etc/ftpd/ftpaccess

Many Thanks,

Tim