written 8.4 years ago by | modified 2.8 years ago by |
Subject: System Web Security
Topic: Operating System Security
Difficulty: Medium
written 8.4 years ago by | modified 2.8 years ago by |
Subject: System Web Security
Topic: Operating System Security
Difficulty: Medium
written 8.4 years ago by | • modified 8.4 years ago |
File Security Model
You can check what groups a user belongs to with the groups command.
\$ groupstclark
tclark : authors users
The groups command is called with one argument, the username you want to investigate.
Basic File Permissions
Permission Groups
Each file and directory has three user based permission groups:
All users - The All Users permissions apply to all other users on the system, this is the permission group that you want to watch the most.
Permission Types
Each file or directory has three basic permission types:
Read - The Read permission refers to a user's capability to read the contents of the file.
Execute - The Execute permission affects a user's capability to execute a file or view the contents of a directory.
Viewing the Permissions
You can view the permissions by checking the file or directory permissions in your favorite GUI File Manager (which I will not cover here) or by reviewing the output of the $"ls -l"$ command while in the terminal and while working in the directory which contains the file or folder.
The permission in the command line is displayed as: _rwxrwxrwx 1 owner: group
User rights/Permissions
1.1 The first character that I marked with an underscore is the special permission flag that can vary.
1.2 The following set of three characters (rwx) is for the owner permissions.
1.3 The second set of three characters (rwx) is for the Group permissions.
1.4 The third set of three characters (rwx) is for the All Users permissions.
Following that grouping since the integer/number displays the number of hardlinks to the file.
The last piece is the Owner and Group assignment formatted as Owner: Group.
Modifying the Permissions
When in the command line, the permissions are edited by using the command chmod. You can assign the permissions explicitly or by using a binary reference as described below.
Explicitly Defining Permissions
To explicitly define permissions you will need to reference the Permission Group and Permission Types.
The Permission Groups used are:
The potential Assignment Operators are + (plus) and - (minus); these are used to tell the system whether to add or remove the specific permissions.
The Permission Types that are used are: