Tuesday, 7 June 2011

Diagnose and correct file permission problems

I understand what this objective tries to achieve but it is a bit tricky to prepare for it.
The following commands will be your friends:
  1. ls -l directorypath
  2. getfacl filename
The first simply lists all the files in a directory and should be your first port of call when you get a permission denied error. Like below, where I'm trying to change to the /root/ directory logged in as user noroot.
[noroot@Subversion /]$ cd /root/
bash: cd: /root/: Permission denied
If you have enabled ACLs for the file system, then the issue might be related to the acl, so you could have a look with the second command.

This is one of them objectives, where you could do with a friend who changes permissions and performs a few naughty actions on your system, e.g. stops a few services, changes SELinux contexts, etc..  and you then have to figure out how to get everything back in working order.

No comments:

Post a Comment