Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

produce a list of users who's home dir is writable

Status
Not open for further replies.

slikfrequency

Technical User
Oct 28, 2001
1
US
Hopefully somebody can help me with this...


I need to produce a list of users from the /etc/passwd file who's home directories are writable.

Thanks.

 
The first question would be "writable by who?"

This script will list all home directories in /etc/passwd which are writable by the user running the script ...

for i in `awk -F: '{print $6}' /etc/passwd`
do
[ -w $i ] && echo "$i is writable"
done

Obviously the results will be different depending on the user who runs the script.

Greg.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top