- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: change passwd using script
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
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
тАО05-11-2011 01:57 AM
тАО05-11-2011 01:57 AM
I am trying to use a shell script to change the passwd of users in hpux 11.11 and 11.23 box.I am using usermod.sam `echo "newpasswd001"/usr/lib/makekey" userid,I didn't get any error but when I try to loging using the new passwd I am getting access denied error.
Does anyone knows whats happening?
Solved! Go to Solution.
- Tags:
- makekey
- usermod.sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2011 05:45 AM - last edited on тАО07-06-2011 10:00 AM by Kevin_Paul
тАО05-11-2011 05:45 AM - last edited on тАО07-06-2011 10:00 AM by Kevin_Paul
SolutionYour usermod.sam command has unbalanced quotes and other errors. It looks like it would not work at all as posted.
Please show the command line you used *exactly*: errors make it harder to figure out what is happening. Please remember that we, the forum readers, know only exactly the facts you're telling us, and nothing more.
The makekey utility takes an input of exactly 10 characters, of which the first 8 characters will be the new password. Your "newpasswd001" has 12 characters. At least on HP-UX 11.23, the extra characters seem to be ignored.
Effectively, you now have userid's password set to "newpassw" using the salt value "d0".
Please see this thread:
http://h30499.www3.hp.com/t5/ITRC-HP-Systems-Insight-Manager/Change-password/m-p/4707542#M42389
It contains a small perl script for creating passwords of length 1-8 characters. For passwords with 9 or more characters, you would need something that uses the bigcrypt(3C) function instead of the classic Unix crypt(3C) as used by "makekey" and JRF's perl script.
Attached is bigpw.c, a small C program (written by adapting a pw.c I found somewhere, most likely from this forum). It can be compiled using the default HP-UX K&R C compiler: run "cc -o bigpw bigpw.c -lsec" to compile it, then copy "bigpw" to /usr/local/bin or wherever you want it.
With bigpw, you should be able to set 9-character or longer passwords:
/usr/lbin/usermod.sam -p $(/usr/local/bin/bigpw 'newpasswd001') userid
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-19-2011 03:55 AM
тАО05-19-2011 03:55 AM
Re: change passwd using script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-19-2018 07:45 AM
тАО06-19-2018 07:45 AM
Re: change passwd using script
it works! thank you.