-1

I have certain doubts regarding file permissions.I am gonna list them one by one.

By the way I am logged in as root and using Red Hat Linux.

1.When I change the permission for a file to only read eg- chmod 400 file1,I can yet use cat command and add some content to it.Shouldn't I have the access only to read the file?

2.If I give read permission to a folder eg- chmod 400 folder1,I can still add files to it.So what exactly read permission means for a folder or a execute for that instance?

3.If I am logged in as root,do I always have all the permissions ie read,write and execute?Because that's what is happening.I am able to access any file and folder irrespective of the permissions set.

So is there any way to achieve my objectives?

2 Answers2

1

Root has full RW access to the entire filesystem. Also to change the permissions on a directory you should modify the permissions on the . file within that directory.

jesse_b
  • 37,005
0

As root user, you have full access to the system. The read permission on a folder gives you the permission to read the folders content. This is the reason why root user needs to kept private. It has access to the whole system.

There are ways to block files with special permissions, but even those are changeable by root

Chen A.
  • 1,323