Skip to content

Commit 8edc780

Browse files
Add bash script to find users with /bin/bash
1 parent 704e496 commit 8edc780

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

find_bash_users.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
# Script to find users with /bin/bash shell from a file named 'password'
3+
4+
# First, create a sample password file if it doesn't exist (copy from /etc/passwd)
5+
if [ ! -f "password" ]; then
6+
echo "Creating sample password file from /etc/passwd..."
7+
sudo cp /etc/passwd password
8+
fi
9+
10+
echo "Users with /bin/bash shell:"
11+
grep '/bin/bash$' password | cut -d: -f1

0 commit comments

Comments
 (0)