in reply to fork + Expect.pm + ssh == success!

Is there any specific reason for not using Net::SSH::Perl here?

use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $pass); my($stdout, $stderr, $exit) = $ssh->cmd($cmd);

Note you're never calling mysub(), you're only referencing it in void context. Use mysub; instead of \&mysub;.

You seem to want to replace threads with forks. Why not use forks then? It's a drop-in replacement for threads. (I expect Net::SSH::Perl to work with threads. Haven't tried, though.)

Note that if *you* can decrypt a password, someone else can too! Consider using keys instead of passwords.

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.

Replies are listed 'Best First'.
Re: Re: fork + Expect.pm + ssh == success!
by Cmdr_Tofu (Scribe) on Dec 29, 2002 at 00:13 UTC
    Hi, thanks for this information. Net::SSH is something I did not know about. It looks very interesting. However, (from glancing briefly over the documentation), it does not look like it supports passwords or passphrase encrypted private-keys. We require public key and password authentication.

    For someone else to decrypt the file containing my passwords (and passphrases), they would have to sniff my keyboard as I type in the decryption salt every time I run.

    forks (E/EL/ELIZABETH/forks-0.01.tar.gz) looks extremely cool, and I am going to play with this very soon :) I guess it pays to search CPAN first! Thanks for your help!

    Rohit

      Net::SSH is something I did not know about. It looks very interesting. However, (from glancing briefly over the documentation), it does not look like it supports passwords or passphrase encrypted private-keys.

      Net::SSH supports passwords from the tty and keys. It's just a mere wrapper for ssh itself. Net::SSH::Perl, on the other hand, does not just interface with ssh, but implements the ssh protocol in Perl. It supports passing passwords, and I think keys too.

      - Yes, I reinvent wheels.
      - Spam: Visit eurotraQ.