We help IT Professionals succeed at work.

Performing RSH on Unix from Windows ASP

konradsadek
konradsadek asked
on
I am trying to FTP files to a Unix box from my Windows 2003 Server using ASP, then change the permissions to the file using RSH.

I have the FTP working, however, when attempting to perform an RSH to the box (rsh server chmod 775 tst.sh) I am not getting through, which I assume is due to a permission based issue since the user performing the action is the internet based acct (ISUR_SERVERNAME).

I tried several ways from putting the actual code into the ASP page, to just putting it into a .bat file and then calling it from the ASP page (see example showing me trying to just run an ls command and pipe the output to a text file on the server).

If any of the experts could help me that would be great.


<% 
' Example of running straight from code
    set wshell = CreateObject("WScript.Shell") 
    wshell.run "rsh.exe serveranme ls > C:\Inetpub\wwwroot\idap\dir.txt"	', 0, TRUE
    set wshell = nothing 
	Response.Write("all done")
%>

Open in new window

Comment
Watch Question

Top Expert 2015
Commented:
plink from putty does that, and also SSH, RLOGIN, TELNET...

Author

Commented:
Thanks, I downloaded plink, however, there are no options for RSH.

Commented:
hmmm - on win 2k3 there still should be the unixsubsystem so the rsh.exe should be there to - since I´m win7 online can´t say it atm. you can try it.

win + r
cmd
rsh


does something appear that shows the exe ist there....

alternativ plink + putty can do it ( but you need to read really deep in to use it the right way - just my opinion)

you could also install cygwin - which would include that all

or update your rsh system to ssh (which I´d say would be the best idea...but just my 2 cent).

hope I could help you - for further assitance just ask.

regards,
Lenin
Top Expert 2015

Commented:
RSH == RLOGIN running $SHELL