aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIbrahim Mkusa <ibrahimmkusa@gmail.com>2024-08-12 10:44:09 -0400
committerIbrahim Mkusa <ibrahimmkusa@gmail.com>2024-08-12 10:44:09 -0400
commit95bc5e584f8d7225b847630c2e9ad8e665e33ec4 (patch)
tree7aa65d25469bd40998b684904f02acbda2708c3a
parent19b68bb3cd69e6e7d238bc3db5e764ea626a7686 (diff)
workign with set-uid, set-gid and the sticky bit
-rw-r--r--files_directories/chmod.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/files_directories/chmod.md b/files_directories/chmod.md
new file mode 100644
index 0000000..abddd7e
--- /dev/null
+++ b/files_directories/chmod.md
@@ -0,0 +1,18 @@
+We are aware of permissions for the owner(u), group(g), and other(o), however
+the set-uid, set-gid and sticky bit are other special permissions.
+
+| setting | description |
+| set-uid | setting uid on an executable file allows the file to be executed
+with the original owners permissions.e.g.A script owned by root is executed
+with root priviledges when run by an ordinary user|
+|set-gid | in files, set-gid files are executed with the group's permissions,
+while in directories all new files belong to the group by default|
+|sticky bit | In a shared environment, allows deletion only by the owner of the
+file|
+
+```
+chmod u+s file # sets uid, use - to unset
+chmod g+s directory # sets gid
+chmod +t # sets the sticky bit
+chmod 1770 directory # sets sticky bit, grants rwx permissions for u and g
+```