Operating System - HP-UX
1747997 Members
4508 Online
108756 Solutions
New Discussion юеВ

Re: Question on how to telnet and execute shell script using batch file

 
Sharvil Desai
Frequent Advisor

Question on how to telnet and execute shell script using batch file

Hi,
There is a HP-UX computer that has a shell script in its' /home/prgmr folder.
I have a Windows 2000 pc. What I want to do is have a batch file
that would telnet to the HP-UX computer, and execute the shell script.
Is this possible? Thank you for your feedback!
"help!"
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: Question on how to telnet and execute shell script using batch file

Though its a little more work, I don't like the security holes built into the Berkeley product suite.

Therefore, I use Secure shell.

Secure Shell: a replacement for rcp ftp and telnet that encrypts passwords

http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=T1471AA


The ssh command can be used to pass script arguments to the HP-UX server

example ssh tzfat "cat /etc/issue"

There are a number of free clients for your W2K environment that can be found at tucows.com or download.com

I am attaching Chris Vail's doc on public key exchange. It works for Linux, it works for HP-UX. It would probably work for W2K if you find the right W2K secure shell client software.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Shannon Petry
Honored Contributor

Re: Question on how to telnet and execute shell script using batch file

You can write a batch script, but I honestly dont think windblows will be much use. Your better to look for something like Xceed, or Reflections that can run rexec() or remsh() commands.


The HP is more than capable of running a command issued externally/remotely. Can the OS your working on utilize this?

Since the Windblows box can not rexec or remsh, you need to look at the capabilities of batch.

Unless you install 3rd party software, you can not run a batch script that will type your username and password for you (expect in Unix world does this).

(just dawned on me)Another possible answer is to install Cygwin, which is a UNIX toolkit addition for Windblows. It does have rexec and remsh capabilities and may do what you need. It also supports perl and basic POSIX scripting techniques.

Regards,
Shannon
Microsoft. When do you want a virus today?
Geoff Wild
Honored Contributor

Re: Question on how to telnet and execute shell script using batch file

Something else to look at - ssh

Install ssh on the HP-UX server - then install a ssh client (putty.exe) on the Windows machine.

Then run it like:


putty.exe -ssh prgmr@hpuxhost -pw password -m /home/prgmr/script

Rgds...Geoff

BTW: putty is here:
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.