<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Batch SSH from linux to Windows in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775937#M22989</link>
    <description>Hello,&lt;BR /&gt;&lt;BR /&gt;We have few Apache web-servers running on 3-4 Windows machines. We are planning to monitor those machines from a linux box. We check whether the web-site is up/down by using "wget" and then if the site is down, send mail alerts. &lt;BR /&gt;&lt;BR /&gt;In addition to sending alerts, we would like to restart the web server if the site is down. We thought, the best way would be to set up freeSSHd server on Windows box and connect to windows from Linux using public-private keys and then execute some batch script located on Windows.&lt;BR /&gt;&lt;BR /&gt;We have successfully set up the keys, so that we can connect to windows without specifying the password. But when I try to execute following command for testing - &lt;BR /&gt;&lt;BR /&gt;ssh &lt;HOSTNAME&gt; -l &lt;UID&gt; &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;ls -lart&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;its giving error - &lt;BR /&gt;"Pseudo-terminal will not be allocated because stdin is not a terminal."&lt;BR /&gt;&lt;BR /&gt;I tried changing 'command line shell' in freeSSHd to cygwin.bat. But the problem still exists.&lt;BR /&gt;&lt;BR /&gt;I tried to search on net, but did not find any post related to this. &lt;BR /&gt;&lt;BR /&gt;Is this possible? Or we are trying to achieve something impossible?&lt;BR /&gt;&lt;BR /&gt;Thanks for the help.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shailesh&lt;/UID&gt;&lt;/HOSTNAME&gt;</description>
    <pubDate>Fri, 21 Apr 2006 17:39:34 GMT</pubDate>
    <dc:creator>Shailesh P Joshi</dc:creator>
    <dc:date>2006-04-21T17:39:34Z</dc:date>
    <item>
      <title>Batch SSH from linux to Windows</title>
      <link>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775937#M22989</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;We have few Apache web-servers running on 3-4 Windows machines. We are planning to monitor those machines from a linux box. We check whether the web-site is up/down by using "wget" and then if the site is down, send mail alerts. &lt;BR /&gt;&lt;BR /&gt;In addition to sending alerts, we would like to restart the web server if the site is down. We thought, the best way would be to set up freeSSHd server on Windows box and connect to windows from Linux using public-private keys and then execute some batch script located on Windows.&lt;BR /&gt;&lt;BR /&gt;We have successfully set up the keys, so that we can connect to windows without specifying the password. But when I try to execute following command for testing - &lt;BR /&gt;&lt;BR /&gt;ssh &lt;HOSTNAME&gt; -l &lt;UID&gt; &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;ls -lart&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;its giving error - &lt;BR /&gt;"Pseudo-terminal will not be allocated because stdin is not a terminal."&lt;BR /&gt;&lt;BR /&gt;I tried changing 'command line shell' in freeSSHd to cygwin.bat. But the problem still exists.&lt;BR /&gt;&lt;BR /&gt;I tried to search on net, but did not find any post related to this. &lt;BR /&gt;&lt;BR /&gt;Is this possible? Or we are trying to achieve something impossible?&lt;BR /&gt;&lt;BR /&gt;Thanks for the help.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shailesh&lt;/UID&gt;&lt;/HOSTNAME&gt;</description>
      <pubDate>Fri, 21 Apr 2006 17:39:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775937#M22989</guid>
      <dc:creator>Shailesh P Joshi</dc:creator>
      <dc:date>2006-04-21T17:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: Batch SSH from linux to Windows</title>
      <link>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775938#M22990</link>
      <description>I wonder if the command is executed, try with a batch command, like this:&lt;BR /&gt;&lt;BR /&gt;ssh &lt;HOSTNAME&gt; -l &lt;UID&gt; &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;ls -latr &amp;gt; ls.log 2&amp;gt;&amp;amp;1 &amp;amp;&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;Verify if the ls.log file is executed. Now, if you are success, how do you plan to stop the service? The net stop command won't be in cygwin I think. Windows 2003 have service recovery configuration.&lt;BR /&gt;&lt;BR /&gt;Maybe, you can also enable telnet services on windows and use expect scripts to logon to the server and restart the service.&lt;/UID&gt;&lt;/HOSTNAME&gt;</description>
      <pubDate>Fri, 21 Apr 2006 19:00:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775938#M22990</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2006-04-21T19:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Batch SSH from linux to Windows</title>
      <link>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775939#M22991</link>
      <description>Ivan, under Cygwin, you still have access to the standard dos/windows commands.&lt;BR /&gt;&lt;BR /&gt;As for the other, why don't you use the form:&lt;BR /&gt;&lt;BR /&gt;ssh &lt;HOSTNAME&gt; -l &lt;UID&gt; "ls -lart"&lt;BR /&gt;&lt;BR /&gt;You can stack the commands as well:&lt;BR /&gt;&lt;BR /&gt;ssh &lt;HOSTNAME&gt; -l &lt;UID&gt; "cd /;ls -lart;/cygdrive/c/Windows/system32/net.exe ..."&lt;BR /&gt;&lt;BR /&gt;&lt;/UID&gt;&lt;/HOSTNAME&gt;&lt;/UID&gt;&lt;/HOSTNAME&gt;</description>
      <pubDate>Fri, 21 Apr 2006 19:07:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775939#M22991</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2006-04-21T19:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Batch SSH from linux to Windows</title>
      <link>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775940#M22992</link>
      <description>Try adding the -T option to your ssh command.&lt;BR /&gt;This will disable pseudo-terminal allocation&lt;BR /&gt;which you shouldn't need for your script.&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Apr 2006 09:03:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775940#M22992</guid>
      <dc:creator>Bill Thorsteinson</dc:creator>
      <dc:date>2006-04-24T09:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Batch SSH from linux to Windows</title>
      <link>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775941#M22993</link>
      <description>Try to add "-f -t" options:&lt;BR /&gt;# ssh &lt;HOSTNAME&gt; -f -t -l &lt;UID&gt; &amp;lt;&lt;EOF&gt;&lt;/EOF&gt;&lt;BR /&gt;This should fork ssh into background and force pseudo-tty allocation just before command execution.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;/UID&gt;&lt;/HOSTNAME&gt;</description>
      <pubDate>Mon, 24 Apr 2006 09:55:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775941#M22993</guid>
      <dc:creator>Sergejs Svitnevs</dc:creator>
      <dc:date>2006-04-24T09:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: Batch SSH from linux to Windows</title>
      <link>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775942#M22994</link>
      <description>I personally use expect in situations like this...</description>
      <pubDate>Mon, 24 Apr 2006 09:57:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775942#M22994</guid>
      <dc:creator>Alan_152</dc:creator>
      <dc:date>2006-04-24T09:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Batch SSH from linux to Windows</title>
      <link>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775943#M22995</link>
      <description>I use cygwin.</description>
      <pubDate>Thu, 27 Apr 2006 02:04:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/batch-ssh-from-linux-to-windows/m-p/3775943#M22995</guid>
      <dc:creator>Andrea Rossi</dc:creator>
      <dc:date>2006-04-27T02:04:57Z</dc:date>
    </item>
  </channel>
</rss>

