- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: SSH can not run batch script on windows
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
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
тАО10-29-2008 11:11 AM
тАО10-29-2008 11:11 AM
SSH can not run batch script on windows
Please help me on this issue.
this script will run from HPUX 11.11 to windows 2003 using SSH (SSH installed and configured on windows)
what it does is to ssh to host (sundc3) and run the batch script (fpt33.bat) this script will ftp to HPUX and pickup a file to windows.
#!/bin/sh
#set -x
sleep 2;
ssh -T sundc3 <
EOF
this one is working fine on HPUX 11.11
i am moving to 11.31
doing the same thing, the windows server is still the same but the HPUX is now on new server HPUX itanium 11.31
the problem that i have now is, the script ran fine on Itanium, no error, but it did not run the batch file from windows.
here is how i ran the script
$./winuser.sh
Received disconnect from 10.10.2.23: 2: disconnecting
if i run this command from command line
$ssh -T sundc3
it will connect to windows no problem.
or if i run the batch file from windows, it will connect to HPUX 11.31 noproblem.
so the problem seems somwwhere in the script.
Please Help!
Regards,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2008 11:23 AM
тАО10-29-2008 11:23 AM
Re: SSH can not run batch script on windows
ssh -T sundc3 ftp33.bat
Also check with -v option to see more details.
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2008 11:55 AM
тАО10-29-2008 11:55 AM
Re: SSH can not run batch script on windows
Without "<<" it won't run
with -v i can see more detail.
it seems like the connection is fine, but it could not run the bat file on windows.
Any idea Please!
$./winuser.sh.bk
+ sleep 2
+ ssh -T -v sundc3
+ 0< /var/tmp/sh4637.1
OpenSSH_4.7p1+sftpfilecontrol-v1.2-hpn12v17, OpenSSL 0.9.7m 23 Feb 2007
HP-UX Secure Shell-A.04.70.023, HP-UX Secure Shell version
debug1: Reading configuration data /opt/ssh/etc/ssh_config
debug1: Connecting to sundc3 [10.10.2.23] port 22.
debug1: Connection established.
debug1: identity file /home/winuser/.ssh/id_rsa type 1
debug1: identity file /home/winuser/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version SysaxSSH_1.0
debug1: no match: SysaxSSH_1.0
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.7p1+sftpfilecontrol-v1.2-hpn12v17
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'sundc3' is known and matches the RSA host key.
debug1: Found key in /home/winuser/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /home/winuser/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: Final hpn_buffer_size = 131072
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
Received disconnect from 10.10.2.23: 2: disconnecting
itauxap1:[winuser]:[TWO_TASK=SAP]:/home/winuser
$
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2008 12:44 PM
тАО10-29-2008 12:44 PM
Re: SSH can not run batch script on windows
Can you add something like a "dir" command before your ftp33.bat?
The last things we see are:
debug1: Entering interactive session.
Received disconnect from 10.10.2.23: 2: disconnecting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2008 01:24 PM
тАО10-29-2008 01:24 PM
Re: SSH can not run batch script on windows
if i add the dir before the sundc3 then it think the dir is the host and got an error.
with this line, it get me to windows dir
$ssh -T -v sundc3
Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.
C:\winuser>
try to run from command line, how can i run
this line below
$ssh -T -v sundc3 <
Thanks,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2008 02:41 PM
тАО10-29-2008 02:41 PM
Re: SSH can not run batch script on windows
Sorry I meant:
ssh -T sundc3 <
ftp33.bat
EOF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-29-2008 03:29 PM
тАО10-29-2008 03:29 PM
Re: SSH can not run batch script on windows
It does not work.
and here is the debug from working UNIX server, they are identical.
$./wwwsundc3.sh
OpenSSH_4.1, OpenSSL 0.9.7e 25 Oct 2004
HP-UX Secure Shell-A.04.00.000, HP-UX Secure Shell version
debug1: Reading configuration data /opt/ssh/etc/ssh_config
debug1: Connecting to sundc3 [10.10.2.23] port 22.
debug1: Connection established.
debug1: identity file /home/batchus/.ssh/id_rsa type 1
debug1: identity file /home/batchus/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version SysaxSSH_1.0
debug1: no match: SysaxSSH_1.0
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'sundc3' is known and matches the RSA host key.
debug1: Found key in /home/batchus/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /home/batchus/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 149
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
Received disconnect from 10.10.2.23: 2: disconnecting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-30-2008 07:43 AM
тАО10-30-2008 07:43 AM
Re: SSH can not run batch script on windows
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-30-2008 08:04 AM
тАО10-30-2008 08:04 AM
Re: SSH can not run batch script on windows
Can someone please helps me on this issue
Thanks,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-30-2008 08:48 AM
тАО10-30-2008 08:48 AM
Re: SSH can not run batch script on windows
#!/bin/sh
#set -x
sleep 2;
ssh sundc3 full/path/to/ftp33.bat
ought to work, i would think.
I must admit, I've not seen an example where "here-doc" works in the fashion you described.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-30-2008 01:02 PM
тАО10-30-2008 01:02 PM
Re: SSH can not run batch script on windows
Rex the "-B" is not ssh option.
this script here from unix 11.11 to windows and it's still working. the problem is with 11.31 ; the same script won't run.
#!/bin/sh
#set -x
sleep 2;
ssh -T sundc3 <
EOF
somehow this line did not work before but it run now
ssh -T -v sundc3 ftp33.bat
....
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending command: ftp33.bat
--->and it stays there.
debug1: Entering interactive session.
debug1: Sending command: c:/winuser/ftp33.bat
this
ssh -T -v sundc3 c:\\winuser\\ftp33.bat
becomes this
debug1: Sending command: c:\\winuser\\ftp33.bat
how can i send this "\" to windows
Thanks for your helps.
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-30-2008 02:56 PM
тАО10-30-2008 02:56 PM
Re: SSH can not run batch script on windows
Do you have the same ssh on each? From your debug output, it doesn't look like it.
>how can i send this "\" to windows
First of all put it in single quotes:
'c:\\winuser\\ftp33.bat'
I don't know if ssh will require extra quoting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-30-2008 10:30 PM
тАО10-30-2008 10:30 PM
Re: SSH can not run batch script on windows
>the problem is with 11.31
--->Yes my 11.11 is still working with the same script
Do you have the same ssh on each? From your debug output, it doesn't look like it.
-->yes the scripts are the same on both servers.
and here is the output.
debug1: Sending command: c:\\\\winuser\\\\ftp33.bat
i did try single, double, forward and backward slash but none is working.
Thanks for your help.
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2008 12:37 AM
тАО10-31-2008 12:37 AM
Re: SSH can not run batch script on windows
>-->yes the scripts are the same on both servers.
I was saying your ssh is different and that may be the cause.
>i did try single, double
Again, try something that doesn't need a path, like dir.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2008 05:05 AM
тАО10-31-2008 05:05 AM
Re: SSH can not run batch script on windows
ssh sundc3
c:\>ftp33.bat
What happens?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2008 05:07 AM
тАО10-31-2008 05:07 AM
Re: SSH can not run batch script on windows
ssh sundc3 ftp33.bat
and
ssh -T sundc3 ftp33.bat
Which (if either) works?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2008 07:57 AM
тАО10-31-2008 07:57 AM
Re: SSH can not run batch script on windows
this command did not work
$ssh sundc3 dir <--
this one work from command line manually
$ssh sundc3
ftp33.bat
this one
$ssh -T sundc3 <--can connect to windows but ican not type anything.
Regards,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2008 08:36 AM
тАО10-31-2008 08:36 AM
Re: SSH can not run batch script on windows
What happens when you do
ssh sundc3 ftp33.bat
from the command line of the 11.31 box?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2008 10:25 AM
тАО10-31-2008 10:25 AM
Re: SSH can not run batch script on windows
it was just sitting there,
if i run it with
$ssh -v sundc3 ftp33.bat
i can see this, but it just sitting there.
.....
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: Final hpn_buffer_size = 131072
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending command: ftp33.bat
...and it just stay there.
Thanks,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2008 11:25 AM
тАО10-31-2008 11:25 AM
Re: SSH can not run batch script on windows
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-31-2008 04:27 PM
тАО10-31-2008 04:27 PM
Re: SSH can not run batch script on windows
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-04-2008 11:32 AM
тАО11-04-2008 11:32 AM