How to run UNIX commands on remote machine from windows?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to run UNIX commands on remote machine from windows?
# 1  
Old 11-25-2014
How to run UNIX commands on remote machine from windows?

Hi All,

I am working in support and we are planning to automate a system to reduce the direct manual intervention to core system.

Please find the below details.
1. we have a web application that runs on Windows Platform.
2. From web application, we need to connect to remote Unix machine.
3. After connecting we need to execute application specific commands and need to capture the output.
4. And the output needs to be displayed in web page.


Web application part is ready but need help in the about requirement.

I heard that "SSHD" can be used to achieve this, but not sure.

Can someone please help....
# 2  
Old 11-25-2014
sshd is a daemon that runs on UNIX. You wouldn't run it on Windows.

ssh is kind of overkill if you're going to be running requests all the time. Is the UNIX machine behind a firewall / on a local net? Does it have apache installed? I'd be tempted to just use CGI. Your windows script could connect to http://local.ip.address/cgi-bin/script.sh and get its output.
# 3  
Old 11-25-2014
If running a webserver on the unix system is not an option (or even if it is), you can consider running the command(s) periodically via cron, saving the results in a share that is accessible from the windows system. This could also be used to generate data for a report that is formatted by an applet of some variety.
# 4  
Old 11-25-2014
Thanks for the reply Corona688!

apache server has not installed on server. But the server is in the same network. Since this is a production server, we system admin will not allow to install any other programs.... do we have any other possibilities?

---------- Post updated at 10:41 PM ---------- Previous update was at 10:32 PM ----------

Thanks for the reply derekludwig!

Code:
If running a webserver on the unix system is not an option (or even if  it is), you can consider running the command(s) periodically via cron,  saving the results in a share that is accessible from the windows  system. This could also be used to generate data for a report that is  formatted by an applet of some variety.

We have hundreds of background processes that kick off as per the schedule (even in repetitive scheduled intervals), if we schedule a script in scheduled intervals ( not for a a specific process rather for all) it will be a kind of increasing the load on application. And also we need to read the input from webpage (like get the report for process "A" or get the report for "A" and "B" between a particular timespan).
# 5  
Old 11-25-2014
Quote:
Originally Posted by Balaji K
apache server has not installed on server. But the server is in the same network. Since this is a production server, we system admin will not allow to install any other programs.... do we have any other possibilities?
You are limited by what's running on the server, then. What's running on the server?
# 6  
Old 11-25-2014
Quote:
Originally Posted by Balaji K
Hi All,

I am working in support and we are planning to automate a system to reduce the direct manual intervention to core system.

Please find the below details.
1. we have a web application that runs on Windows Platform.
2. From web application, we need to connect to remote Unix machine.
3. After connecting we need to execute application specific commands and need to capture the output.
4. And the output needs to be displayed in web page.


Web application part is ready but need help in the about requirement.

I heard that "SSHD" can be used to achieve this, but not sure.

Can someone please help....
You can install Cygwin on your windows server and write .bat file using Cygwin commands such as ssh. You can script ssh to run a command on another server. you can also probably connect with public/private authentication, although I have not tried that. Once you prove that you can run all of the jobs that you need to run from Windows you just need something to kick off the jobs when they need to be run.

However, I would still use cron on the Unix/Linux servers, since if your Windows job scheduler breaks the jobs won't run and cron will run as long as the server is running.
# 7  
Old 11-25-2014
Balaji asked:
Quote:
Originally Posted by Balaji K
apache server has not installed on server... <snip> ... do we have any other possibilities?
A simple webserver could be written in almost any goodTM scripting language. There are also a goodly number of open source webservers that could be of use. But I would discuss what you want to do with your systems administrators. They may have good reason not to allow a webserver to run on your application server, be it policy, resourcing, support concerns, patching, licensing, etc. It may be easier for them to spin you up a new system than trying to have your existing application server also be a webserver.

Balaji also wrote
Quote:
Originally Posted by Balaji K
We have hundreds of background processes that kick off as per the schedule (even in repetitive scheduled intervals), if we schedule a script in scheduled intervals (not for a specific process rather for all) it will be a kind of increasing the load on application.
If you are concerned about the increased load with a scheduled script, then I would be very worried about a script that will be invoked on an ad-hoc basis by users. Especially scripts that takes "user input" - see XKCD: Exploits of a Mom Smilie.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Login to remote machine pass commands and capture all in a file

Dear user/friends, After a long gap of 6 years i am back to this forum to find a solution and i hope i will get a solution or atleast a workaround for the problem:p Following is my task which i am trying for almost 3 days without any success. 1) run this command from my terminal (note i... (7 Replies)
Discussion started by: imas
7 Replies

2. IP Networking

How to transfer files from UNIX server to windows machine or vice versa using ftp or sftp commands?

hi, i want to write a shell script code which transfers files from a directory in unix server to a directory in a windows machine.. can any1 give me a sample code which uses ftp or sftp command.. thanks very much, (3 Replies)
Discussion started by: Little
3 Replies

3. UNIX Desktop Questions & Answers

How to practice unix commands on windows 7 machine

Hello, I am pretty new to UNIX and would like to know how i can run unix commands on a windows 7 machine. Basically, I want to practice running commands, created bash/awk/etc. scripts. I've read some things about cygwin, but it doesn't sound like it's exactly what I'm looking for. Any... (4 Replies)
Discussion started by: tester213
4 Replies

4. UNIX for Dummies Questions & Answers

how to use ssh to run shell script on a remote machine?

how to use ssh to run shell script on a remote machine? ssh user@remote sh ./script.unx i ran the above command ./script.unx HAS NOHUP COMMAND IN ITS BODY, I AM GETTING ERROR AS NOHUP NOT FOUND... i tried to run that script from remote server, its working fine do ineed to set... (6 Replies)
Discussion started by: only4satish
6 Replies

5. Linux

send remote commands to windows machine?

hey guys, I've done some searching and other than winexe I haven't been able to find a way to send remote commands to a windows machine. The problem I get is with winexe whenever you send the process to the background in a script, I get the following error. :wall: Any help is appreciated! ... (0 Replies)
Discussion started by: terrell
0 Replies

6. Shell Programming and Scripting

Need help with executing multiple commands in remote machine

Hi, I work on a jumpserver and I wrote a script to transfer a file from source server to destination server. #!/bin/ksh echo "\nEnter the file name:\n" read name echo "\nSelect the Source server\n" echo "1. ODS PROD " echo "2. ODS DROPBOX" echo "3. ODS STE" echo "4. ODS STE DROPBOX"... (6 Replies)
Discussion started by: ajayakunuri
6 Replies

7. Shell Programming and Scripting

Run Shell Commands via HTML on a client machine

Hi guys, so, I have a server running an sqlite database which is accessed by many client machines working as hardware testers, whenever something fails and needs to be replaced the operator would have to enter the Serial Number of the part being replaced as well as some other data. and... (0 Replies)
Discussion started by: sx3v1l_1n51de
0 Replies

8. UNIX for Dummies Questions & Answers

How to run UNIX commands for practice in Windows 2000 OS?

How to run UNIX commands for practice in Windows 2000 OS? If you suggest to install Cygwin, please let me know the procedure to install, or else I feel happy if you suggest any stand alone app for running UNIX commands..:) (2 Replies)
Discussion started by: Srikanthk
2 Replies

9. UNIX for Dummies Questions & Answers

Copy file from Remote Unix box to windows machine

Hi I need to copy a file from the remote unix server to windows machine. I read lot of thrad but didn't worked out. Requesting all to please help. (2 Replies)
Discussion started by: sameerspice
2 Replies

10. UNIX for Advanced & Expert Users

Identify a remote machine as windows or unix

Hi, I have a IP address of the target machine.Is there is any way to find out whether it is a unix box or windows box without logging into it?. Regs Anand (5 Replies)
Discussion started by: u449064
5 Replies
Login or Register to Ask a Question