User management in Linux
2016-12-10Add, delete users and groups
addgroup groupname- creates new groupadduser username- creates new userusermod -a -G groupname1,groupane2 username- adds existing user to existing groupdeluser username- deletes usergroups username- list all groups for user
chmod
| Mode | Name |
|---|---|
r |
read |
w |
write |
x |
execute |
X |
special execute |
s |
setuid/gid |
t |
sticky |
| Reference | Class |
|---|---|
u |
owner |
g |
group |
o |
others |
a |
all |
| Operator | Description |
|---|---|
+ |
adds the specified modes to the specified classes |
- |
removes the specified modes from the specified classes |
= |
the modes specified are to be made the exact modes for the specified classes |
Files permissions
chown -R username:groupname path- changes file/directory owner and its groupchown -R :groupname path- changes file/directory groupchmod -R a-x+X path- remove the execute permission on all files in a directory tree, while allowing for directory browsingchmod -R a+X directory- allowing for directory browsing for all