0

Hi guys I have set up a small shared hosting set up for friends.

I have set the file chmod permissions to

chmod 711 /home
chmod 711 /home/testuser
chmod 755 /home/testuser/public_html
chmod o+r /home/testuser/public_html/index.htm

How do I stop the user connected to their own ftp from deleting the html.htm file and also with the public dir set to chmod 755 I find they can't do anything in the directory such as upload/delete?

Additional info: I have run

setsebool -P httpd_enable_homedirs true
chcon -R -t httpd_sys_content_t /home/testuser/public_html

but no effect?

Kal
  • 141
  • 7

1 Answers1

1

You can make the file immutable, with:

# chattr +i filename

then even root user won't be able to delete it.

Stone
  • 7,011
  • 1
  • 21
  • 33
  • 1
    It's worth noting that this is OS and file-system specific (i.e. Linux and ext2/3/4). The `setsebool` command implies use of Apache, an alternative approach for Apache is to use `Alias` or `AliasMatch` to point the `~user/index.htm` URLs to somewhere the users cannot access. – mr.spuratic Feb 02 '13 at 11:10
  • @mr.spuratic If you want to post an alternative answer just mentioning AliasMatch, I would upvote it :). – sourcejedi Feb 02 '13 at 16:59