- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Reset password of 50 users trusted system
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
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
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
06-18-2012 12:39 AM
06-18-2012 12:39 AM
Hi ,
We have hpux 11iv2 , trusted system , i need to reset password of 50 users , i.e same passwd for all 50 users.
Also it must force them to change their passwords at first login .
Do we have any script for this ??
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2012 03:48 PM - edited 06-21-2012 01:57 PM
06-18-2012 03:48 PM - edited 06-21-2012 01:57 PM
Re: Reset password of 50 users trusted system
Hi Zxcv,
You can try to do the above task with a for loop,
1. get the 50 user list from the password file and create a file that will have only the users name: (ex: 50_user_list.txt )
#---------------- Start Script -------
# Script for changing 50 users password , with same password.
for user in `cat 50_user_list.txt`
do
passwd $user
done
# Forcing passowrd to change at next logon:
for user in `cat 50_user_list.txt`
do
passwd -f $user
done
echo " Done.."
#---------------------------------- End Script ---------------------------
-While executing this script , writedown the password in the putty screen and select it with the mouse , so that it will be in the buffer, by pressing the right click it will be pasted when it will ask for a password.
-If you select the password from text screen with a carriage return, you dont even need to press enter , just press 50 times right click when prompted for password.
-
Hth
- Tags:
- passwd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2012 04:02 PM
06-18-2012 04:02 PM
Re: Reset password of 50 users trusted system
To use a for-loop reading from a file, in a real shell you can do:
for user in $(< 50_user_list.txt); do
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2012 10:08 PM
06-18-2012 10:08 PM
Re: Reset password of 50 users trusted system
Hi guys,
Is there any option by means of which i can enter this hash value ( password ) in that script and i dont have to right click 50 times ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2012 04:55 AM
06-19-2012 04:55 AM
SolutionFor 11iv2 and older, this is undocumented by HP, but still a widely known procedure. (It was listed in HP-UX FAQ documents available in Internet more than 10 years ago.)
Find the hash value. For example, set the desired password to one user on one system, then read the hash value from the user's password file (/tcb/files/auth/<first letter of username>/<username>)
Then replace this line in RAJD1's script:
passwd $user
with this line:
/usr/sam/lbin/usermod.sam -p "<hashvalue>" $user
Replace the string <hashvalue> with the actual hash value.
- Tags:
- usermod.sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2012 03:47 AM
06-20-2012 03:47 AM
Re: Reset password of 50 users trusted system
Thnaks Matti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2012 10:10 AM
06-20-2012 10:10 AM
Re: Reset password of 50 users trusted system
Correction: <in my first post> in the script
for user in 50_user_list.txt -->
--> should be --> for user in `cat 50_user_list.txt`
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2012 03:51 PM
06-20-2012 03:51 PM
Re: Reset password of 50 users trusted system
>Correction: <in my first post> in the script
You can use the Post's Options > Edit Reply to change your post.
Also better to remove evil cat, as showed above. :-)
- Tags:
- evil cat