- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Changing the password of users
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
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
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
тАО01-18-2011 09:53 AM
тАО01-18-2011 09:53 AM
Changing the password of users
Want to change the more that 1000 users password using simple script or command for changing the same or is there any easiest way to change the password? and how?
Please help me...
Thanks
Sujeet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2011 10:06 AM
тАО01-18-2011 10:06 AM
Re: Changing the password of users
Rgrds,
Rita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2011 10:35 AM
тАО01-18-2011 10:35 AM
Re: Changing the password of users
passwd -e, --expire ,to expire a passwd for
non trusted system
cat /etc/passwd | awk '{print $1}' > /tmp/passwd
for i in `cat /tmp/passwd`
echo $i
do passwd -e $i
or modprpw -E $i
done
such a simple shell script may do the trick !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2011 12:11 PM
тАО01-18-2011 12:11 PM
Re: Changing the password of users
The attached script, mypwd, uses the expect module in perl (which has to be compiled for HPUX). It also assumes direct root access via secure shell/public key authentication.
Just execute it to get a list of options:
./mypwd
Old password must be set
Format: mypwd [ -u ${user} ] -o ${pwd} -n ${new_pwd} -h ${host} [ -f ]
If you specify a '-u' prompt, it'll change the password for that user. It defaults to root. If you specify a -f option, the user will be forced to change their password on their next access attempt.
The scipt works on HPUX, Solaris, and Linux.
So, back to your original question:
for h in $(cat list-o-hosts.txt)
do
for u in $(cat list-o-users.txt)
do
printf "%-8s %s\n" ${h} ${u}
mypwd -u ${u} -h ${h} -o old_passwd -n new_passwd -f
done
done
should do the trick for you.
Doug O'Leary
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2011 04:35 PM
тАО01-18-2011 04:35 PM
Re: Changing the password of users
After four tries covering a few hours, I seem to be unable to upload the script. I'll try again tomorrow; but, can't promise that it'll work any better.
Doug
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-18-2011 04:36 PM
тАО01-18-2011 04:36 PM
Re: Changing the password of users
Good luck.
Doug
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html