menu

linux-system-administration

Haven’t posted anything for a long time. Let the notes go on.

In this post, I’d collect all (if possible) necessary knowledge and information about linux account and permission administration.

Understanding Linux File Permissions

In linux system, granting proper permissions to files and directories is crucial. This part is an overview of assigning and modifying permissions with examples.

» Understanding Linux File Permission

1. Basic File Permission

Each file and directory has 3 user based permission groups:

  • owner - the permissions apply only the owner of the file or directory, will not affect actions of other users;

  • group - the permissions applys only to the group that has been assigned to the file or directory, will not affect actions of other users;

  • all users - the permissions apply to all other users on the system, this is the permission group that you want to watch the most.

2. Permission Types

Each file or directory has 3 basic permission types:

  • read - permission refers to a user’s capability to read the content of the file;
  • write - permission refers to a user’s capability to write or modify a file or directory;
  • execute - permission affects a user’s capability to execute a file or view the contents of a directory.

You can simply using ls -l to view the permissions of the files and directories in the working directory. The output is like:

drwxrwxr-x+ 28 root  admin   896 Oct  9 22:21 Applications
drwxr-xr-x  68 root  wheel  2176 Oct 10 10:31 Library
drwxr-xr-x@  8 root  wheel   256 Sep 30 04:23 System
drwxr-xr-x   5 root  admin   160 Sep 30 04:22 Users
drwxr-xr-x   3 root  wheel    96 Oct 24 21:22 Volumes
-rw-r--r--@  1 kefengzhu  staff   1160859 Jan 13  2019 1404.7828.pdf

User Administration

» Tutorial: adduser, usermod, userdel



KF

Comments