Since Linux was designed to be a multiuser operating system, every file has file permissions and ownership associated with it. This is to prevent one user from overwriting the files of another (either intentionally or unintentionally). The root user can (usually) access every file in the system.
Here is a quick review of basic file system permissions. For this example, it is assumed umask
is set to 0022
. Run umask
to make sure.
Observe the following ls -la
listing of my backup script b:
-rwxr-xr-x. 1 guest1 root 559 Mar 28 12:43 b
Starting from the left, the first position indicates what kind of file this is. A -
, as shown, means this is a regular file. A d
there would mean a directory, and an l
would indicate it’s a link. The next three sets of three letters are the file permissions and can be referred to in either symbolic or numeric mode. We are going to use numeric (octal) mode.
The first three sets, rwx
, are the settings for the owner (guest1
...