Probelm when 'rsh' to Solaris 8

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TL

    Probelm when 'rsh' to Solaris 8

    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
  • Andy Hassall

    #2
    Re: Probelm when 'rsh' to Solaris 8

    On 1 Oct 2004 11:20:48 -0700, tmlee5688@yahoo .com (TL) wrote:
    [color=blue]
    >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\"" >;
    >?>[/color]

    Could you post the real script?

    Where did you get rsh from on Windows? Cygwin, Microsoft SFU, something like
    that?
    [color=blue]
    >Shell script on Unix box:
    >
    >#!/bin/sh
    >firstName=$1
    >lastName=$2
    >echo Your name is: $firstName $lastName
    >exit 0[/color]

    --
    Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • TL

      #3
      Re: Probelm when 'rsh' to Solaris 8

      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 <andy@andyh.co. uk> wrote in message news:<md8rl0dtr ui4f2ar246anvvm 02hdemma5a@4ax. com>...[color=blue]
      > On 1 Oct 2004 11:20:48 -0700, tmlee5688@yahoo .com (TL) wrote:
      >[color=green]
      > >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\"" >;
      > >?>[/color]
      >
      > Could you post the real script?
      >
      > Where did you get rsh from on Windows? Cygwin, Microsoft SFU, something like
      > that?
      >[color=green]
      > >Shell script on Unix box:
      > >
      > >#!/bin/sh
      > >firstName=$1
      > >lastName=$2
      > >echo Your name is: $firstName $lastName
      > >exit 0[/color][/color]

      Comment

      • TL

        #4
        Re: Probelm when 'rsh' to Solaris 8

        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\t est.bat:
        rsh remoteunix -l username "ls"

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

        Now in the browser it showed
        C:\MyWeb\Home>r sh 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\t est.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

        tmlee5688@yahoo .com (TL) wrote in message news:<74b56e67. 0410011020.495a 2d90@posting.go ogle.com>...[color=blue]
        > 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[/color]

        Comment

        Working...