How To Execute Linux commands from Windows

29 Jul, 2008  |  Posted by dragoncity99  |  in HowTo, Linux

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.

  • Digg
  • del.icio.us
  • BlinkList
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Furl
  • Google
  • Live
  • Facebook
  • Pownce
  • TwitThis
  • E-mail this story to a friend!
Tags: , , , , ,

2 Responses so far | Have Your Say!

  1. simon  |  July 29th, 2008 at 10:14 am #

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

    simon - Gravatar
  2. Danny  |  July 30th, 2008 at 1:00 am #

    awesome tip dude.

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

    Danny - Gravatar

Leave a Feedback

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>