Commands to know
- There are 2 types of users:
- Normal users - denoted by $ in the terminal
- Root user - denoted by # in the terminal
Add users using:
kali >useradd - adds new users BUT gives shell as sh instead bash , doesnt prompt for details/info about the user, doesn't create a home directory for the new user
kali >adduser - DOES ALL OF THE ABOVE for a new user
List users using:
kali >cat /etc/passwd- lists users, their unique id, group id(gid), home directory, shell
kali >cat /etc/shadow-
Modify users using:
kali >usermod ironman --shell /bin/bash- changes the users' shell to bash
kali >usermod -l tonystark ironman- changes user from ironman to tonystark
Switch users using:
kali >su - ironman
Delete users using:
kali >userdel evans-
kali >deluser evans-
Create/add group using:
kali >groupadd theavengers-
List groups using:
kali >cat /etc/group-
kali >groups- lists what groups the current user is in
Add user to a group using:
kali >usermod -aG theavengers evans- appends the user evans to the group theavengers
Removes user from a group using:
kali >gpasswd -d evans theavengers-
Delete a group using:
kali >groupdel theavengers
rm -rf/* (force remove of a directory and all contents in it recursively)
Top comments (0)