PERMISSIONS:
drwx rwx rwx-
directory r-read w-write x-execut-->owner,group,all
octali binary permission
0 000 ---
1 001 --x --> can open and c the file
2 010 -w- --> c an empty dir
3 011 -wx
4 100 r--
5 101 r-x --> can do all without delete
6 110 rw-
7 111 rwx --> can do everything
octali permission: 756 --> rwxr-xrw-
umask 022--> minus permission from general:
777-022=755 but for file start
with 666
stickybit -->remove option from users to delete your file
:default: for dir drwxr-xr-x for file --rw-r--r--
chmod 732 file2 :chmod 777 dir1 :chmod o+r file2
-->give others read
chmod og+x --> add x to other & group
g=x file2 -->group=x only
u-rxw -->takes all from oneself
to dir :x=cd :r-ls
chown user_name file_name --> change ownership
-R --> all libraries inside
groupadd/del groupname
wxrwxrwxr 1 groupname --> 1 means groupname
chgrp group_name file_name/dir_name
groupmod -n newname oldname
-g 10000(10001,10002) sales
-->add group sales with 10000 GID
-n staff employee
--> all members that have been in employee group
will move to stuff group. (/etc/group)
usermod -g sales ron --> add ron to sales group
mkdir -p /depts/sales,hr,web
chgrp sales /depts/sales
chmod g+s /depts/* -->S says what u build inside
this dir will be owned by the group ,
not by the user who build it.
enter as each user to see previledges, write id
--> to see groups.
groups user2 --> user2:admin, deamon...
more /etc/groups -->all groups id
|