原文:http://bash.cyberciti.biz/monitoring/find-all-root-access-accounts/
在UNix系统操作系统里,root用户拥有超级管理员的权限,包括单用户模式和多用户模式.它具备了其他普通用户没有的权限。
原理:这个脚本通过搜索/etc/passwd里第三项为0出来。
下面是该shell脚本的源代码:
#!/bin/bash
# Shell script to Finding ALL Superuser Accounts
# Useful to improve system security.
# Copyright (c) 2005 nixCraft
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
grep -v -E "^#" /etc/passwd | awk -F: '$3 == 0 { print $1}' |