<?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 Why is ExtremeXOS ssh exit status 255 when no error occurs? in ExtremeSwitching (EXOS/Switch Engine)</title>
    <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54984#M15782</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying to create some scripts to execute commands on Summit boxes using SSH but, even though the commands execute correctly, I always get 255 (-1) as the exit code. From OpenSSH man page I saw that 255 is expected to indicate errors like a connection failure, which clearly is not the case. Isn't EXOS supposed to return 0 when everything works correctly?&lt;BR /&gt;
&lt;BR /&gt;
Example:&lt;BR /&gt;
#&amp;gt; ssh user1@summitBox "show version | include Extreme"&lt;BR /&gt;
Keyboard-interactive authentication&lt;BR /&gt;
Enter password for user1:&lt;BR /&gt;
Image   : ExtremeXOS version 16.1.2.14 by release-manager&lt;BR /&gt;
&lt;BR /&gt;
#&amp;gt; echo $?&lt;BR /&gt;
255&lt;BR /&gt;
#&amp;gt;&lt;BR /&gt;
Am I doing something wrong?&lt;BR /&gt;
&lt;BR /&gt;
From ssh man page:&lt;BR /&gt;
&lt;BR /&gt;
    &lt;I&gt;ssh exits with the exit status of the remote command or with 255 if an error occurred.&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
  The problem with this behavior is that it breaks any automation script that expects a value between 0 and 254 as the return code when no error occurs with the ssh client itself.  &lt;BR /&gt;
&lt;BR /&gt;
  Thanks for any tips!&lt;BR /&gt;
  H.</description>
    <pubDate>Sat, 14 Nov 2015 22:44:00 GMT</pubDate>
    <dc:creator>Heitor_Moraes</dc:creator>
    <dc:date>2015-11-14T22:44:00Z</dc:date>
    <item>
      <title>Why is ExtremeXOS ssh exit status 255 when no error occurs?</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54984#M15782</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying to create some scripts to execute commands on Summit boxes using SSH but, even though the commands execute correctly, I always get 255 (-1) as the exit code. From OpenSSH man page I saw that 255 is expected to indicate errors like a connection failure, which clearly is not the case. Isn't EXOS supposed to return 0 when everything works correctly?&lt;BR /&gt;
&lt;BR /&gt;
Example:&lt;BR /&gt;
#&amp;gt; ssh user1@summitBox "show version | include Extreme"&lt;BR /&gt;
Keyboard-interactive authentication&lt;BR /&gt;
Enter password for user1:&lt;BR /&gt;
Image   : ExtremeXOS version 16.1.2.14 by release-manager&lt;BR /&gt;
&lt;BR /&gt;
#&amp;gt; echo $?&lt;BR /&gt;
255&lt;BR /&gt;
#&amp;gt;&lt;BR /&gt;
Am I doing something wrong?&lt;BR /&gt;
&lt;BR /&gt;
From ssh man page:&lt;BR /&gt;
&lt;BR /&gt;
    &lt;I&gt;ssh exits with the exit status of the remote command or with 255 if an error occurred.&lt;/I&gt;&lt;BR /&gt;
&lt;BR /&gt;
  The problem with this behavior is that it breaks any automation script that expects a value between 0 and 254 as the return code when no error occurs with the ssh client itself.  &lt;BR /&gt;
&lt;BR /&gt;
  Thanks for any tips!&lt;BR /&gt;
  H.</description>
      <pubDate>Sat, 14 Nov 2015 22:44:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54984#M15782</guid>
      <dc:creator>Heitor_Moraes</dc:creator>
      <dc:date>2015-11-14T22:44:00Z</dc:date>
    </item>
    <item>
      <title>RE: Why is ExtremeXOS ssh exit status 255 when no error occurs?</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54985#M15783</link>
      <description>I see the same with 15.4.3 p1-10 and 15.5.1.6&lt;BR /&gt;
The command looks fine - I was wondering if it didn't like closing without "exit", so I did:&lt;BR /&gt;
ssh -v user@switch "exit"but that, too, gave me a "-1", i.e. "255"&lt;BR /&gt;
&lt;BR /&gt;
Heck, even on an interactive ssh session, once you type "exit", the return code is -1/255&lt;BR /&gt;
&lt;BR /&gt;
Do we need to open a case?&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Nov 2015 17:24:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54985#M15783</guid>
      <dc:creator>Frank</dc:creator>
      <dc:date>2015-11-17T17:24:00Z</dc:date>
    </item>
    <item>
      <title>RE: Why is ExtremeXOS ssh exit status 255 when no error occurs?</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54986#M15784</link>
      <description>Interesting.  Definitely sounds like it is worthy of opening a case to track.&lt;BR /&gt;
I'll let you two &lt;A href="https://www.google.com/search?q=flip+a+coin" target="_blank" rel="nofollow noreferrer noopener"&gt;flip a coin&lt;/A&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
-Drew&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Nov 2015 21:58:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54986#M15784</guid>
      <dc:creator>Drew_C</dc:creator>
      <dc:date>2015-11-17T21:58:00Z</dc:date>
    </item>
    <item>
      <title>RE: Why is ExtremeXOS ssh exit status 255 when no error occurs?</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54987#M15785</link>
      <description>OK, I'll open one &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Nov 2015 21:58:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54987#M15785</guid>
      <dc:creator>Frank</dc:creator>
      <dc:date>2015-11-17T21:58:00Z</dc:date>
    </item>
    <item>
      <title>RE: Why is ExtremeXOS ssh exit status 255 when no error occurs?</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54988#M15786</link>
      <description>I did it already! I was just waiting for the first response from support before posting here.&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Nov 2015 21:58:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54988#M15786</guid>
      <dc:creator>Heitor_Moraes</dc:creator>
      <dc:date>2015-11-17T21:58:00Z</dc:date>
    </item>
    <item>
      <title>RE: Why is ExtremeXOS ssh exit status 255 when no error occurs?</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54989#M15787</link>
      <description>I got a different result here:&lt;BR /&gt;
&lt;BR /&gt;
lbrito@LW540 ~ $ ssh admin@10.43.2.42 "show version"Keyboard-interactive authentication&lt;BR /&gt;
Enter password for admin: &lt;BR /&gt;
Keyboard-interactive authentication&lt;BR /&gt;
Enter password for admin: &lt;BR /&gt;
Switch      : 800472-00-08 1246G-01386 Rev 8.0 BootROM: 2.0.1.7    IMG: 15.7.1.4  &lt;BR /&gt;
PSU-1       : Internal Power Supply  &lt;BR /&gt;
PSU-2       :&lt;BR /&gt;
&lt;BR /&gt;
Image   : ExtremeXOS version 15.7.1.4 v1571b4-patch1-2 by release-manager&lt;BR /&gt;
          on Fri May 1 15:16:42 EDT 2015&lt;BR /&gt;
BootROM : 2.0.1.7&lt;BR /&gt;
Diagnostics : 6.3&lt;BR /&gt;
&lt;BR /&gt;
lbrito@LW540 ~ $&lt;BR /&gt;
&lt;BR /&gt;
I'll try with 15.4.3 p1-10, 15.5.1.6 and 16.1.2.14 and will share the results this afternoon with you.&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Nov 2015 21:58:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54989#M15787</guid>
      <dc:creator>Leandro_Brito</dc:creator>
      <dc:date>2015-11-17T21:58:00Z</dc:date>
    </item>
    <item>
      <title>RE: Why is ExtremeXOS ssh exit status 255 when no error occurs?</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54990#M15788</link>
      <description>Thx Leandro, but I miss the "echo $?" in your bash output &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 17 Nov 2015 21:58:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54990#M15788</guid>
      <dc:creator>SchmuFoo</dc:creator>
      <dc:date>2015-11-17T21:58:00Z</dc:date>
    </item>
    <item>
      <title>RE: Why is ExtremeXOS ssh exit status 255 when no error occurs?</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54991#M15789</link>
      <description>On further investigation by the developer , It seems like client sends disconnect message when it is done with remote command execution, ssh-toolkit server is not able to decode this message properly, and kills the session with SIGTERM. &lt;BR /&gt;
&lt;BR /&gt;
That's why client doesn't receive any exit status and it shows status as 255 or -1(error case).&lt;BR /&gt;
&lt;BR /&gt;
A CR xos0063330 was created to solve that.&lt;BR /&gt;
&lt;BR /&gt;
I'll keep you guys updated.&lt;BR /&gt;
&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Dec 2015 19:03:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54991#M15789</guid>
      <dc:creator>Leandro_Brito</dc:creator>
      <dc:date>2015-12-21T19:03:00Z</dc:date>
    </item>
    <item>
      <title>RE: Why is ExtremeXOS ssh exit status 255 when no error occurs?</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54992#M15790</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Regarding CR xos0063330, the development team has further investigated the problem and have found that this issue appears only in our older SSH Server, which is a  SSH-toolkit implementation. From EXOS 16.2 and above releases, we are using OpenSSH for SSH server and this issue is not observed. &lt;BR /&gt;
&lt;BR /&gt;
SSH-Toolkit Server supports only the below listed SSH-request types. Here "exec" is used for remote command execution, which works fine. But after the command is executed the client will request for a "exit-status" from the server. In SSH-Toolkit server, this message type is not supported. So, for "exit-status" request, Server replies with an error message. This is because it cannot process the request.&lt;BR /&gt;
&lt;BR /&gt;
&lt;U&gt;The valid channel requests in SSH-Toolkit and their actions are:&lt;/U&gt;    &lt;BR /&gt;
&lt;BR /&gt;
    "pty-req"       -- setup pty&lt;BR /&gt;
    "shell"         -- start user shell&lt;BR /&gt;
    "exec"          -- execute a command&lt;BR /&gt;
    "subsystem"     -- handle subsystem calls (not implemented yet)&lt;BR /&gt;
    "env"           -- determine if ENV variable is OK to be set, then set&lt;BR /&gt;
    "signal"        -- if we have signals, send this signal to the process&lt;BR /&gt;
    "exit-status"   -- send exit status to client, close connection (not supported - ignored)&lt;BR /&gt;
    "window-change" -- change terminal window size values&lt;BR /&gt;
    "xon-xoff"      -- handle flow control (not supported - ignored)&lt;BR /&gt;
    "x11-req"       -- channel request failure (not supported - ignored)&lt;BR /&gt;
&lt;BR /&gt;
In EXOS 16.2 and 21.1 releases this issue (CR xos0063330) would not exist as we have upgraded the SSH server to OPENSSH instead of SSH-Toolkit. However for EXOS releases lower than 16.2, this limitation would continue to exist.&lt;BR /&gt;</description>
      <pubDate>Sat, 30 Jul 2016 00:46:00 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/why-is-extremexos-ssh-exit-status-255-when-no-error-occurs/m-p/54992#M15790</guid>
      <dc:creator>Henrique</dc:creator>
      <dc:date>2016-07-30T00:46:00Z</dc:date>
    </item>
  </channel>
</rss>

