We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 704e496 commit 8edc780Copy full SHA for 8edc780
1 file changed
find_bash_users.sh
@@ -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