12-23-2021 08:02 AM
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
Solved! Go to Solution.
12-23-2021 08:24 AM
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.
12-23-2021 08:13 AM
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.
12-23-2021 08:15 AM
but if i run
i get in, then run
show system sensors
it works, as it shows me the sensors, how can i do this then?
12-23-2021 08:24 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide