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

0 votes
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,030 points
59 views

1 answer to this question.

0 votes

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
• 2,960 points

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

5 days ago in Cyber Security & Ethical Hacking by Anupam
• 3,030 points
18 views
0 votes
0 answers
0 votes
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
• 2,960 points
73 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
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