- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: expire user accounts
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
Discussions
Discussions
Discussions
Forums
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
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
тАО05-03-2004 07:35 AM
тАО05-03-2004 07:35 AM
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 07:39 AM
тАО05-03-2004 07:39 AM
Re: expire user accounts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 07:41 AM
тАО05-03-2004 07:41 AM
Re: expire user accounts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 07:42 AM
тАО05-03-2004 07:42 AM
Solutiontypeset -i MIN=100
typeset -i MAX=200
typeset -i UID
UID=$MIN
while [[ $UID -le MAX ]]
do
USR=$(grep ":$UID:" /etc/passwd | awk -F: '{print $1}')
/usr/lbin/modprpw -e $USR
(( UID=UID+1 ))
done
I am sure people will come up with a better way of doing this :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 07:44 AM
тАО05-03-2004 07:44 AM
Re: expire user accounts
typeset -i10 LO_UID=100
typeset -i10 HI_UID=200
awk -F ":" '{print $1,$3}' ${INFILE} | while read USER UID
do
if [[ ${UID} -ge ${LO_UID} && ${UID} -le ${HI_UID} ]]
then
echo "User: ${USER} UID: ${UID}"
passwd -f ${USER}
fi
done
I would comment out the passwd -f command until you get the command like you want it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 07:51 AM
тАО05-03-2004 07:51 AM
Re: expire user accounts
example:
passwd -f mstrong
would force me to change my passwd on the next login.
you could write a loop around that command for the users you want to change.
UID=100
while [ $UID -lt 200 ]
do
UNAME=`grep $UID /etc/passwd | awk -F: '{print $1}'`
UID=$(($UID+1))
passwd -f $UNAME
done
something like that should work.
I didn't test this but that should get ya started.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 07:54 AM
тАО05-03-2004 07:54 AM
Re: expire user accounts
The others are clearly better.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 07:56 AM
тАО05-03-2004 07:56 AM
Re: expire user accounts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 07:58 AM
тАО05-03-2004 07:58 AM
Re: expire user accounts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 12:26 PM
тАО05-03-2004 12:26 PM
Re: expire user accounts
/usr/lbin/getprpw Username
The binary number at the end of the string shows the account is locked if it is anything but all zeros and if you reference those numbers against the command's man page you can even see the reason the account was locked. Also by chance if you ever want to unlock those accounts try
/usr/lbin/modprpw -k Username
Have Fun!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2004 12:34 PM
тАО05-03-2004 12:34 PM