- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: password 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
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
01-05-2004 06:50 AM
01-05-2004 06:50 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2004 06:53 AM
01-05-2004 06:53 AM
SolutionI'm not sure where to get it from, but do a search on "expect" in the forums and you'll find a lot of information about it.
-Hazem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2004 06:55 AM
01-05-2004 06:55 AM
Re: password script
Aother crude method is as follows.
Prepare a list of uses in a file.
You can use usermod.sam command for this.
/usr/sam/lbin/usermod.sam -p "`echo "user_name"`|makekey" user_name.
Use this command in script and you should be done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2004 09:14 AM
01-05-2004 09:14 AM
Re: password script
You can download the Expect program from:
http://hpux.cs.utah.edu/hppd/hpux/Tcl/expect-5.38/
You can find an example of automating passwd in "Unix Power Tools" book.
Elena.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2004 09:20 AM
01-05-2004 09:20 AM
Re: password script
-------------
#!/usr/bin/expect -f
set pass [lindex $argv 2]
spawn [lindex $argv 0] [lindex $argv 1]
expect password:
send "$pass\r"
expect password:
send "$pass\r"
expect eof
---------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2005 10:13 AM
06-15-2005 10:13 AM
Re: password script
For some reason the script you gave isn't working for me. Could you elaborate more on what this script does?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2005 03:25 PM
06-15-2005 03:25 PM
Re: password script
If this is the only time you have to do something like this, you might consider using /usr/sam/lbin/usermod -p ${pwd} ${user} or /usr/sam/lbin/useradd -p ${pwd} ... ${user}
The -p options on these commands allows you to supply an encrypted password. Either add one of them or change the password of an existing user, then just copy the password into the X11 clipboard. Once done, you can loop through all the users by:
for user in $(cat ${user_file})
do
/usr/sam/lbin/usermod -p `middle_mouse_button_to_paste' ${user}
done
As far as the expect, it's very useful. I think the syntax is horrendous though so I use the expect modules with perl. great combination!
In this case, though, assuming you don't need it for anything else, it may be akin to slaying a fly with a small thermonuclear device.
HTH;
Doug
------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html