Hallo,
ich versuche, mit Net::SFTP eine Verbindung zum Webserver aufzubauen, um später Dateien zu übertragen. Allerdings klappt der Vebindungsaufbau nicht.
Mein Testscript sieht aktuell so aus:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!C:/Strawberry/perl/bin/perl
use strict;
use warnings;
use Net::SFTP;
use Data::Dumper; # Ausgabe von Datenstrukturen für Debug-Zwecke; Syntax 'print Dumper ( @foo );'
my $host = "webserver";
my %args = (
user => 'user',
password => 'passwort',
debug => 'true',
);
# Make connection
my $sftp = Net::SFTP->new($host, %args);
# Check Status
$sftp->status;
print Dumper ($sftp);
Es erfolgt diese Log-Ausgabe:
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
SS-L5511: Reading configuration data C:\Users\ss\.ssh\config
SS-L5511: Reading configuration data C:\WINDOWS\ssh_config
SS-L5511: Connecting to webserver, port 22.
SS-L5511: Remote version string: SSH-2.0-mod_sftp
SS-L5511: Remote protocol version 2.0, remote software version mod_sftp
SS-L5511: Net::SSH::Perl Version 2.14, protocol version 2.0.
SS-L5511: No compat match: mod_sftp.
SS-L5511: Connection established.
SS-L5511: Sent key-exchange init (KEXINIT), waiting for response.
SS-L5511: Using curve25519-sha256@libssh.org for key exchange
SS-L5511: Host key algorithm: ssh-ed25519
SS-L5511: Algorithms, c->s: aes256-ctr hmac-sha2-512 none
SS-L5511: Algorithms, s->c: aes256-ctr hmac-sha2-512 none
SS-L5511: Generating ephemeral key pair.
SS-L5511: Entering Curve 25519 Key Exchange.
SS-L5511: Sent client public key, waiting for reply.
SS-L5511: Received host key, type 'ssh-ed25519'.
SS-L5511: Host 'webserver' is known and matches the host key.
SS-L5511: Verifying server signature.
SS-L5511: Send NEWKEYS.
SS-L5511: Waiting for NEWKEYS message.
SS-L5511: Enabling encryption/MAC/compression.
SS-L5511: Sending request for user-authentication service.
SS-L5511: SSH2_MSG_EXT_INFO received
SS-L5511: SSH Extension activated: server-sig-algs=ssh-ed25519,rsa-sha2-256,rsa-sha2-512,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss
SS-L5511: Service accepted: ssh-userauth.
SS-L5511: Trying empty user-authentication request.
SS-L5511: Authentication methods that can continue: publickey,password.
SS-L5511: Next method to try is publickey.
SS-L5511: Trying pubkey authentication with key file 'C:\Users\ss\.ssh\id_ed25519'
SS-L5511: Authentication methods that can continue: publickey,password.
SS-L5511: Next method to try is publickey.
SS-L5511: Trying pubkey authentication with key file 'C:\Users\ss\.ssh\id_rsa'
Wrong key type at C:/Strawberry/perl/site/lib/Net/SSH/Perl/Auth/PublicKey.pm line 83.
Wenn ich mit WinSCP und den identischen Zugangsdaten eine Verbindung aufbaue, klappt's einwandfrei.
Wo könnte der Fehler liegen?
Danke und Viele Grüße Stefan