file security/protection

Hi All

I am working on a site to help newbie to learn linux for free.

demo.freelinuxconsole.info
there is only one file index.php its been able to rename or deleted.

Kindly let me know what permissions should i give to secure this file from editing or deleting by others.

chown adminuser:admingroup yourfile
chmod 444 yourfile

if a user "demo" logs in , it should be able to only read yourfile
yourfile must Not be owned by the user "demo"

I have no doubts there are some guys around that can help you better than i with security related stuff.

You can also look around in the forums, Perderabo has made some detailed post about how works rights/access/sticky bits ...

i already tried 444 too.
but what should be the user. bcos it resturns with 500 internal server error if i chown the file to root.
any other ways to protect the file.
demo.freelinuxconsole.info/index2.php

Tell more about what you run : linux ? virtualized linux on windows?
apache server ?

i just created a new account in my cpanel and using a script downloaded from codecanyon.net. mine is a dedicated server is with servint running centos.

attached is the script file

Sorry, i am not a PHP coder, i am afraid i cannot help much in this area ... i would have to learn it first :smiley:

i just need how some help in linux file permission to protect this file from editing by others.

What are the permissions (and ownership) on the directory the file is in?

For most linux systems:

chown myusername:apache file
chmod u+rw file
chmod g+r file
chmod o-rwx file