Telnet module doesnot return the prompt back

Discussion in 'Perl Misc' started by nilendud@rediffmail.com, Apr 8, 2004.

  1. Guest

    Hello,

    I have a problem. I need to run some commands as superuser on a
    remote machine.
    I am using net::Telnet to login to the remote machine when i type
    $telnet->cmd("su - root"); the prompt ( I guess) waits for me to type
    the password on the remote machine and control never comes back :-(

    Is there any work around? any otehr module that could help...
    i thought about sudo but that too need password for the first time.

    Please suggest

    Nilendu
    , Apr 8, 2004
    #1
    1. Advertising

  2. wrote:

    > Hello,
    >
    > I have a problem. I need to run some commands as superuser on a
    > remote machine.
    > I am using net::Telnet to login to the remote machine when i type
    > $telnet->cmd("su - root"); the prompt ( I guess) waits for me to type
    > the password on the remote machine and control never comes back :-(
    >
    > Is there any work around? any otehr module that could help...
    > i thought about sudo but that too need password for the first time.
    >
    > Please suggest
    >
    > Nilendu


    I use expect (1) for this sort of thing. And use ssh instead of telnet.

    gtoomey
    Gregory Toomey, Apr 8, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pete Johansen

    NET::Telnet prompt regular expression

    Pete Johansen, May 5, 2004, in forum: Perl
    Replies:
    0
    Views:
    1,140
    Pete Johansen
    May 5, 2004
  2. Jim Isaacson
    Replies:
    5
    Views:
    602
    Default User
    Nov 5, 2004
  3. Carcarius
    Replies:
    0
    Views:
    290
    Carcarius
    Dec 6, 2007
  4. Eric Lewton
    Replies:
    3
    Views:
    111
    Eric Lewton
    Dec 1, 2003
  5. mike

    getting rid of telnet prompt

    mike, Jan 9, 2004, in forum: Perl Misc
    Replies:
    1
    Views:
    115
    Walter Roberson
    Jan 9, 2004
Loading...

Share This Page