Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Perl's Telnet vs. Expect Module

by logan (Curate)
on Dec 03, 2003 at 05:26 UTC ( #311832=note: print w/replies, xml ) Need Help??

in reply to Perl's Telnet vs. Expect Module

"I'm not worried about security" is one of the scariest phrases in the lexicon. Run your plan past your admin and see what he says about it. "I've considered the situation and security concerns have been addressed" is a far better response. Keep in mind that you'll be sending your password unencrypted, and it will have to be listed as plain text in your program, accessible to anyone who cares to look. Imagine what the weird intern might do with that information, especially when his internship is over.

Think about what your program will be used for and what servers it will run on. Can you use rsh or rcp instead of telnet? Also, you're not doing whatever you're doing as root are you? Don't if you can avoid it. If possible, require that the password be passed in as an argument at invocation. It's far better than putting the root password to a cluster of servers as plain text in a script that may get passed around like a fattie at Snoop Dogg's house.

Even if you're working on an isolated LAN, you have to consider what happens if someone gains access to the LAN. It's far better to have a second (or third) line of defense than to have one password give access to the whole system.

"What do I want? I'm an American. I want more."

Replies are listed 'Best First'.
Re: Re: Perl's Telnet vs. Expect Module
by gnork (Scribe) on Dec 03, 2003 at 11:55 UTC
    I would take a closer look at I use it frequently and it saves you a lot of time not fiddling around with Net::Telnet. Additionally, has a lot more functionality you will find very usefull.

    cat /dev/world | perl -e "(/(^.*? \?) 42\!/) && (print $1))"
      It sounds like Expect is the way to go. Below is what I want to do, does Expect still make sense ? I was to "push" a set of scripts to a remote system, execute them, collect logs and move then back to my server, then clean up the remote server. So, script executed remotely is not interactive, but I need to do other actions pre/post executing the script. btw - what is /dev/world ? I don't see it on my Linux/Unix boxes.
        If you cant see /dev/world, have a look at the Character Devices Section of the linux kernel configuration.

        Check (X) Emulate World
        (You will need to display experimental drivers for that)

        If it is checked, do a 'insmod world' at the commandline. ;o)

        cat /dev/world | perl -e "(/(^.*?\?) 42\!/) && (print $1))"
      Can you elaborate on some of the functionality that you find useful ??? I still trying to get a grasp on what's better, Telnet or Expect.
        Try here. It's the POD from CPAN's page for It'll tell you everything you need to know.

        "What do I want? I'm an American. I want more."

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://311832]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2018-03-17 19:00 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (225 votes). Check out past polls.