Parent Directory | Revision Log
Script to find interactive accounts
1 | #!/bin/bash |
2 | |
3 | for entry in $(getent passwd | cut -d: -f1,7 | grep -v -E "^(sash)?root:") |
4 | do |
5 | shell=$(echo $entry | cut -d: -f2) |
6 | if grep -q $shell /etc/shells; then |
7 | user=$(echo $entry | cut -d: -f1) |
8 | if [ $UID -eq 0 ]; then |
9 | case "$(getent shadow $user | cut -d: -f2)" in |
10 | "x"|"*"|"!"|"!"*) |
11 | ;; |
12 | |
13 | *) |
14 | echo $entry |
15 | ;; |
16 | esac |
17 | else |
18 | echo $entry |
19 | fi |
20 | fi |
21 | done |
Name | Value |
---|---|
svn:executable | * |
ViewVC Help | |
Powered by ViewVC 1.1.22 |