File permission basics:

File/Dir can have 3 access levels : owner, group and others
File/dir can have 3 types of permissions: r(ead), w(rite), e(x)ecute

Now directory cant be executed do it has special meaning. When a directory has execute permission it means the user can "cd" to it or look at its content.

Note: there are other permission and other details which you can read in details online or using man
-bash-3.2$ ls -d root
drwxr-xr-x 25 root root 4096 Feb 29 13:34 root
this means owner = read/write/execute
group = read and execute
others = read and execute
-bash-3.2$ ls -l /root/deleteme
-rwxrwxrwx 1 root root 0 Feb 29 13:34 /root/deleteme

this is called the evil permission it means anyone can read/write/execute this file.
I log in as normal user say User1 and I run
rm /root/deleteme I get: rm: cannot remove `/root/deleteme': Permission denied But intrestingly, User1 can edit the file deleteme and delete the text in the file!!


So what is happening is you have given r/w permission to everyone. That means file can be read or edited by everyone.

But as files are content of directory and you dont have write permission on the directory. You cant delete the file itself.

rgds
vivek

--
http://www.twitter.com/vivpuri | http://www.machint.com


_______________________________________________
Ilugd mailing list
Ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd

Reply via email to