Connection problems with plink (putty for commandline) to EOS devices

  • 0
  • 1
  • Problem
  • Updated 2 years ago
  • Solved
  • (Edited)
Hello all, 
I want to connect to EOS devices with plink (the command line version of putty).
I need plink because I will use the communicaton in scripts on my PC.

With XOS all works fine. For example I use this command:

"plink ip –l user –pw passwort show switch" => I receive the expected result

On EOS I use:

"plink ip –l user –pw passwort show system" => I receive  Error: „FATAL ERROR: Server sent disconnect message.

Same behaviour if I use a config-file with the CLI-commands (like show system) instead of the CLI-command in the plink command line.

If I use the command:

"plink ip –l user –pw passwort" (without a CLI command) I receive no error but an oben CLI-session and can manualy set command on the open CLI-session.

Now the quesion. Does anybody know how I can connect to EOS via plink?

Best regards
Stephan
Photo of SH

SH

  • 4,816 Points 4k badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Daniel Coughlin

Daniel Coughlin, Employee

  • 2,752 Points 2k badge 2x thumb
I have not used PLINK so I have no specific advice there.  Hopefully somebody in the community has. 
That said it may be helpful to turn up logging on the EOS device and see if you get an error that may steer you in the right direction.
Photo of Alex Morrissey

Alex Morrissey, Employee

  • 862 Points 500 badge 2x thumb
Hello,

I did some quick testing with this and was able to replicate the behaviors you describe.  My suspicion is because EOS is not a linux based operating system the method plink is using to send the commands in may not be supported.  If you have a need for plink to work I would suggest logging a case with the GTAC for further investigation into this.

-Alex
Photo of SH

SH

  • 4,816 Points 4k badge 2x thumb
Hello Daniel, hello Alex,

thank you for your fast respone.
I will create a GTAC case.

Stephan
Photo of Erik Auerswald

Erik Auerswald, Embassador

  • 13,772 Points 10k badge 2x thumb
Hi,

I have tested this connecting to a D2 as EOS device with openssh on GNU/Linux, seeing the following results:
  1. Interactive login works fine,
  2. Specifying a command with the SSH invocation does not work,
  3. Providing a command to SSH via STDIN does work.
This seems to be similar to the problem reported by SH.

The test switch does not have a password configured, its IP address is 10.0.0.11.

Output for case 2:
$ ssh admin@10.0.0.11 "show version"
Received disconnect from 10.0.0.11: 2: Packet integrity error.
$ ssh admin@10.0.0.11 show version
Received disconnect from 10.0.0.11: 2: Packet integrity error.
Output for case 3:
$ echo show version | ssh admin@10.0.0.11
Pseudo-terminal will not be allocated because stdin is not a terminal.


Enterasys D2-Series 
Command Line Interface 

Enterasys Networks, Inc. 
50 Minuteman Rd.
Andover, MA 01810-1008 U.S.A. 

Phone: +1 978 684 1000 
E-mail: support@enterasys.com 
WWW: http://www.enterasys.com 

(c) Copyright Enterasys Networks, Inc. 2009

Chassis Serial Number:      08351019905C
Chassis Firmware Revision:  06.03.01.0008


D2(su)->show version

 Model            Serial #             Versions  
--------------  -----------------  -------------------

D2G124-12         08351019905C      Hw:BCM5698 REV 17
                                    Bp:01.00.44  
                                    Fw:06.03.01.0008  
                                    BuFw:01.00.03.0002   

D2(su)->Connection to 10.0.0.11 closed by remote host.
Photo of SH

SH

  • 4,816 Points 4k badge 2x thumb
Hello,

I opend a GTAC case for this. The answer to the case was that plink isn't supported.

Stephan
Photo of Erik Auerswald

Erik Auerswald, Embassador

  • 13,772 Points 10k badge 2x thumb
Hi Stephan,

you can use the following workaround:
echo show system | plink.exe IP -l USER -pw PASSWORD
(even on Windows)

Erik
Photo of SH

SH

  • 4,816 Points 4k badge 2x thumb
Hello Erik,

thank you for the very good hint.
It works quite nice with a b-series switch and version 6.61.08.0013

but not with a s-series switch and version 8.42.02.0012

On the s-series the output looks like:


----------------------------------------
echo show system | plink.exe IP -l USER -pw PASSWORD


B O N D E D   S 4   C H A S S I S

Command Line Interface

 

Extreme Networks, Inc.

145 Rio Robles

San Jose, CA 95134

Phone:  +1 408 579-2800

E-mail: support@extremenetworks.com

WWW:    http://www.extremenetworks.com

 

(c) Copyright Extreme Networks, Inc. 2016

 

Chassis Serial Number:      141xxxx

Chassis Firmware Revision:  08.42.02.0012

-----------------------
Nothing more!!!

Maybe you have one more good idea?

Stephan
Photo of Erik Auerswald

Erik Auerswald, Embassador

  • 13,772 Points 10k badge 2x thumb
Hi Stephan,

I do not have a simple workaround for the S-Series. :-(

The following Expect script works for me on Ubuntu GNU/Linux with an SSA set up with IP address 10.0.0.101 and user account admin:password:
#! /usr/bin/expect

spawn ssh admin@10.0.0.101
expect {
  {word:?} {send "password\r"}
}
expect {
  {)->} {send "show system\r"}
}
expect {
  {)->} {send "exit\r"}
}
exit
I have never tried Expect on Windows.

The above script is just a proof-of-concept, it is not robust or production ready.

Best regards,
Erik
Photo of SH

SH

  • 4,816 Points 4k badge 2x thumb
Hello Erik,

your workaround works ( in Windows, too).

Thank you for help.

Best regards
Stephan