Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing commands remotely.

Status
Not open for further replies.

Stingreen

Technical User
Mar 5, 2001
86
0
0
US
Guys, I've been trying to find a way to execute UNIX commands from a windows 2000 server shell. I'm thinking about using winsock to open up a tunnel from win2k server to our linux mail servers and create the accounts etc.
But I don't know how to program winsock. Or maybe you guys have some other ideas how to accomplish such task.
Thank you for any input on this.
PS : Security is kind of important, for this reason, I don't thinks rsh, rexec, r*, etc. could be any solution for us.
 
I'm sorry I wasn't clear enough I guess.
Let me explain the situation a little bit further. What we're doing is currently, developing an automatic web hosting system. We wrote some batch files some vb files to manage IIS servers, FTP servers, DNS , in "Win2k" servers. However, we keep our email accounts in linux servers. Therefore, we can't execute batch files over the network to open up some email users in linux servers.
A "human being" can successfully manage the linux machine without a problem using SSH, enter the passwords, write whatever command is necessary. etc..
But the problem is this session will not be managed by a human as I explained above automatic bash scripts should enter the password whenever it is asked for,execute the commands, etc. Now my problem is this, I should create somehow a tunnel to execute these bash commands over the network from "Win2k" servers to linux servers
Is SSH still the solution for me ?
If so , would it run from cmd shell so that I could run commands automaticly ?
Hope these makes sense
Thanks for any help.
 
set up apache on the unix and write a php page which can be called from your auto application. You can have php(or any other language) call the scripts on unix
 
Good idea, but since I'm gonna hit a page from outside to run commands, how am I gonna secure that page in order to get that from being abused? I'd use .htaccess but could I use host based authentication to run that page ? Otherwise I don't think I could make the system to enter some username - password asked on the browser.

 
You should still consider SSH. SSH have several methods of authentication that can be combined. Default is just password. You can add both certificate and hostbased certification without password.
In just some other words. Install SSH on the client. Copy the client certificate to the server and configure it to allow passwordless connection to a spesific linux account from a certain client with that certificate and you should not be able to be abused except if someone gets hold of that certificate or Windows Account. By also running SSH2 all traffic will be encrypted so if you send passwords or such in the scripts noone will be able to sniff it on the network.

Kjetil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top