cancel
Showing results for 
Search instead for 
Did you mean: 

Changes in SSH-Handling since summit 31.6.1.3

Changes in SSH-Handling since summit 31.6.1.3

schuert
New Contributor III
Hi Guys,

a few days ago I had updated some test switches (x440-G2) from firmware 31.5.1.6 to 31.6.1.3. This changed the internal ssh handling.
echo "show vlan" | ssh switch
doesn't work any longer. the switch removes the first 10 characters of the command and returns an error.
'echo "1234567890show vlan" | ssh switch' will execute "show vlan" which seems to be a bug.

I tested the following notation and realized this still worked:
"ssh switch show vlan"
so i changed my scripts to this notation. Still, I'm wondering if this is intentional.

While debugging this i found another difference: setting the banner with the above method stopped working too:
echo -e "conf banner after-login\nTestbanner\nRow1\nRow2" | ssh switch
even if i add 10 chars at the beginning it produces an error. Instead of changing the after-login banner, i'll get the error that "Row1" is an unrecoginzed command.

my workaround for that is to create a banner.xsf, write the "conf banner after-login" command and its new multiline value to it and then scp the script to the switch and run it locally with "run script banner.xsf".

So my question is, will this be reverted? Is that a bug or something i can't expect to work like it does with older firmware?

Kind regards
2 REPLIES 2

schuert
New Contributor III
I'm using ansible as configuration management tool to configure all my switches. Unfortunately multiline-commands like "conf banner after-login" or creating UPM-Profiles wont work with ansible, so i use the above mentioned method to change these settings via bash.

The problem is the same if i use the shell module in ansible or the bash of my linux system. after the command executed, when i put 10 spaces at the beginning", and the cli comes back i also see some control characters being inputed on the commandline. this never happened before 31.6.1.3 so i guess something changed in the way the firmware handles SSH.

Using the mentioned way is really neat. Want to get the full config of a switch:
ssh switch show config detail > config-switch.txt

Export a "show tech":
ssh switch show tech > tech-switch.txt

Thankfully "ssh switch command" still works, the bug only happens when I use "echo command | ssh switch" syntax.

FredrikB
Contributor II
I'm afraid I don't have a solution, but I'm very curious as to why you run the commands this way. Do you execute the "echo "show vlan" | ssh switch" from a Linux/Mac/*nix station or from the switch itself?
GTM-P2G8KFN