Connecting Tech Pros Worldwide Forums | Help | Site Map

php exec problem

glin@tollnz.co.nz
Guest
 
Posts: n/a
#1: Jul 18 '05
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
Guest
 
Posts: n/a
#2: Jul 18 '05

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>@<remotehost>

$0.02,

Steve

Colin McKinnon
Guest
 
Posts: n/a
#3: Jul 18 '05

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.
glin@tollnz.co.nz
Guest
 
Posts: n/a
#4: Jul 21 '05

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]

Closed Thread