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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Please Running a UNIX script from Windows Server "command line"

Status
Not open for further replies.

BobWaterhouse

Programmer
Dec 11, 2002
27
US
I am trying to run a script on our Unix Server from our Windows 2000 server. I've tried the following format...

rexec server -l userid /usr/script/script.sh

It prompts me for a password. Is there any way to bypass the password prompt? Is there a file (like a .netrc) on Windows where I can place all the destination machine data?
 
rexec -l will allow you to input the user name. I don't think you can pass the password parameter to it through a file though. You can also try to install Cygwin or MS SFU under Windows (both are free) which should be a bit more robust.
 
Loaded MS SFU and found that this may be a valuable tool to use. However, we found the resolution to executing a UNIX script remotely from a Windows Server without being prompted for a password.. Here's what we did...

1. On the UNIX host, update the .rhosts file under the User the script will run under..

The .rhosts file should contain the Windows Host Name, a space, then the Windows User ID (who will be executing the script).

.rhosts
WindowsHostaName WindowsUserID



2. Use of using the 'rexec' command use the 'rsh' command as follows...

rsh UnixHostName -l UnixUserID Script(With Full Path)

If running the 'rsh' command line from within another script..

rsh UnixHostName -l UnixUserID -n Script(With Full Path)

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top