Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Hi Mongers,

I'm writting scripts that will get information on firewall Linux Debian from a Windows server, and to get my job done, I think to use Net::SSH::Perl (version 1.29).

But i'm getting two different problem with this module, one is when I trying to logon on debian OpenSSH 3.8.1p1. In this situation i get the 'Permission denied', like code and debug message bellow,

use Net::SSH::Perl; my $fw = Net::SSH::Perl->new( 'server1', debug => 1 ); $fw->login( 'root','1234567890'); my ($stdout, $stderr, $exit) = $fw->cmd('ls -lh /etc'); print $stdout; ############## OUTPRINT DEBUG ######## client_win2k: Reading configuration data /.ssh/config client_win2k: Reading configuration data /etc/ssh_config client_win2k: Connecting to server1, port 22. client_win2k: Socket created, turning on blocking... client_win2k: Remote protocol version 2.0, remote software version Ope +nSSH_3.8.1p1 Debian-8.sarge.4 client_win2k: Net::SSH::Perl Version 1.29, protocol version 2.0. client_win2k: No compat match: OpenSSH_3.8.1p1 Debian-8.sarge.4. client_win2k: Connection established. client_win2k: Sent key-exchange init (KEXINIT), wait response. client_win2k: Algorithms, c->s: 3des-cbc hmac-sha1 none client_win2k: Algorithms, s->c: 3des-cbc hmac-sha1 none client_win2k: Entering Diffie-Hellman Group 1 key exchange. client_win2k: Sent DH public key, waiting for reply. client_win2k: Received host key, type 'ssh-dss'. client_win2k: Host 'server1' is known and matches the host key. client_win2k: Computing shared secret key. client_win2k: Verifying server signature. client_win2k: Waiting for NEWKEYS message. client_win2k: Enabling incoming encryption/MAC/compression. client_win2k: Send NEWKEYS, enable outgoing encryption/MAC/compression +. client_win2k: Sending request for user-authentication service. client_win2k: Service accepted: ssh-userauth. client_win2k: Trying empty user-authentication request. client_win2k: Authentication methods that can continue: publickey,keyb +oard-interactive. client_win2k: Next method to try is publickey. Permission denied at C:\Test\t.pl line 3
or... when I trying to execute a single command (Debian OpenSSH 3.0). My code stop response.
use Net::SSH::Perl; my $fw = Net::SSH::Perl->new( 'server2', debug => 1 ); $fw->login( 'root','1234567890'); my ($stdout, $stderr, $exit) = $fw->cmd('ls -lh /etc'); print $stdout; ############## OUTPRINT DEBUG ######## client_win2k: Reading configuration data /.ssh/config client_win2k: Reading configuration data /etc/ssh_config client_win2k: Connecting to server2, port 22. client_win2k: Remote protocol version 2.0, remote software version Ope +nSSH_3.0.2p1 Debian 1:3.0.2p1-9 client_win2k: Net::SSH::Perl Version 1.29, protocol version 2.0. client_win2k: No compat match: OpenSSH_3.0.2p1 Debian 1:3.0.2p1-9. client_win2k: Connection established. client_win2k: Sent key-exchange init (KEXINIT), wait response. client_win2k: Algorithms, c->s: 3des-cbc hmac-sha1 none client_win2k: Algorithms, s->c: 3des-cbc hmac-sha1 none client_win2k: Entering Diffie-Hellman Group 1 key exchange. client_win2k: Sent DH public key, waiting for reply. client_win2k: Received host key, type 'ssh-dss'. client_win2k: Permanently added 'server2' to the list of known hosts. client_win2k: Computing shared secret key. client_win2k: Verifying server signature. client_win2k: Waiting for NEWKEYS message. client_win2k: Enabling incoming encryption/MAC/compression. client_win2k: Send NEWKEYS, enable outgoing encryption/MAC/compression +. client_win2k: Sending request for user-authentication service. client_win2k: Service accepted: ssh-userauth. client_win2k: Trying empty user-authentication request. client_win2k: Authentication methods that can continue: publickey,pass +word,keyboard-interactive. client_win2k: Next method to try is publickey. client_win2k: Next method to try is password. client_win2k: Trying password authentication. client_win2k: Login completed, opening dummy shell channel. client_win2k: channel 0: new [client-session] client_win2k: Requesting channel_open for channel 0. client_win2k: channel 0: open confirm rwindow 0 rmax 16384 client_win2k: Got channel open confirmation, requesting shell. client_win2k: Requesting service shell on channel 0. client_win2k: channel 1: new [client-session] client_win2k: Requesting channel_open for channel 1. client_win2k: Entering interactive session. client_win2k: Sending command: ls -lh /etc client_win2k: Requesting service exec on channel 1. client_win2k: channel 1: open confirm rwindow 0 rmax 16384
Thanks for any help...

Solli Moreira Honorio
Sao Paulo - Brazil

In reply to Net::SSH::Perl not working on Windows server by shonorio

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2024-04-23 21:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found