- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- shell-script for changing passwords
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
05-14-2002 05:52 AM
05-14-2002 05:52 AM
I must change a password for other users using a shell script which runs with system administrator rights.
My test script: (in the future, I will get the login name and the password by other way, but for testing "read login" and "read password" will be enough)
echo "login-name:"
read loginname
echo "password:"
read passw
passwd $loginname <<@
$passwd
$passwd
@
But this little here-script doesn't run!
At the end of the here-script I get twice a input line for the new password.
With other orders I already used here-scripts in similar ways without problems - how I can solve this problem?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2002 05:55 AM
05-14-2002 05:55 AM
Re: shell-script for changing passwords
You can use the "expect" software for this ... and you can find that at http://hpux.tn.tudelft.nl/
Hope this helps,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2002 05:56 AM
05-14-2002 05:56 AM
Re: shell-script for changing passwords
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2002 05:58 AM
05-14-2002 05:58 AM
Re: shell-script for changing passwords
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2002 06:09 AM
05-14-2002 06:09 AM
Solution#!/usr/local/bin/expect -f
set username $env(UNAME)
set password $env(UPASS)
spawn passwd $username
expect "New password:"
send "$password\r"
expect "Re-enter new password:"
send "$password\r"
send "exit\r"
expect eof
from:
http://www.netsys.com/sunmgr/1997-08/msg00082.html
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2002 06:12 AM
05-14-2002 06:12 AM
Re: shell-script for changing passwords
http://tlc.perlarchive.com/articles/perl/ls0001.shtml
live free or die
harry

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2002 05:37 AM
05-15-2002 05:37 AM
Re: shell-script for changing passwords
http://aa11.cjb.net/hpux_admin/1998/0087.html
--
/usr/lbin/getprpw [-r] [-m option[,option]] logonid
NOTE. This is an undocumented command and not supported for direct use by
end users.
--
probably this already can do the job you're trying to code?