Script that runs several ssh sessions consecutively
My company uses a bastion SSH server to connect to many of our ssh clients. I'm trying to create a script that could run once logged into bastion that will ssh to a client, run a couple commands, exit and then ssh to the next client and repeat.
This seams too much for post login commands, and I've tried to create a script/macro and excecute it, but it fails on the passwords for each ssh client. I've entered them in plain text in the macro, but when run it does not appear to accept the entry on bastion.
Any suggestions on running several ssh connections consecutively and automatically from within one bastion connection?
Macros and passwords in SSH sessions
I'm experimenting with macros and scripting because it seems it should be able to make some of our processes more efficient, but I'm running into a hangup:
We login to a mercury environment and from there log into several different SSH connections to various servers. We typically have situations where we need to login to a box, run one or two commands, log out , then login to a different box and repeat. This often involves 15-20 servers or more.
I tried using a text macro, and it hangs on the entering the password on the first remote box. In the macro I have the password in plain text on the line right after the ssh line. When I run it, nothing happens at the password prompt.
Is there a way to have it run the password at the prompt and then move on to the rest of the commands? Ideally automatically logging out and logging into the next server and repeating until done?
Thanks for any assistance.
Brad
Using a script or automation to select an open window at login
I'm experimenting with the scripting capabilities of RDM manager and I'm hoping there's a way to do this. I want to somehow run a script so that once RDM logs into a windows box, it's selects a specific window from several already opened, types a command in that window which closes it gracefully, then runs a bat file on the desktop to restart the app. The window specific window is USUALLY the 2nd one on the taskbar, but that changes once this program is restarted, so ideally the script could directly address the window. Is this possible?
Using the attached pic, I am hoping to have it select the "SendCleanQueue" window, type a "Q" in the window and enter to run it, then run the SendCleanQueue bat file on the desktop. Currently we are having to mouse over to the window, select it, etc. We have hundreds of these we often have to restart frequently, so any automation would be helpful. Thanks!
