By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,712 Members | 1,553 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,712 IT Pros & Developers. It's quick & easy.

Probelm when 'rsh' to Solaris 8

P: n/a
TL
Please help. I need to get this problem resolved ...

When I ran remote shell to a Sun Solaris 8 box from W2K box, the DOS'
CMD window popped up and stayed there until CGI timeout. The funny
thing was that it did run the Unix script and turned out the right
result. Just the CMD window ... I had to kill the window by clicking
on 'x'. After that it displayed CGI timeout error. What was going
on?

Thanks,
Tom

Environment - IIS 5, PHP 4.3.9, Windows 2000, Solaris 8.

PHP script on Windows 2K:

<? php
/* Call a script on a remote unix box to display the name */
system <"rsh remoteunix -l thisuser \"/mybin/test.sh $firstName
$lastName\"">;
?>

Shell script on Unix box:

#!/bin/sh
firstName=$1
lastName=$2
echo Your name is: $firstName $lastName
exit 0
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On 1 Oct 2004 11:20:48 -0700, tm*******@yahoo.com (TL) wrote:
Please help. I need to get this problem resolved ...

When I ran remote shell to a Sun Solaris 8 box from W2K box, the DOS'
CMD window popped up and stayed there until CGI timeout. The funny
thing was that it did run the Unix script and turned out the right
result. Just the CMD window ... I had to kill the window by clicking
on 'x'. After that it displayed CGI timeout error. What was going
on?

Environment - IIS 5, PHP 4.3.9, Windows 2000, Solaris 8.

PHP script on Windows 2K:

<? php
/* Call a script on a remote unix box to display the name */
system <"rsh remoteunix -l thisuser \"/mybin/test.sh $firstName
$lastName\"">;
?>
Could you post the real script?

Where did you get rsh from on Windows? Cygwin, Microsoft SFU, something like
that?
Shell script on Unix box:

#!/bin/sh
firstName=$1
lastName=$2
echo Your name is: $firstName $lastName
exit 0


--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2

P: n/a
TL
I missed two lines in php code. The complete php script should read
like:

<!-- test.php -->
<?php
$firstName = "Tom";
$lastName = "Lee";
system("rsh remoteunix -l thisuser \"/mybin/test.sh $firstName
$lastName\"");
?>

This is a very simplified test script. I made this one to see how rsh
is to be done under PHP. The rsh should be the one came with the W2K
installation. The same rsh calling string was tested by entered
directly into CMD window without problem.

Start -> Run -> cmd, then on the DOS command line:
rsh remoteunix -l thisuser "/mybin/test.sh $firstName $lastName"

Thanks,
Tom
Andy Hassall <an**@andyh.co.uk> wrote in message news:<md********************************@4ax.com>. ..
On 1 Oct 2004 11:20:48 -0700, tm*******@yahoo.com (TL) wrote:
Please help. I need to get this problem resolved ...

When I ran remote shell to a Sun Solaris 8 box from W2K box, the DOS'
CMD window popped up and stayed there until CGI timeout. The funny
thing was that it did run the Unix script and turned out the right
result. Just the CMD window ... I had to kill the window by clicking
on 'x'. After that it displayed CGI timeout error. What was going
on?

Environment - IIS 5, PHP 4.3.9, Windows 2000, Solaris 8.

PHP script on Windows 2K:

<? php
/* Call a script on a remote unix box to display the name */
system <"rsh remoteunix -l thisuser \"/mybin/test.sh $firstName
$lastName\"">;
?>


Could you post the real script?

Where did you get rsh from on Windows? Cygwin, Microsoft SFU, something like
that?
Shell script on Unix box:

#!/bin/sh
firstName=$1
lastName=$2
echo Your name is: $firstName $lastName
exit 0

Jul 17 '05 #3

P: n/a
TL
OK, I played more with rsh and it 'almost' pointed to IIS or PHP:

This is my original test php script:
test.php
<?php
$rl = system ("rsh rmoteunix -l username \"ls\"", $rc);
echo $rc;
echo $rl;
?>
The result of running this test.php was $rc=1 and balnk in $rl, and
'ls' wasn't executed on the remoteunix.

So I put the rsh line into a test.bat:
c:\myweb\home\test.bat:
rsh remoteunix -l username "ls"

and changed the test.php to:
<?php
$rl = system ("c:\\myweb\\home\\test.bat");
echo $rc;
echo $rl;
?>

Now in the browser it showed
C:\MyWeb\Home>rsh remotehost -l username "ls" remotehost: remuser too
long rsh: can't establish connection
and $rc is blank and $rl "C:\MyWeb\Home>rsh remoteunix -l username
"ls"

However, if I ran test.php from cmd window (c:\php>php
c:\myweb\home\test.php), I could get 'ls' executed from both cases.

Where does this lead to? I'd assume IIS or PHP changed something such
as logon name. Does anyone have experienced this problem?

Thanks,
Tom

tm*******@yahoo.com (TL) wrote in message news:<74**************************@posting.google. com>...
Please help. I need to get this problem resolved ...

When I ran remote shell to a Sun Solaris 8 box from W2K box, the DOS'
CMD window popped up and stayed there until CGI timeout. The funny
thing was that it did run the Unix script and turned out the right
result. Just the CMD window ... I had to kill the window by clicking
on 'x'. After that it displayed CGI timeout error. What was going
on?

Thanks,
Tom

Environment - IIS 5, PHP 4.3.9, Windows 2000, Solaris 8.

PHP script on Windows 2K:

<? php
/* Call a script on a remote unix box to display the name */
system <"rsh remoteunix -l thisuser \"/mybin/test.sh $firstName
$lastName\"">;
?>

Shell script on Unix box:

#!/bin/sh
firstName=$1
lastName=$2
echo Your name is: $firstName $lastName
exit 0

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.