Monday 18 June 2012

listing users from /etc/passwd

This will grep the /etc/passwd file and remove lines with the usual default accounts. It should outlook a list of real users. You need to leave bin in there otherwise real users will be removed because they have /bin/bash in their shell path

grep -v "daemon\|adm\|lp\|sync\|shutdown\|halt\|mail\|news\|uucp\|operator\|games\|gopher\|ftp\|nobody\|rpm\|dbus\|mailnull\|smmsp\|nscd\|rpc\|ntp\|vcsa\|rpcuser\|nfsnobody\|sshd\|pcap\|haldaemon\|xfs\|mysql\|apache\|jboss\|munin\|distcache\|avahi\|ntp\|avahi-autoipd" /etc/passwd

No comments:

Post a Comment