What Bash commands can I use to enumerate users on a Linux system during a security audit

+1 vote
I’m performing a security audit on a Linux system and one of the tasks is to enumerate all users and identify any potential issues with user permissions or accounts that may pose a security risk. I know the /etc/passwd file contains user information, but I’m not sure if there are other Bash commands that can help me gather more detailed information, such as user groups, last login times, or password settings.

What Bash commands can I use to efficiently enumerate users and check for weak spots in user account security? Any additional tips on what to look for in user enumeration would also be appreciated.
Oct 17 in Cyber Security & Ethical Hacking by Anupam
• 3,890 points
72 views

1 answer to this question.

+1 vote

At the time of a security audit, we can use a combination of Bash commands to enumerate users and gather details about their settings.

1. To list all the users

cat /etc/passwd

2. To check for users with login shells

awk -F':' '$7 ~ /\/bin\/bash/ {print $1}' /etc/passwd

3. To list user groups

cut -d: -f1 /etc/group

4. To show last login of each user

lastlog

5. To check the password policies

sudo cat /etc/shadow

All these files can be inspected while performing a security audit to identify any user accounts with weak or no passwords, interactive users, and misconfigurations.

answered Oct 22 by CaLLmeDaDDY
• 3,320 points
Great list of commands! This will be really useful for auditing Linux systems. Thanks for the clear and straightforward explanation!

Related Questions In Cyber Security & Ethical Hacking

0 votes
0 answers
0 votes
0 answers

What LDAP query can be used to enumerate all users in a directory?

I’m trying to list all users within ...READ MORE

Nov 6 in Cyber Security & Ethical Hacking by Anupam
• 3,890 points
27 views
0 votes
0 answers
+1 vote
1 answer

How do you decrypt a ROT13 encryption on the terminal itself?

Yes, it's possible to decrypt a ROT13 ...READ MORE

answered Oct 17 in Cyber Security & Ethical Hacking by CaLLmeDaDDY
• 3,320 points
97 views
+1 vote
1 answer
+1 vote
1 answer
+1 vote
1 answer

What is the best way to use APIs for DNS footprinting in Node.js?

There are several APIs that can help ...READ MORE

answered Oct 17 in Cyber Security & Ethical Hacking by CaLLmeDaDDY
• 3,320 points
122 views
0 votes
1 answer
+1 vote
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP