I need to access to multiple hosts through SSH, execute a specific command (show ms info
) and capture the output to a file. I need to copy that file back to my linux machine
I want to use ssh
and expect
to supply the password
My problem is saving the output to a text file and looping around 100 machines simultaneously.
It is more straightforward than you think:
To do it for multiple hosts, I suggest using ssh-agent and setting up autorization keys: