Hi Monks,
I am new to perl programming i am trying to implementing a small code using Net::SSH2. I am trying to connect to one of my local machine & retrive the hostname of that machine using Net::SSH2 module, whenever i try executing the program then i just get hanged-up without any ouput.
use Net::SSH2; my $ssh2 = Net::SSH2->new(); $ssh2->debug(1); $ssh2->connect('machine') or die " Cannot connect to 219 "; $ssh2->auth_password('username','password') or die " username/password + is wrong "; print "Username/Password is correct\n"; my $chan2 = $ssh2->channel(); $chan2->shell(); print $chan2 "hostname -a\n"; print "LINE : $_" while <$chan2>; $chan2->close;
I want to know whether I am missing any points in implementing the logic.
Thanks in advance
pradeep
In reply to Net::SSH2 just hangs up without any output by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |