- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- updating root password
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
06-22-2000 07:24 AM
06-22-2000 07:24 AM
updating root password
I am trying to pass a new password of the ROOT account from a script rub by ROOT
ie simply in a script using th following
passwd root
It doesn't like it. Any ideas ??
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2000 07:43 AM
06-22-2000 07:43 AM
Re: updating root password
passwd(1) command do not accept passwd on the command line. For security purpose, I guess.
And it requires entering the new passwd twice.
To be able to do what you want, I have write your own program that will update the passwd file, using getpw[ent|name|uid](3) and putpwent(3) functions.
regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2000 08:13 AM
06-22-2000 08:13 AM
Re: updating root password
Or an example
Thanks
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2000 08:46 AM
06-22-2000 08:46 AM
Re: updating root password
This would probably be a better option so that the password is not in plain text in the script.
Check the man pages on the putpwent(3C).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2000 11:56 AM
06-22-2000 11:56 AM
Re: updating root password
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2000 12:47 AM
10-13-2000 12:47 AM
Re: updating root password
there's another way to solve your problem. i'm running an terminal emulator on my pc called PWACCESS . with this tool it's possible to create a script handling events/actions. i'd solve your problem with following script :
waitfor "login:"
send "root"
waitfor "Password:"
send "hp" (send root's password)
waitfor "hp03a:/#" (system prompt)
send "passwd"
waitfor "New password:"
send "xyz" (send new password"
waitfor "Re-enter..."
send "xyz"
This should work, but you would have to modify the password in this script everytime you run it (not very comfortable...)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2000 02:10 AM
10-17-2000 02:10 AM
Re: updating root password
But I would consider them much easier to use from Perl, especially when it comes to parsing of text files.
If you have Perl on your system (BTW HP-UX ships a very dated Perl 4.X under /usr/contrib/bin, which should be superseded by a recent Perl 5.6 ;-) consult the POD
$ perldoc perlfunc
Perl even offers an Expect Module from CPAN, which is modelled after the TCL expect, in case you need to run jobs that require some kind of user interaction.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2000 02:39 AM
10-17-2000 02:39 AM
Re: updating root password
You can of course do it in C.
Attached to this reply you find a piece of code that changes the password of a user. The code works on trusted an non trusted systems.
Hope this helps,
Rik