- Get link
- X
- Other Apps
© 2022 edX Inc.
- /etc/group
- /etc/passwd
- /etc/group
$ id
Displays info of the user. The logged one if with no argument.
$ useradd -m -c VISUALISED-NAME -s /bin/bash USERNAME
-m creates the home directory
-s select the shell to use. To see the available shells, view the file /etc/shells
$ userdel -r USERNAME
-r to remove the home directory
SUDO privileges
Config file: /etc/sudoers
Config directory, empty by default: /etc/sudoers.d
GROUPS
$ group USERNAME
To list the groups the username belong to
$ groupadd GROUPNAME
$ groupdel GROUPNAME
$ usermode -a -G USERNAME GROUPNAME
To add a user to a group
-a to be sure to append the user to the group list instead replacing the group list with the new addition
-G to have the list group the user belong to after the new addition
FILE OWNERSHIP
$ chown ug+w, o-r NOMEFILE
Adds Write permission to the User and the Group, and removes Read permission to Other
Alternatively:
- 4 if read permission is desired
- 2 if write permission is desired
- 1 if execute permission is desired
$ chmod 165 NOMEFILE
sets only execute for the user (1), read and write for group (4+2=6), and read and execute for others (4+1=5).
changes the user and the group the file currently belong to.
$ chown NEWUSER FILENAME
changes the user the file currently belong to.
changes the group the file currently belong to.
$ chgrp NEWGROUP FILENAME
changes the the group the file currently belong to.
Comments
Post a Comment