- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- setting users passwords in batch
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
12-11-2003 11:30 PM
12-11-2003 11:30 PM
How can i set, in batch, the password of a user ? (aprox. 300 accounts)
Probably there will be a existing thread about this subject but i can't find it.
Can somone help ?
Kl@@s
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2003 11:35 PM
12-11-2003 11:35 PM
SolutionHere's one:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=25941
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2003 11:36 PM
12-11-2003 11:36 PM
Re: setting users passwords in batch
Im not 100% sure but I think you cant set password in batchmode. What we are doing is we use sed to modify the /etc/passwd File with pregenerated hashes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2003 11:38 PM
12-11-2003 11:38 PM
Re: setting users passwords in batch
I assume in the file list.txt there are entry in the form:
user1 password1
user2 password2
and so on..
########SCRIPT##############
while read USER PASSWORD
do
passwd $USER << EOF
$PASSWORD
$PASSWORD
EOF
done < list.txt
########END###################
HTH,
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2003 11:38 PM
12-11-2003 11:38 PM
Re: setting users passwords in batch
Here's a bunch of threads on the topic:
http://us-support3.external.hp.com/emse/bin/doc.pl/sid=8ea14c8c0f09f61443?todo=search&searchtext=password+change+script&x=37&y=13&searchcriteria=allwords&searchtype=SEARCH_FORUMS&searchcategory=ALL&rn=25&presort=rank
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2003 11:40 PM
12-11-2003 11:40 PM
Re: setting users passwords in batch
I dont have my script to hand but i can explain how i did this.
I changed the pasword on account ourdefault then using grep took the encrypted password from the passwd file then using sed and awk applied it to a new passwd.new file and copied old password file to saved one and new one became real.
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2003 11:46 PM
12-11-2003 11:46 PM
Re: setting users passwords in batch
As crude method you can do as follows.
I assume you have list of these users in a file.
for i in `cat file`
do
/usr/sam/lbin/usermod.sam -p "" $i
done
-p option on usermod is password. In above case it will set null password for all users.
Now you can modify this script further.
for i in `cat file`
do
/usr/sam/lbin/usermod.sam -p "`echo $i|makekey" $i
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2003 12:41 AM
12-12-2003 12:41 AM
Re: setting users passwords in batch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2003 12:45 AM
12-12-2003 12:45 AM
Re: setting users passwords in batch
john.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2003 12:54 AM
12-12-2003 12:54 AM
Re: setting users passwords in batch
One lesson learned allready . . .
If you modify accounts by batch give the system time to change the password file.
If not, you suddenly miss userid's !!!!
Gone, zip , away !!! :`-(
So use sleep after every command.
And keep a copy of the password file . . .
Yes yes yes i did that !!!!
By the way the last option, using sam to change the password, worked fine for me.
Kl@@s
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2003 12:58 AM
12-12-2003 12:58 AM
Re: setting users passwords in batch
HERE document scripting does not work with passwd.
Tried it and failed . . .
Kl@@s