Leser: 2
|< 1 2 >| | 12 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
...
use strict;
use Net::SSH::W32Perl;
my $host = "...";
my $user = "...";
my $pass = "...";
my $ssh = Net::SSH::W32Perl->new($host);
$ssh->login($user,$pass);
1
2
my ($stdout,$stderr,$exit) = $ssh->cmd("ls -l"); #Bsp., bei allen Befehlen das selbe!
print $stdout;
1
2
3
4
5
6
7
8
IO::Socket::INET at c:/perl/site/lib/NET/SSH/Perl/SSH2.pm line 295
IO::Socket::INET at c:/perl/site/lib/NET/SSH/Perl/SSH2.pm line 295
IO:String at c:/perl/site/lib/NET/SSH/Perl/Channel.pm line 110
IO::Socket::INET at c:/perl/site/lib/NET/SSH/Perl/SSH2.pm line 295
IO:String at c:/perl/site/lib/NET/SSH/Perl/Channel.pm line 110
IO::Socket::INET at c:/perl/site/lib/NET/SSH/Perl/SSH2.pm line 295
IO:String at c:/perl/site/lib/NET/SSH/Perl/Channel.pm line 118
IO::Socket::INET at c:/perl/site/lib/NET/SSH/Perl/SSH2.pm line 295
my $ssh = Net::SSH::W32Perl->new($host, protocol=>2, debug =>1);
my ($stdout,$stderr,$exit) = $ssh->cmd("ls", "-l");
$ssh->shell;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
XXX: Reading configuration data /.ssh/config
XXX: Reading configuration data /etc/ssh_config
XXX: Connecting to ******, port 22. #editiert
XXX: Socket created, turning on blocking...
XXX: Remote protocol version 1.99, remote software version OpenSSH_3.4p1
XXX: Net::SSH::Perl Version 1.23_01, protocol version 2.0.
XXX: No compat match: OpenSSH_3.4p1.
XXX: Connection established.
XXX: Sent key-exchange init (KEXINIT), wait response.
XXX: Algorithms, c->s: 3des-cbc hmac-sha1 none
XXX: Algorithms, s->c: 3des-cbc hmac-sha1 none
XXX: Entering Diffie-Hellman Group 1 key exchange.
XXX: Sent DH public key, waiting for reply.
XXX: Received host key, type 'ssh-dss'.
XXX: Host '******' is known and matches the host key. #editiert
XXX: Computing shared secret key.
XXX: Verifying server signature.
XXX: Waiting for NEWKEYS message.
XXX: Enabling incoming encryption/MAC/compression.
XXX: Send NEWKEYS, enable outgoing encryption/MAC/compression.
XXX: Sending request for user-authentication service.
XXX: Service accepted: ssh-userauth.
XXX: Trying empty user-authentication request.
XXX: Authentication methods that can continue: publickey,password.
XXX: Next method to try is publickey.
XXX: Next method to try is password.
XXX: Trying password authentication.
XXX: Login completed, opening dummy shell channel.
XXX: channel 0: new [client-session]
XXX: Requesting channel_open for channel 0.
XXX: channel 0: open confirm rwindow 0 rmax 32768
XXX: Got channel open confirmation, requesting shell.
XXX: Requesting service shell on channel 0.
XXX: channel 1: new [client-session]
XXX: Requesting channel_open for channel 1.
XXX: Entering interactive session.
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
XXX: Sending command: ls -l
XXX: Requesting service exec on channel 1.
XXX: channel 1: open confirm rwindow 0 rmax 32768
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110
XXX: channel 1: rcvd eof
XXX: channel 1: output open -> drain
XXX: input_channel_request: rtype exit-status reply 0
XXX: channel 1: rcvd close
XXX: channel 1: input open -> closed
XXX: channel 1: close_read
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118
IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295
XXX: channel 1: obuf empty
XXX: channel 1: output drain -> closed
XXX: channel 1: close_write
XXX: channel 1: send close
XXX: channel 1: full closed
|< 1 2 >| | 12 Einträge, 2 Seiten |