- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- trusted 11.11 user that have not logged in script
Operating System - HP-UX
1753963
Members
7327
Online
108811
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2010 09:10 AM
01-04-2010 09:10 AM
I am trying to automate security checks.
We require passwd's to be changed every 90 days, we do need to delete users from system if they have not logged in after 180 days.
I am looking for a script that can parse the server and pull out users that have not logged in in 180 days.
We are running hpux 11.11 in trusted mode.
root@snap # cat security
ABORT_LOGIN_ON_MISSING_HOMEDIR=1
AUTH_MAXTRIES=5
PASSWORD_MAXDAYS=91
PASSWORD_MINDAYS=7
PASSWORD_WARNDAYS=28
MIN_PASSORD_LENGTH=8
PASSWORD_HISTORY_DEPTH=3
NUMBER_OF_LOGINS_ALLOWED=3
UMASK=077
We require passwd's to be changed every 90 days, we do need to delete users from system if they have not logged in after 180 days.
I am looking for a script that can parse the server and pull out users that have not logged in in 180 days.
We are running hpux 11.11 in trusted mode.
root@snap # cat security
ABORT_LOGIN_ON_MISSING_HOMEDIR=1
AUTH_MAXTRIES=5
PASSWORD_MAXDAYS=91
PASSWORD_MINDAYS=7
PASSWORD_WARNDAYS=28
MIN_PASSORD_LENGTH=8
PASSWORD_HISTORY_DEPTH=3
NUMBER_OF_LOGINS_ALLOWED=3
UMASK=077
Solved! Go to Solution.
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2010 12:34 PM
01-04-2010 12:34 PM
Solution
This script will give you the date and time a user last logged in. We call it from another script that feeds the user accounts to it. I am assuming you can play with this script do do what you need. Key factor is the is the u_succhg line in the tcb file.
#!/usr/bin/sh
PATH=/usr/bin:/opt/perl/bin
EPOCH=false
LOGINNAME=""
BADPARAM=true
if [ $# -eq 1 ]; then
LOGINNAME="$1"
BADPARAM=false
elif [ $# -eq 2 ]; then
if [ "$1" = "-e" ]; then
EPOCH=true
LOGINNAME="$2"
BADPARAM=false
fi
fi
if [ $BADPARAM = true ]; then
echo "Usage: $0 [-e] username"
exit 1
fi
TCBFILE="/tcb/files/auth/?/$LOGINNAME"
if [ ! -f $TCBFILE ]; then
echo "Unknown user: $LOGINNAME"
exit 1
fi
U_SUCLOG=$(sed -n '/u_suclog#/ s/^.*u_suclog#\([0-9]*\):.*$/\1/p' $TCBFILE)
if [ $EPOCH = true ]; then
echo $U_SUCLOG
else
perl -MPOSIX -e 'print strftime "%m/%d/%Y %H:%M:%S\n", localtime '$U_SUCLOG
fi
#!/usr/bin/sh
PATH=/usr/bin:/opt/perl/bin
EPOCH=false
LOGINNAME=""
BADPARAM=true
if [ $# -eq 1 ]; then
LOGINNAME="$1"
BADPARAM=false
elif [ $# -eq 2 ]; then
if [ "$1" = "-e" ]; then
EPOCH=true
LOGINNAME="$2"
BADPARAM=false
fi
fi
if [ $BADPARAM = true ]; then
echo "Usage: $0 [-e] username"
exit 1
fi
TCBFILE="/tcb/files/auth/?/$LOGINNAME"
if [ ! -f $TCBFILE ]; then
echo "Unknown user: $LOGINNAME"
exit 1
fi
U_SUCLOG=$(sed -n '/u_suclog#/ s/^.*u_suclog#\([0-9]*\):.*$/\1/p' $TCBFILE)
if [ $EPOCH = true ]; then
echo $U_SUCLOG
else
perl -MPOSIX -e 'print strftime "%m/%d/%Y %H:%M:%S\n", localtime '$U_SUCLOG
fi
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP