Perl Monk, Perl Meditation | |
PerlMonks |
Re: Net::SSH::Perl and suby fuzzyping (Chaplain) |
on Mar 08, 2002 at 21:26 UTC ( [id://150428]=note: print w/replies, xml ) | Need Help?? |
I was having the same problem myself with a project I'm working on. The following excerpt from the Net::SSH::Perl documentation may be pertinent... "..if you're running in an interactive session and you've not provided a password, you'll be prompted for one..." But what is interactive mode? It appears to be through the use of Net::SSH::Perl->shell(), which "Opens up an interactive shell on the remote machine and connects it to your STDIN. This is most effective when used with a pseudo tty; otherwise you won't get a command line prompt, and it won't look much like a shell. For this reason--unless you've specifically declined one--a pty will be requested from the remote machine, even if you haven't set the use_pty argument to new..." It sounds like the only way to connect interactively is to use shell() or grab the password, handing it off to login() beforehand. Hope this helps. -fuzzyping UPDATE:The problem is not what I described above... you're simply missing the interactive option with login. Your code should look something like...
FWIW, I'm still getting STDIN/tty errors to $err, but it is running interactively and asking for my password. It appears to be a limitation of su, requiring local tty control(?). There are others here who would be better qualified to answer that one. I have no problem running non-su commands, though. Good Luck! -fuzzyping
In Section
Seekers of Perl Wisdom
|
|