- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how pass password to rexec in a 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
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
тАО07-11-2005 12:13 AM
тАО07-11-2005 12:13 AM
how can I pass the user password to the rexec command in a script (possbiliy ksh)?
i.e: rexec $(hostname) -l dummyuser id
Art
Solved! Go to Solution.
- Tags:
- rexec
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2005 12:46 AM
тАО07-11-2005 12:46 AM
SolutionGet it from here:
http://hpux.cs.utah.edu/hppd/hpux/Tcl/expect-5.43/
OR..
If you want to use rexec command then possibly you can configure .rhosts or hosts.equiv to execute any r* commands without asking for password. man .rhosts or hosts.equiv for more
-USA
- Tags:
- expect
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2005 01:00 AM
тАО07-11-2005 01:00 AM
Re: how pass password to rexec in a script?
-------------------------------------------
echo "enter UID : \c"
read userid
echo "Enter password : \c"
stty -echo
read userpass
stty echo
for server in `cat myserverlist.txt`
do
(sleep 5
echo $userid
sleep 5
echo $userpass
sleep 5
echo bdf
echo ls ) | telnet $server
done
-----------------------------------------
myserverlist.txt is the file with your servers name, only one colum and as many lines as servers you want to automate.
Also in the section "echo bdf" and "echo ls" replace those lines with your actual commands to execute. remenber with in the "()" you always have to enter "echo" before the command.
Hope it works for you
Thanks
Juan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2005 01:03 AM
тАО07-11-2005 01:03 AM
Re: how pass password to rexec in a script?
Thanks
Juan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-12-2005 12:36 AM
тАО07-12-2005 12:36 AM
Re: how pass password to rexec in a script?
solution to use telnet sounds good but in case the password trasmitted is wrong the scripy remain in hang, asking for new password, putting some dummy echoes causing that the user will be locked in a trusted environment and really Id' like to avoid this.
Any other contribute to this discussion?
TIA,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-12-2005 12:38 AM
тАО07-12-2005 12:38 AM
Re: how pass password to rexec in a script?
Expect is really the weapon of choice for this sort of thing.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-12-2005 01:02 AM
тАО07-12-2005 01:02 AM
Re: how pass password to rexec in a script?
man netrc. this file is used for ftp and rexec auto logins.
Anil
- Tags:
- .netrc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-12-2005 01:41 AM
тАО07-12-2005 01:41 AM
Re: how pass password to rexec in a script?
I recommend OpenSSH as the most secure weapon of choice for remote commands. It is available on the Software Porting archive as a package. Once it is installed and working, you can use encrypted ssh keys to do passwordless authentication. I know this may be overkill in a closed environment, but if security is of any concern, it's clearly the best choice to replace any of the r* commands.
-- Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2005 12:11 AM
тАО07-13-2005 12:11 AM
Re: how pass password to rexec in a script?
Art