remotely executing commands via telnet

From: Chris (chess76_at_hotmail.com)
Date: 08/04/04


Date: 3 Aug 2004 19:05:19 -0700

I know somebody must have already done this so i don't want to
re-invent the wheel.

I basically just want to do this in a php script:

1. Connect to another machine via telnet.
2. Login
3. Execute Command & Return Result
4. Exit

And possibly do multiple step 3's. Has somebody written a php telnet
class for this already that I can just go grab? I really don't want
to have re-write this if it's already done and somebody is willing to
share. I have a working implementation with using PHP to execute an
EXPECT script but the overhead of connect each time in the scripts
when I need to run multiple commands is taking too long. I'd like to
be able to make a connection at the beginning of my PHP script and
exit at the end of the script and execute various commands in-between
and storing/displaying the results of the commands.

Thanks,
Cristov



Relevant Pages

  • Re: head, recursively through file tree?
    ... What's the problem with running a shell or perl inline script ... | child-process to execute the user's commands. ... the shell forks a process for every command it runs unless ...
    (comp.unix.shell)
  • Re: Maby a litle OT but: apache+sh CGI script
    ... that the http user is added to sudoers and may execute only ... thouse commands that it realy needs for the script. ... it's safer then giving apache full root priv. ...
    (comp.os.linux.security)
  • Re: Maby a litle OT but: apache+sh CGI script
    ... that the http user is added to sudoers and may execute only ... thouse commands that it realy needs for the script. ... it's safer then giving apache full root priv. ...
    (comp.os.linux.security)
  • Re: [opensuse] Keeping the monitor turned on
    ... Hash: SHA1 ... So with my new theme I will also set up a script to execute these two commands also and see if the combo of switching to my new theme and having that script automagically executed does the trick... ...
    (SuSE)
  • Re: How to copy scripts to the Terminal
    ... Use 'sh' to execute the commands in the script (if the USB drive is ... > I have been key entering and save it on a removeable device (USB Flash ...
    (alt.linux)