On Sat, 17 Jan 2009 10:50:31 -0800
Grant <emailgr...@gmail.com> wrote:

> Can anyone tell me how to find out which users on a system have a
> login shell (e.g. not /bin/nologin)?

echo 'Unavailable user accounts:'; for usr in `cat /etc/passwd`; do 
usr=${usr%%:*}; exit | su "$usr" >/dev/null 2>&1 || echo -n "$usr "; done

-- 
Mike Kazantsev // fraggod.net

Attachment: signature.asc
Description: PGP signature

Reply via email to