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

This in no way answers your actual question, but it may be a solution to the problem

why not skip the keyboard-interactive all together, and use one of the earlier things on the list, one that won't ever let you down...

How about passwordless Ssh keys? they're quick, fun and easy to use!
This should be enough to get you going, you may want to restirct the commands that can be run with this key, etc. (ask the man, he'll know)

Just type the things in bold, and you're done
f00li5h@localhost:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/f00li5h/.ssh/id_rsa): enter
Enter passphrase (empty for no passphrase): enter
Enter same passphrase again: enter
Your identification has been saved in /home/f00li5h/.ssh/id_rsa.
Your public key has been saved in /home/f00li5h/.ssh/id_rsa.pub.
The key fingerprint is: omitted

# now append the new key to the list of keys allowed on the remote host
f00li5h@localhost:~$ cat ~/.ssh.id_rsa.pub | ssh $otherbox ' cat >> .ssh/authorized_keys'
Password: enter
that will be the last time you have to give a password for $user_you_are_now@$host_you_are_at_now to ssh to $user_you_specified@$otherbox

Just make sure that your home directory, and your ssh directory are not group or world writable, or ssh will ignore the hey (it's a little paranoid, don't ya know)

I've made whole bundles of assumptions here, but it still may help. (this is also super handy if you have home directories common to many boxes, because the keys end up on all of the machines)

will: do{ perl programming } for $cash;

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

    Hi!

    I'd love to use SSH keys, but I can't. Why? because I manage about 3000 servers (now you can see why this Perl script would be handy!) and about 30% of those use a shared home directory and my key is in $HOME/.ssh/authorized_keys.
    For some reason, the very first time I connect to the server, it asks me for a password. From then on, it works with the key.

    That's not the only problem, there are other servers where my home directory is a symlink to somewhere on the filesystem and SSH refuses to read my key in that sort of scenario, so SSH keys don't work on these systems (and it's a lot of them!!). Only conclusion I came to is that SSH does not read your key if your home dir is a symlink, as I tried changing permissions all over the place and no luck.

    I figured since some work, some don't, I'll just try and work with password prompts and be done with it.

    It's probably worth saying that I don't have root on the 3000 servers, otherwise I could probably fix a lot of these issues I'm having with SSH keys.

      Hi,

      You will also have problems when you use different SSH programs, propietary SSH as for example from ssh.com works different than OpenSSH...

      Regards,

      fmerges at irc.freenode.net