|
|
ru.cisco- RU.CISCO --------------------------------------------------------------------- From : Victor Melnichenko 2:5020/400 04 Sep 2006 14:42:01 To : All Subject : net::ssh::perl & cisco -------------------------------------------------------------------------------- Всем доброго времени суток! Хочу уйти от Net::Telnet::Cisco в сторону ssh. Поэтому помогите/научите подключаться к cisco1841 perl'овым скриптом по ssh v2 Hаписал такое: #!/usr/bin/perl -w use strict; use Net::SSH::Perl; my $cisco = $ARGV[0]; my $user = $ARGV[1]; my $pass = $ARGV[2]; use Net::SSH::Perl::Constants qw( :msg ); my $ssh = Net::SSH::Perl->new($cisco, protocol => 2, debug => 3); $ssh->login($user,$pass); $ssh->cmd("?\n"); Лог подключения: ./c_s.pl <cisco> <login> <pass> <localhost>: Reading configuration data /home/worm/.ssh/config <localhost>: Reading configuration data /etc/ssh_config <localhost>: Allocated local port 1023. <localhost>: Connecting to <cisco>, port 22. <localhost>: Remote version string: SSH-2.0-Cisco-1.25 <localhost>: Remote protocol version 2.0, remote software version Cisco-1.25 <localhost>: Net::SSH::Perl Version 1.30, protocol version 2.0. <localhost>: No compat match: Cisco-1.25. <localhost>: Connection established. <localhost>: Sent key-exchange init (KEXINIT), wait response. <localhost>: Algorithms, c->s: 3des-cbc hmac-sha1 none <localhost>: Algorithms, s->c: 3des-cbc hmac-sha1 none - --- тут думает почти одну минуту --- <localhost>: Entering Diffie-Hellman Group 1 key exchange. <localhost>: Sent DH public key, waiting for reply. <localhost>: Received host key, type 'ssh-rsa'. <localhost>: Host '<cisco>' is known and matches the host key. <localhost>: Computing shared secret key. <localhost>: Verifying server signature. <localhost>: Waiting for NEWKEYS message. <localhost>: Enabling incoming encryption/MAC/compression. <localhost>: Send NEWKEYS, enable outgoing encryption/MAC/compression. <localhost>: Sending request for user-authentication service. <localhost>: Service accepted: ssh-userauth. <localhost>: Trying empty user-authentication request. <localhost>: Authentication methods that can continue: password. <localhost>: Next method to try is password. <localhost>: Trying password authentication. <localhost>: Login completed, opening dummy shell channel. <localhost>: channel 0: new [client-session] <localhost>: Requesting channel_open for channel 0. <localhost>: Entering interactive session. <localhost>: Sending command: ? <localhost>: Requesting service exec on channel 0. <localhost>: channel 0: open confirm rwindow 1024 rmax 4096 <localhost>: input_channel_request: rtype exit-status reply 0 <localhost>: channel 0: rcvd eof <localhost>: channel 0: output open -> drain <localhost>: channel 0: rcvd close <localhost>: channel 0: input open -> closed <localhost>: channel 0: close_read <localhost>: input_channel_request: rtype exit-status reply 0 <localhost>: channel 0: obuf empty <localhost>: channel 0: output drain -> closed <localhost>: channel 0: close_write <localhost>: channel 0: send close <localhost>: channel 0: full closed Перед этим была такая ошибка Channel open failure: 1: reason 4 Гугл нашел http://www.cpanforum.com/threads/851 Что делаю не так? Может есть другие решения для решения задачи? Заранее всем спасибо! -- With Best Regards, Victor V. Melnichenko VVM7-UANIC --- ifmail v.2.15dev5.3 * Origin: Demos online service (2:5020/400) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.cisco/657725f38e7e.html, оценка из 5, голосов 22
|