- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Change Password without prompting
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
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
тАО04-27-2008 11:04 PM
тАО04-27-2008 11:04 PM
I require to change an user user password without prompting. Because I need to trigger the command from my program. Currently the linux has the following option,
/usr/sbin/usermod -p
But the -p option is not available in hp-ux. Is there any way to change the password without prompting ?
Thanks in advance for your help.
Thanks,
Ramesh
Solved! Go to Solution.
- Tags:
- Password
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2008 11:14 PM
тАО04-27-2008 11:14 PM
SolutionAre you changing password for same user across systems?
If so, All I can think of is to change the password on one system.
Then from the program Copy there entry from the password file onto the other systems.
Provided they're using the same UID on the other systems.
Also there may be more considerations if you're using Trusted mode etc.
We do have a script here which does this for a select group. I'll see if I can find it and see if there's any hints there.
But again there is the requirment to initially answer a prompt.
----------------------
There are utilities to automatically script responses to questions from commands.
Can't think of it right now but you may be able to use on of those.
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2008 11:32 PM
тАО04-27-2008 11:32 PM
Re: Change Password without prompting
Thanks for the quick response. My exact requirement is, my application server will run one m/c and agent will run the hp-ux system. User can change their password from my application client. If he changes the password from the client, the server will send out the request to the agent which written in C code. The agent will trigger a command which will change the password on the hpux m/c. Please let me know, if you have any utilities for handling prompting issue.
Thanks,
Ramesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2008 11:41 PM
тАО04-27-2008 11:41 PM
Re: Change Password without prompting
May not have it today though.
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2008 11:47 PM
тАО04-27-2008 11:47 PM
Re: Change Password without prompting
The con is that you have to know what your prompts will be:
#!/bin/sh
# \
exec expect -f "$0" ${1+"$@"}
set password [lindex $argv 1]
spawn passwd [lindex $argv 0]
expect "assword:"
send "$password\r"
expect "assword:"
send "$password\r"
expect eof
Usage
changepasswd username 123456
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2008 11:51 PM
тАО04-27-2008 11:51 PM
Re: Change Password without prompting
Here's one thread
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=598850
In the Forum search use the keywords "expect passwd" and you'll get a few more hits.
Good luck.
(If you can post your solution once done it would benefit others...oh and points are nice too :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-28-2008 12:07 AM
тАО04-28-2008 12:07 AM
Re: Change Password without prompting
http://hpux.ece.ualberta.ca/hppd/hpux/Tcl/expect-5.43/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-28-2008 12:11 AM
тАО04-28-2008 12:11 AM
Re: Change Password without prompting
You'll have to make sense of it by accessing the portal site I posted in my last link.
For example expect requires tcltk.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-28-2008 08:52 PM
тАО04-28-2008 08:52 PM
Re: Change Password without prompting
#!/opt/perl/bin/perl
print "Salt code: ";
$VAR{salt}=<>; #first argument
print "Password: ";
$VAR{pass}=<>; #second argument
$VAR{pass}=crypt($VAR{pass}, $VAR{salt});
print "Result: ", $VAR{pass}, "\n";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-28-2008 09:37 PM
тАО04-28-2008 09:37 PM
Re: Change Password without prompting
Is the salt can be anything ? If the salt code is given by user, how the system interpret the /etc/passwd file. I am planing to encrypt the password and directly write to /etc/passwd file. Here, I am struggling with the salt code.
Thanks,
Ramesh