- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Looking for a mass update script passwd file.....
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
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
тАО09-14-2009 11:44 AM
тАО09-14-2009 11:44 AM
Also, need to know how to set system so that any new user is setup without password aging set.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2009 12:48 PM
тАО09-14-2009 12:48 PM
SolutionFor the users that you want to turn off password aging, you should be able to do:
# passwd -x -1 name
If you are looking only for user names that begin with an "a" or an "m" followed by all digits, you could do:
# awk -F: '{if ($1~/^[am][0-9]+$/) {print $1}}' /etc/passwd > /tmp/myusers
...if you truly want users with 'a' or 'm' and 4-digits, use:
# awk -F: '{if ($1~/^[am][0-9]{4}$/) {print $1}}' /etc/passwd > /tmp/myusers
Then do:
while read NAME X
do
passwd -x -1 ${NAME}
done < /tmp/myusers
...to disable the aging.
I suggest you examine the '/tmp/myusers' file before you set the aging criteria to make sure it truly contains what you want.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-14-2009 12:54 PM
тАО09-14-2009 12:54 PM
Re: Looking for a mass update script passwd file...remove expiration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 06:50 AM
тАО09-15-2009 06:50 AM
Re: Looking for a mass update script passwd file...remove expiration
1. Was told the -x option is not available using /sbin/passwd. Must invoke /bin/passwd to use options.
2. Received this error when running the command /bin/passwd -x -1 ${NAME}
"Invalid argument to option -x"
Any suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 06:58 AM
тАО09-15-2009 06:58 AM
Re: Looking for a mass update script passwd file...remove expiration
passwd [name]
passwd -r files [-F file] [name]
passwd -r files [-e [shell]] [-gh] [name]
passwd -r files -s [-a]
passwd -r files -s [name]
passwd -r files [-d|-l] [-f] [-n min] [-w warn] [-x max] name
passwd -r nis [-e [shell]] [-gh] [name]
passwd -r nisplus [-e [shell]] [-gh] [-D domain] [name]
passwd -r nisplus -s [-a]
passwd -r nisplus -s [-D domain] [name]
passwd -r nisplus [-l] [-f] [-n min] [-w warn] [-x max] [-D domain]
name
passwd -r dce [-e [shell]] [-gh] [name]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 01:58 PM
тАО09-15-2009 01:58 PM
Re: Looking for a mass update script passwd file...remove expiration
Olivier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 03:12 PM
тАО09-15-2009 03:12 PM
Re: Looking for a mass update script passwd file...remove expiration
Brute force method would be to, in the password field of /etc/passwd, remove everything from the comma to the right, as in:
dum_test:asdasda,asdfa:123:....
would become:
dum_test:asdasda:123:....
which removes all the aging/expiration. could be scripted. could also be deadly if not done right
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-16-2009 04:54 AM
тАО09-16-2009 04:54 AM
Re: Looking for a mass update script passwd file...remove expiration
I have some folks that we work with looking at scripting this to remove the password aging information on those subset of users from our passwd file. This seems to be the only surefire way of doing it.