LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Linux box calling a batch script on a windows box to run? Is it possible? (https://www.linuxquestions.org/questions/programming-9/linux-box-calling-a-batch-script-on-a-windows-box-to-run-is-it-possible-180441/)

joelhop 05-11-2004 04:58 PM

Linux box calling a batch script on a windows box to run? Is it possible?
 
A certain linux box runs a series of tests, if one of the tests fails I need a windows box to run a batch script. Is it possible, to have the linux box order the windows box to run that batch script as in:

if something doesn't happen
run file.bat (on windows box)
fi

I know you can use rpcclient to shut down windows boxes remotely so i'm thinking you could probably run a script or a program that runs that script any ideas?

- karl hungus

leonscape 05-11-2004 05:47 PM

Your going to need somekind of program on the windows box waiting for instructions from the linux box to execute the batch script. I don't think theres a simpler way around this.

Something like ssh/telnet or similar waiting to carry out what the Linux box tells it.

infamous41md 05-11-2004 07:36 PM

just write a simple server that listens for a connection, and upon receiving a give string performs the command. doing this, and doing this securely are 2 different things however. on the linux side, all u would need to do is netcat to the port and write the command string, which would be done simply im script.

joelhop 05-11-2004 10:30 PM

Program to complete task
 
Yeah I was thinking a program could do it. Security is of the highest priority on the windows box it would need to be install on, this is my concern and why I was hesitant to allow possible access like that. Do you think it could be done completely securely with a program and are there no alternatives to installing a program? Thanks :)

lucktsm 05-11-2004 11:49 PM

If I am not mistaking you can execute Windows commands and scripts from *nix with Windows UNIX Services. I am pretty sure it's up to version 2 or greater and it's pretty good.

infamous41md 05-12-2004 11:42 AM

Re: Program to complete task
 
Quote:

Originally posted by joelhop
Yeah I was thinking a program could do it. Security is of the highest priority on the windows box it would need to be install on, this is my concern and why I was hesitant to allow possible access like that. Do you think it could be done completely securely with a program and are there no alternatives to installing a program? Thanks :)
i can't answer 2nd question, but i can try and answer the first. the obvious security hazard is that anyone else could just connect to your server and cause it to execute the command that you are. a possible solution couldl be requiring the user to enter a certain "password" string and then execute the command. so now you're talking about storing a password inside of the program's data area, or having it read in a password from a conf. file or the registry. this introduces your next security issue, how to store that password. if you store it in a file or registry, then its possible for anyone on the windows box to read it. i dont know windows that well, so im not sure how to prevent that other than encryption. so the first time the program runs, it would check for a conf file, and if one didn't exist(race condition) then prompt the user for a passowrd, encrypt it, and store it in the file/registry. those are just some tings off top of my head, there are probly other thigns to consider as well depending on mission critical this is.

joelhop 05-13-2004 03:54 PM

Windows UNIX Services, this is something I'm not at all familiar with, can anyone give me a little more information on how I might use this to execute windows programs/batch files remotely from a linux box?

BruceC 05-17-2004 12:49 PM

Microsoft SFU 3.5 has been released and is the first version that is a free download (223 MB).
Try this link:
http://www.microsoft.com/downloads/d...DisplayLang=en

or search for ServicesForUnix3.5

SFU allows your Windows machine to act like a UNIX, even run UNIX shell scripts and programs.

joelhop 05-17-2004 04:49 PM

Microsoft SFU 3.5
 
Thanks Bruce, i'm downloading that installation file now! It sounds really cool.

-Karl


All times are GMT -5. The time now is 05:19 PM.