- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Multiple user password change
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
09-30-2003 08:17 PM
09-30-2003 08:17 PM
Multiple user password change
I'd be the first to admit that I'm not a good scripter, in fact I try an get by with the least script writing possible (I grew up on mainframes, and UNIX scripting has just never clicked with me).
Anyway: I often need to change multiple user passwords at a time, sometimes up to 30. These are usually for classrooms, testing, sandbox groups, etc, so we usually set the password to a generic and let the user change it again later.
Do any of you have a nifty way of feeding PASSWD a password?
I would normally have to do a "for x in a b c d ....do..passwd $x...done" and then go the whole laborious hog of picking a password type (Trusted converted server), then a password and confirmation.
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 09:09 PM
09-30-2003 09:09 PM
Re: Multiple user password change
if you want to set a password for a group of people you will need to combine "passwd" with "expect".
But as you mentioned classrooms, testing, sandbox, ... maybe you can just remove the passwords?
passwd -d -f username : to delete password and force a new one at next logon.
passwd -l username : to lock accounts when not needed.
good luck,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 09:12 PM
09-30-2003 09:12 PM
Re: Multiple user password change
I'll play with the the -d -l options, maybe that's what could work in most cases.
Explain the "expect" thing to me?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 09:18 PM
09-30-2003 09:18 PM
Re: Multiple user password change
If you browse around (ITRC, google) you will probably find some examples.
best regards,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 09:24 PM
09-30-2003 09:24 PM
Re: Multiple user password change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 09:27 PM
09-30-2003 09:27 PM
Re: Multiple user password change
BTW if the users are named more or less equal, you can shorten the script a lot, and don't have to bother if users are added.
instead of "for x in a b c d e ........"
for x in $(grep "Classroom Student" /etc/passwd |cud -d":" -f1)
do
...
done
regards,
Thierry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 11:23 PM
09-30-2003 11:23 PM
Re: Multiple user password change
name:passwdstring:gid:uid
name2:passwdstring:gid:uid
name3:passwdstring:gid:uid
etc.
As long as the passwd string is the same. then the passwd will be too. You can just paste this onto the end of /etc/passwd whenever you need 20 temporary users or so. If they are temp users then its ok to give them logins like login1, login2 etc. And there's no real reason why they can't be re-used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 11:29 PM
09-30-2003 11:29 PM
Re: Multiple user password change
That doesn't work very well once the server is trusted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 11:46 PM
09-30-2003 11:46 PM
Re: Multiple user password change
In my case key was that all the users had login names as 'all caps', but you could change it to whatever will work for you...
Hope it helps,
Rgrds,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2003 11:54 PM
09-30-2003 11:54 PM
Re: Multiple user password change
Just in case here's the script again:
#!/bin/sh
#
#
########################
# This script is to mass change
# passwords and set account
# to force user to change p/w
# at next login..
# Written by Sven Liessem HP.com
# and Rita Workman
# May, 2002
#
# YOU MUST FIRST GET THE
# ENCRYPTED PASSWORD VALUE
# FOR NEWPASS VALUE
#
#
# I run this script and output
# to another file & then
# lay file over /etc/passwd
# ex: ./scripts/passwd_mass_chg.sh > /etc/passwd.new
#########################
newpass="d.Cm86XRE3oH6,3..."
cat /etc/passwd | while read line
do
echo $line | grep -q '^[A-Z][A-Z]*:[^:]*,3\.\.\.:'
if [ $? -eq 0 ]
then
usrname=`echo $line | cut -d: -f1`
therest=`echo $line | cut -d: -f 3-`
echo $usrname:$newpass:$therest
else
echo $line
fi
done
Rgrds,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2003 04:10 AM
10-02-2003 04:10 AM
Re: Multiple user password change
http://www.cs.kuleuven.ac.be/~pelov/pam/Authen/PAM/FAQ.html
Jun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2004 11:19 PM
01-13-2004 11:19 PM
Re: Multiple user password change
after looking at expect, and struggling with finding the right version of TCL/TK, we finally just opted for forcing a disable/re-entry of the specified users' password using "passwd -f".
Thanks to whomever suggested this as an alternative.