APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Gawk script to track failed logins (SCO Unix)

© May 2019 Anthony Lawrence

What is this stuff?

If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):

Taken from a newsgroup post

Subject: Re: Need to generate a report on Users that log in to the server
References: <45f17a6b.0301160925.63bd725d@posting.google.com> 
From: spcecdt@deeptht.armory.com (John DuBois)
Date: 17 Jan 2003 03:23:03 GMT

In article <45f17a6b.0301160925.63bd725d@posting.google.com>,
lalaker <prajapatisk@hotmail.com> wrote:
>  I have been given a task to generate a report, something like an
>audit report, for all the user that:
>1. have logged into the server
>2. No. of times failed to login to the server
>3. Accounts that have been locked etc....

Try this:


To run it you will need:


The header mentions a couple of other bits you can pick up for full
functionality, but you won't need them to do this:

$ lastlogin -Ha -rlBk
User      Last Login      #Unsuc L
root      Wed Dec 18 01:45     1 -
spcecdt   Mon Jan 13 03:49     - -

'a' causes the report to list all "real users".
The "Last Login" field will be "-" for those who have never logged in.
#Unsuc is the number of consecutive unsuccessful login attempts.
The L field will be "L" for those whose accounts are locked.

The #Unsuc and L report data come from the TCB database and so are only
available if lastlogin is run by root.

There are many other options:

John DuBois  spcecdt@armory.com  KC6QKZ/AE  https://www.armory.com/~spcecdt/

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> Track failed logins (SCO Unix)

Inexpensive and informative Apple related e-books:

Take Control of Parallels Desktop 12

iOS 8: A Take Control Crash Course

Photos for Mac: A Take Control Crash Course

Take Control of Pages

Take control of Apple TV, Second Edition

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

Anyone who puts a small gloss on a fundamental technology, calls it proprietary, and then tries to keep others from building on it, is a thief. (Tim O'Reilly)

Linux posts

Troubleshooting posts

This post tagged:


Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode

SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)