[Ssh-sftp-perl-users] =?utf-8?b?TkVUOjpTU0gyIGFuZCBTVERFUlIg4oCR?= =?utf-8?q?_Poll/read?=
Brought to you by:
dbrobins
From: Frank C. <car...@ld...> - 2006-10-24 13:53:59
|
Gentlemen,=20=20=20=20 Hopefully this email will make it through to the forum. I've noticed sourc= eforge=20 has had many problems lately.=20 I've been working for several weeks working through this new module and lov= e=20 what I'm seeing. Easier installation plus the speed at which the code exec= utes=20 it great! I'm very familiar with the Net::SSH::Perl module and have made t= he=20 jump to NET::SSH2.=20=20=20=20 Everything was working great until I attempted to read STDERR across the SS= H=20 channel. Now I'm falling all over the place. I've read perldoc for Channe= l and=20 Net::SSH2. I've examined Rover and POE::Net::SSH2 coding to help understan= d how=20 I can read STDERR. I'm wondering if I'm making this tougher than it needs = to=20 be. Here is what I'm trying to do.=20=20=20=20 {snip}=20=20 # Open a channel and create a shell.=20 my $chan =3D $ssh2=E2=80=91>channel();=20 $chan=E2=80=91>shell();=20 # Execute a command and pass along the users password.=20 print $chan sudo cat /etc/passwd \n;=20 print STDERR $password;=20 # Read STDERR subchannel=20 my ($error, $buf);=20 print $chan=E2=80=91>read($buf, 1024);=20 Any thoughts on how I can push a password to sudo through STDERR? I think = I'm close. I've even tried=20 print $_ while <$chan>;=20 $chan->close;=20 Thanks!=20 ---------------------------------------------------------------------- NOTICE: This email message is for the sole use of the intended recipient(s)= and may contain confidential and privileged information. Any unauthorized = review, use, disclosure or distribution is prohibited. If you are not the i= ntended recipient, please contact the sender by reply email and destroy all= copies of the original message. |