Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: IO::Pty, Net::Telnet and SSH

by duckyd (Hermit)
on Nov 04, 2006 at 03:21 UTC ( [id://582210] : note . print w/replies, xml ) Need Help??

in reply to IO::Pty, Net::Telnet and SSH [SOLVED]

FWIW, it works for me. Maybe the problem isn't the perl code, but how ssh is setup, E.G. for some reason it doesn't prompt your script at all? What if you try to ssh to localhost instead of a remote host? When you manually ssh in, are you prompted for a password? Should it match the regex /password: ?$/i ?

You don't mention what error the script is producing exactly....

Replies are listed 'Best First'.
Re^2: IO::Pty, Net::Telnet and SSH
by Anonymous Monk on Nov 04, 2006 at 13:03 UTC

    Yeah, I don't think it is the Perl code. It must be the way my /etc/ssh/ssh_config is setup or something.

    My test $host has been localhost. I've tried remote hosts as well but same result. When I manually SSH in to localhost, yes I am prompted for a password and yes, it should match the regex /password: ?$/i. I've played around with the regex to try and match anything but then realized the script is not actually getting the prompt, so no matter what I try and match it's not going to work.

    The output of the script is:

    problem connecting to host: Permission denied (publickey,password,keyb +oard-interactive)
    Of course, since it didn't manage to receive the password prompt, it never matched the regex.

    Thanks for your reply and if you have any suggestions, I look forward to reading them. It's one of those problems that has annoyed me enough to keep me trying stuff until it works :)

Re^2: IO::Pty, Net::Telnet and SSH
by gonza (Novice) on Nov 05, 2006 at 23:59 UTC


    Could you please tell me what version of OpenSSH/whatever you're using? also a copy of your /etc/ssh/ssh_config might be handy too, to compare it with mine.

    Thanks in advance!

Re^2: IO::Pty, Net::Telnet and SSH
by mb_perl (Initiate) on Jun 17, 2014 at 12:36 UTC
    Net::Telnet and SSH is worked fine for me too but device not /dev/pts/ entry still exist . its not the $pty->slave device node but its different may be its master device node i have tried $ssh->close but still no lock and process table showns "ssh -l user host " and "sshd user@pts/no" etried Can anyone have the idea what this device node ?