<?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 Re: ssh bash shell hangs... in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/ssh-bash-shell-hangs/m-p/3659470#M20313</link>
    <description>10x a lot Matti for detailed explanation !&lt;BR /&gt;&lt;BR /&gt;I expect TJ to assign some points in my name (since I'm not the author of the thread).&lt;BR /&gt;&lt;BR /&gt;Thanks to all</description>
    <pubDate>Fri, 28 Oct 2005 05:43:11 GMT</pubDate>
    <dc:creator>Aco Blazeski</dc:creator>
    <dc:date>2005-10-28T05:43:11Z</dc:date>
    <item>
      <title>ssh bash shell hangs...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-bash-shell-hangs/m-p/3659466#M20309</link>
      <description>with the large number of linux servers I admin, I have set up one admin host with private keys to ssh to all my other hosts.  I find that when I ssh to a host or set up a for loop script to ssh a command on all my hosts, and run a command (like /etc/init.d/snmpd restart), then Ctrl-D to exit back to my admin host, my ssh hangs.&lt;BR /&gt;I believe I found sort of a fix for this-&lt;BR /&gt;run the commands with this syntax:&lt;BR /&gt;some-command /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&lt;BR /&gt;&lt;BR /&gt;Was just wondering if there was some ssh setting or some other way to prevent these hangs?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;TJ</description>
      <pubDate>Thu, 27 Oct 2005 14:16:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-bash-shell-hangs/m-p/3659466#M20309</guid>
      <dc:creator>TJ_16</dc:creator>
      <dc:date>2005-10-27T14:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: ssh bash shell hangs...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-bash-shell-hangs/m-p/3659467#M20310</link>
      <description>I made the same thing and... it works for me.&lt;BR /&gt;You can try adding nohup command:&lt;BR /&gt;&lt;BR /&gt;# nohup some-command /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&lt;BR /&gt;&lt;BR /&gt;maybe this helps.&lt;BR /&gt;&lt;BR /&gt;Ciao</description>
      <pubDate>Fri, 28 Oct 2005 01:44:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-bash-shell-hangs/m-p/3659467#M20310</guid>
      <dc:creator>Claudio Cilloni</dc:creator>
      <dc:date>2005-10-28T01:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: ssh bash shell hangs...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-bash-shell-hangs/m-p/3659468#M20311</link>
      <description>Hi folks,&lt;BR /&gt;&lt;BR /&gt;can you explain what is the purpose of redirecting input "&lt;BR /&gt;Thanks</description>
      <pubDate>Fri, 28 Oct 2005 03:43:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-bash-shell-hangs/m-p/3659468#M20311</guid>
      <dc:creator>Aco Blazeski</dc:creator>
      <dc:date>2005-10-28T03:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: ssh bash shell hangs...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-bash-shell-hangs/m-p/3659469#M20312</link>
      <description>The SSH connection is shut down by the sshd (at the destination host) when the following conditions are true:&lt;BR /&gt;- the process sshd has started (usually some sort of a shell) finishes&lt;BR /&gt;- no process is holding onto the standard input, output and error streams opened for the SSH session&lt;BR /&gt;- all X11 or TCP port forwarding connections are shut down, if any are used&lt;BR /&gt;&lt;BR /&gt;When you want to use SSH to "launch" something on some remote host and leave it running there on its own, you must explicitly disconnect the launched process from the standard input, output and error streams so that sshd won't hold the connection open.&lt;BR /&gt;&lt;BR /&gt;You *can* force the connection to shut down from the local side, but you must use SSH's escape characters for that. By default the key combination to disconnect is "~."&lt;BR /&gt;&lt;BR /&gt;The "&lt;BR /&gt;The "&amp;gt;/dev/null 2&amp;gt;&amp;amp;1" is a shorthand for "&amp;gt;/dev/null 2&amp;gt;/dev/null" which redirects both the standard output ("&amp;gt;") and standard error ("2&amp;gt;") streams to /dev/null aka the bit-bucket.&lt;BR /&gt;&lt;BR /&gt;Depending on the features of the shell you're using, the final "&amp;amp;" may or may not be enough   to leave the command running after the SSH connection closes. Some (most?) shells send a SIGHUP to any processes of the session left running when the session ends. To counteract that, you need to prefix your command with "nohup"... or detach the process from the session with "detach" if your shell supports that command.&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Oct 2005 05:19:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-bash-shell-hangs/m-p/3659469#M20312</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2005-10-28T05:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: ssh bash shell hangs...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-bash-shell-hangs/m-p/3659470#M20313</link>
      <description>10x a lot Matti for detailed explanation !&lt;BR /&gt;&lt;BR /&gt;I expect TJ to assign some points in my name (since I'm not the author of the thread).&lt;BR /&gt;&lt;BR /&gt;Thanks to all</description>
      <pubDate>Fri, 28 Oct 2005 05:43:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-bash-shell-hangs/m-p/3659470#M20313</guid>
      <dc:creator>Aco Blazeski</dc:creator>
      <dc:date>2005-10-28T05:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: ssh bash shell hangs...</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ssh-bash-shell-hangs/m-p/3659471#M20314</link>
      <description>points assigned and thanks for the responses.</description>
      <pubDate>Fri, 28 Oct 2005 07:58:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ssh-bash-shell-hangs/m-p/3659471#M20314</guid>
      <dc:creator>TJ_16</dc:creator>
      <dc:date>2005-10-28T07:58:38Z</dc:date>
    </item>
  </channel>
</rss>

