![]() (note: I wasn't able to get clusterssh running on windows cygwin as of july 2014 so i couldn't really speak to how good/bad the program is at accomplishing what OP asked for.) HOSTS=. I managed to exit the SSH session with the process running by essentially doing the following steps: Establish SSH connection: ssh userhost Run the desired command to start the process Press Ctrl + Z to pause the process Run bg to put the paused process in the background and resume it. sshpass doesnt work until you have manually acknowledged adding the ssh key for the remote servers. One thing to note, you'll have to login using ssh from the command line of your admin machine for each server you want to manage. You will have to install sshpass (i know people really hate this package but i was too lazy to get ssh keys going on all the servers) separately which can be downloaded from sourceforge. You'll need cygwin on windows (which is the only place i've tested this). Save this code into a file named copyFileToServers.sh, create a serverlist file that has a list of ips or server names and execute by typeing. I've found it easier than both clusterssh and mtputty. I'm a bash scripting novice so likely not the most efficient or best option but seems to be pretty easy to manage. In addition to using clusterssh or mtputty, a simpile bash script can login to a list of remote servers using ssh, copy a file to each using scp and execute a script on each of the servers. ![]() this is my first post here so I cant upload images. You will need to create a folder named temp inside putty main folder and you might need to customize putty logging to save a file per ip or pear session. Putty -ssh -pw paaswd -m commands.txt 192.168.0.22 user_name paaswd Putty -ssh -pw paaswd -m commands.txt 192.168.0.21 user_name paaswd If you want to run the exact command list on every machine then you save it to a file and use another sheet to generate the command-line batch. cmd Command ip user name password Command templateĮcho /snmp set enabled=yes >temp\10.10.0.9.txt| putty -ssh -pw passwd -m temp\10.10.0.9.txt 10.10.0.9 user_name passwd /snmp set enabled=yesĮcho /snmp set enabled=yes >temp\10.10.0.31.txt| putty -ssh -pw passwd2 -m temp\10.10.0.31.txt 10.10.0.31 user_name2 passwd2 /snmp set enabled=yes it works like magic even if you have to customize the command for each server. I used an excel sheet to build cmd commands including putty ssh log-in then copy past the columns in a cmd window. Here’s a list of the documentation I found to put this blog together.I have recently figure out a way to do this easily. See KeeAgent (for KeePass 2.x) or PuttyAgent (KeePass 1.x) for more details. Once connected through putty any session will be automatically logged. UPDATE: A better alternative is to use one of the “SSH agent support” plugins. I’ll leave this up to you but note it’s very simple to clipboard the password from inside KeePass (as you’re already in it!). Which works great, but the obvious security concern is the password is passed to Putty (or Batch file) in plain text which essentially anyone could read (but they’d need access to your computer). But we can go one step further as KeePass lets you pass in field values from an Entry, such as the username, in this case with Here we are specifying an ssh protocol and a computer located at which Putty would attempt to connect to and open a new window. If the client is written correct way, it should take care of shutting down the connection to server and the server should take care of closing your session, whatever method you use. To launch something more specific we can add parameters: cmd://putty.exe -ssh ![]() We could launch putty with a similar command: cmd://putty.exeīut that would not launch any specific SSH link, only the putty application itself (Note: this also assumes the computer can find the application “putty.exe”, you may have to put in the full location e.g. We can launch the application Firefox by selecting Open URL. If you want to come back later, log on again and type screen -r This will resume your screen session, and you can see the output of your process. KeePass makes manipulating the URL very easy as it has a built in versatile mechanism to launching (what it calls) it’s URLs – it can be tweaked to launch any program on your computer. This will detach your screen session but leave your processes running. By manipulating the form of the URLs in KeePass we can simply right click an Entry and select open URL to launch a putty session. Putty essentially organises and launches SSH sessions between computers KeePass is a Password Safe storage system. This blog is about launching SSH sessions through putty but from within KeePass, mostly using Windows although other Operating Systems may also work. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |