Operating System - HP-UX
1823114 Members
3267 Online
109646 Solutions
New Discussion юеВ

Re: FTP - How to prevent a user from deleting files

 
Manoj Sooka
Occasional Advisor

FTP - How to prevent a user from deleting files

Hello Good People

I need to prevent a ftp user on a HP-UX server to delete files. The user should have the capability to get and put files into the directory but should not be able to delete any files. Is this possible to do ?
If it is, how must it be done ?

Thanks in advance.
Manoj
7 REPLIES 7
Nicolas Dumeige
Esteemed Contributor

Re: FTP - How to prevent a user from deleting files

Set the rights on the directory to be read only for the ftp user :
chmod o-w my_directory
All different, all Unix
Manoj Sooka
Occasional Advisor

Re: FTP - How to prevent a user from deleting files

Thanks Nicolas for that.

Will this still allow the user to put files into the directory if it only has read permissions ?

Thanks
Manoj
Fabio Ettore
Honored Contributor

Re: FTP - How to prevent a user from deleting files

Hi Manoj,

configure the following file:

/etc/ftpd/ftpaccess

delete no guest,anonymous # delete permission?
overwrite no guest,anonymous # overwrite permission?
rename no guest,anonymous # rename permission?

In this way guest and anonymous users cannot delete, overwrite and rename files.

I hope this helps you.

Best regards,
Ettore
WISH? IMPROVEMENT!
Steven E. Protter
Exalted Contributor

Re: FTP - How to prevent a user from deleting files

I handle this my making sure the user doesn't have write rights to the files.

chmod a-w *

or by changing ownership to other users and

chmod o-w *

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
Manoj Sooka
Occasional Advisor

Re: FTP - How to prevent a user from deleting files

Thanks Ettore and Steven.

I think the ftpaccess file is the way to go as restricting permissions on the files cannot really be controlled as the files are shared between many users and new ones created all the time.

Ettore, the ftpaccess file does not exist. Do I simply just create it with the entries or are there other steps to do before this ?

Thanks
Manoj
Fabio Ettore
Honored Contributor

Re: FTP - How to prevent a user from deleting files

Hi Manoj,

if file doesn't exist then just create it:

# vi /etc/ftpd/ftpaccess

delete no guest,anonymous # delete permission?
overwrite no guest,anonymous # overwrite permission?
rename no guest,anonymous # rename permission?

I remember you that user must be guest or anonymous in this instance.

# chmod 444 /etc/ftpd/ftpaccess
# chown bin:bin /etc/ftpd/ftpaccess

Hope this helps you.
Ettore

P.S.: I noticed that you are using two users in this post....
WISH? IMPROVEMENT!
Michael Schulte zur Sur
Honored Contributor

Re: FTP - How to prevent a user from deleting files

Hi Manoj,

it seems that you have switched your account. Try to login with the account that you used to create the question with, so you be better seen as the author.

greetings,

Michael

zero points please