- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Any command to identify disabled unixids
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
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
Discussion Boards
Community
Resources
Forums
Blogs
- 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
10-21-2005 09:41 AM
10-21-2005 09:41 AM
Is there a unixid command I can issue to list the disabled unixids.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2005 10:33 AM
10-21-2005 10:33 AM
Solutionfor ID in `cat /etc/passwd | cut -d: -f1`
do
STATUS=$(/usr/lbin/getprpw -l -r -m lockout $ID)
RC=$?
if [ $RC -eq 0 ]
then
case "$STATUS" in
0000000 ) print "Account Active." ;;
1?????? ) print "LOCKED: Past password lifetime." ;;
?1????? ) print "LOCKED: Past inactive time." ;;
??1???? ) print "LOCKED: Past account lifetime." ;;
???1??? ) print "LOCKED: too many failed logins." ;;
????1?? ) print "LOCKED: passwd required." ;;
?????1? ) print "LOCKED: Locked by Admin." ;;
??????1 ) print "LOCKED: Password is a *." ;;
* ) print "Unknown status code returned.";exit 10;;
esac
else
echo "There is a problem running getprpw command."; exit 11
fi
done
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2005 07:06 AM
10-24-2005 07:06 AM
Re: Any command to identify disabled unixids
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2005 08:00 AM
10-24-2005 08:00 AM
Re: Any command to identify disabled unixids
You may be most interested in the 'logins -x'
Display extended information about selected users. This extended
information includes home directory, login shell and password
aging data, each on its own line. Password information consists
of password status (PS for valid password, LK for locked and NP
for no password) and, if a password is present, date of last
change, required number of days between changes, and number of
days allowed between changes. In the case of non-trusted
systems, the date of last change will be the latest Thursday
since the change.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2005 09:08 AM
10-24-2005 09:08 AM
Re: Any command to identify disabled unixids
for ID in `cat /etc/passwd | cut -d: -f1`
do
logins -x -l ${ID}|grep -q LK
r=$?
if [ $r -eq 0 ]
then
echo "Account ${ID} is LOCKED"
else
echo "Account ${ID} is NOT locked"
fi
done
HTH
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2005 05:33 AM
10-28-2005 05:33 AM
Re: Any command to identify disabled unixids
We have a sysadmin server that all the other unix servers trust. We have a script on the sysadmin server that does a remsh/ssh to all the other servers to gather information. For example "SYSinfo.sh cpb" will list the latest Customized-Patch-Bundle on all the servers. "SYSinfo.sh bdfopt" will give a bdf of /opt for everyone. we wanted a command to check if the root id was locked on any servers, which happens every month when the root pw is changed.
The difficulty arose because you can't use remsh/ssh to run a command on a server where root is locked/disabled.
The easy solution was to just do a "remsh/ssh date" to all the servers. Check &2 for the command, if it's "Account is disabled or expired", email the SysAdmins telling them to get on the gsp-console and unlock root.
I keep thinking there's a more elegant solution but this is working for us.
But I'm taking some of the above suggestions for another script to run on each server and list all the user accounts which are locked.
Thanks all for the help/ideas/suggestions.