mirror of
https://github.com/aquasecurity/linux-bench.git
synced 2025-02-23 06:35:33 +01:00
13 lines
No EOL
391 B
Bash
13 lines
No EOL
391 B
Bash
#!/bin/bash
|
|
|
|
grep -E -v '^(root|halt|sync|shutdown)' /etc/passwd | awk -F: '($7 !=
|
|
"'"$(which nologin)"'" && $7 != "/bin/false") { print $1 " " $6 }' | while
|
|
read user dir; do
|
|
if [ ! -d "$dir" ]; then
|
|
echo "The home directory ($dir) of user $user does not exist."
|
|
else
|
|
if [ ! -h "$dir/.netrc" -a -f "$dir/.netrc" ]; then
|
|
echo ".netrc file $dir/.netrc exists"
|
|
fi
|
|
fi
|
|
done |