1825747 Members
2403 Online
109687 Solutions
New Discussion

Re: HPUX accounts

 
SOLVED
Go to solution
OFC_EDM
Respected Contributor

HPUX accounts

Is there a way to check how long an HP-UX account has been active?

I want to disable accounts not active for 90 days.

Regards
The Devil is in the detail.
4 REPLIES 4
Pete Randall
Outstanding Contributor

Re: HPUX accounts

There are several commands you could try:

finger
last

and others, I'm sure.


Pete

Pete
Patrick Wallek
Honored Contributor

Re: HPUX accounts

Is your system trusted? If so, you can have HP-UX do this automatically. You can set the maximum inactive time for an account in days. After that number of days the account will be disabled.

If the system is trusted you can use:

# /usr/lbin/getprpw -m slogint

to see the last successful login time for a user.
rmueller58
Valued Contributor

Re: HPUX accounts

#!/bin/sh
cat >/tmp/lastlogin.log
for uuid in `cat /etc/passwd | awk -F: '{print $1}' `
do
export lti=`/usr/lbin/getprpw -m slogint $uuid`
echo $uuid $lti >> /tmp/lastlogin.log
done

rmueller58
Valued Contributor
Solution

Re: HPUX accounts

Ignore previous post.

This script will write Last Successful out to a file for review.


#!/bin/sh
touch /tmp/lastlogin.log
for uuid in `cat /etc/passwd | awk -F: '{print $1}' `
do
export lti=`/usr/lbin/getprpw -m slogint $uuid`
echo $uuid $lti >> /tmp/lastlogin.log
done