cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7763
Views
0
Helpful
3
Replies

ssh into cisco switch and run command

robertkwild
Spotlight
Spotlight

hi all,

i have enabled ssh pub key into my cisco switch from my linux server and trying to run this command all in one go and it is not working

ssh root@10.110.250.17 show system sensors

running them one at a time works fine, just when i try to do it in one go, doesnt work

i know if i do linux to linux i can do ssh and run command all in one go

thanks,

rob

1 Accepted Solution

Accepted Solutions

That is a 'normal' interactive session.

Your best bet is to write a script which will log in, run a commands and logout.

Something like this :

https://github.com/sebrupik/srupik-apic-em-tools/blob/master/frozenPony/src/oneLinerSimple.py

 

cheers,

Seb.

View solution in original post

3 Replies 3

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

The IOS ssh server process only offers an interactive session. What you are attempting is to execute a command in a non-interactive session.

 

cheers,

Seb.

but if i run

ssh root@10.110.250.17

i get in, then run

show system sensors

it works, as it shows me the sensors, how can i do this then?

That is a 'normal' interactive session.

Your best bet is to write a script which will log in, run a commands and logout.

Something like this :

https://github.com/sebrupik/srupik-apic-em-tools/blob/master/frozenPony/src/oneLinerSimple.py

 

cheers,

Seb.