php exec problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • glin@tollnz.co.nz

    #1

    php exec problem

    hi guys,

    I need to create a page that execute a command on linux(ssh command)
    and then display whatever it comes up on the webpage. I don't know how
    to input the username after I execute the ssh command, can you help
    pls?

    Thanks in advance.

  • Steve

    #2
    Re: php exec problem

    On Sun, 17 Jul 2005 21:00:56 -0700, glin@tollnz.co. nz wrote:
    [color=blue]
    > hi guys,
    >
    > I need to create a page that execute a command on linux(ssh command) and
    > then display whatever it comes up on the webpage. I don't know how to
    > input the username after I execute the ssh command, can you help pls?
    >
    > Thanks in advance.[/color]

    ... that's 'cos you can't... easily ( user is simple, password isn't ).
    Programs like expect will allow you to set something up, but it may well
    be better to set up a dedicated login to run the command ( add in the
    command instead of the shell in /etc/passwd, and add to /etc/shells ), and
    the use ssh-keygen et al to make for a passwordless ssh to
    <newuser>@<remo tehost>

    $0.02,

    Steve

    Comment

    • Colin McKinnon

      #3
      Re: php exec problem

      Steve wrote:
      [color=blue]
      > On Sun, 17 Jul 2005 21:00:56 -0700, glin@tollnz.co. nz wrote:
      >[color=green]
      >> hi guys,
      >>
      >> I need to create a page that execute a command on linux(ssh command) and
      >> then display whatever it comes up on the webpage. I don't know how to
      >> input the username after I execute the ssh command, can you help pls?
      >>
      >> Thanks in advance.[/color]
      >
      > .. that's 'cos you can't... easily ( user is simple, password isn't ).[/color]

      Never tried, but isn't it possible with proc_open() ?

      C.

      Comment

      • glin@tollnz.co.nz

        #4
        Re: php exec problem

        Thanks guys,

        expect is an option, however I might get the rsa key setup.

        Colin McKinnon wrote:[color=blue]
        > Steve wrote:
        >[color=green]
        > > On Sun, 17 Jul 2005 21:00:56 -0700, glin@tollnz.co. nz wrote:
        > >[color=darkred]
        > >> hi guys,
        > >>
        > >> I need to create a page that execute a command on linux(ssh command) and
        > >> then display whatever it comes up on the webpage. I don't know how to
        > >> input the username after I execute the ssh command, can you help pls?
        > >>
        > >> Thanks in advance.[/color]
        > >
        > > .. that's 'cos you can't... easily ( user is simple, password isn't ).[/color]
        >
        > Never tried, but isn't it possible with proc_open() ?
        >
        > C.[/color]

        Comment

        Working...