These are some useful commands for monitoring and analyzing the security of UNIX systems. If security needs to be reviewed periodically, a series of commands could be put into a script and run automatically with the output sent directly to the system administrators to ensure the reports get reviewed.

Check for root Users
awk -F: '{if ($3 == 0) print $1}' /etc/passwd

This command searches the /etc/passwd file and lists all users with root (UID 0) authority.

Failed Logins
who -s /etc/security/failedlogin | tail -20

This command lists the last 20 failed logins.

Last updated Wednesday October 11, 2006


Printer-friendly PDF* format:

Commands

How To Guides for UNIX System Security

This Section

You are currently viewing this page in XHTML 1 Style Sheet* format (* see Clicklets for more infomation). This document is also available in XHTML 1*XML*HTML 4*HTML 5 Style Sheet*HTML 5 XML*HTML 5 non-XML* XHTML 2* XHTML Mobile* WML Mobile* and printer-friendly PDF* formats. This is accomplished with Single Source Publishing, a content management system that uses templates in XSLT style sheets provided by XML Styles .com to transform the source content for various content delivery channels. There is also RDF* metadata that describes the content of this document.