How To Execute Linux commands from Windows

Most of the time, users are having a Windows Machine on their desk or laptop. Normally, we want to perform a full scale data retrieval from our Linux servers in the DC, where we don’t have a trusted Linux server to manage it….the answer to it is use “PLINK” utility.

Plink comes together with the Putty…

A simple example of usage is:

C:\> plink USERNAME@SERVERNAME ‘YOUR-LINUX-COMMAND’

If you have a dozen of servers…then you probably want to write a batch script in Windows to loop through a list of servers and mention the list of commands juz like what i did…..

Here a typical windows batch script:

@echo off

for / f “tokens=*” %%A in (your-server-list.txt) ( C:\path\to\plink.exe user@server -w YOUR-PASSWORD -m linuxcommandscript > YOUR_OUTPUT_FILE.txt)

There you go, i did this for my sar report data collection for root cause analysis and infrastructure load analysis….keying in a password wif every darn login is impractical and yet you dont want to generate a security key for the servers.

2 Responses to “How To Execute Linux commands from Windows”

Author comments are in a darker gray color for you to easily identify the posts author in the comments

  1. simon says:

    this really help if you manage a lot of linux servers, will try out this tool.

  2. Danny says:

    awesome tip dude.

    I also update the title, think you missed out in :)

Leave a Reply

© 2008-2009 The Danesh Project
Powered by Wordpress and made by Guerrilla. Best viewed in Mozilla Firefox