DEV Community

Msaghu
Msaghu

Posted on

1 1

KALI LINUX: Common Commands that you should know : PART 2

Commands to know

  1. PART 1
  2. PART 2
  • 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)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay