my %args = (
user => 'user',
password => 'password',
ssh_args => [
debug => 1,
options => [
"PreferredAuthentications 'keyboard-interactive,password,hostbased,publickey'",
]
],
);
####
eval { $sftp = Net::SFTP->new($host, %args) };
die "Connection failed: $!\n" if $!;
die "No SFTP object\n" unless $sftp;
####
wolf: Reading configuration data /home/insaniac/.ssh/config
wolf: Reading configuration data /etc/ssh_config
wolf: Connecting to bear, port 22.
wolf: Remote protocol version 2.0, remote software version OpenSSH_4.2p1 Debian-4
wolf: Net::SSH::Perl Version 1.28, protocol version 2.0.
wolf: No compat match: OpenSSH_4.2p1 Debian-4.
wolf: Connection established.
wolf: Sent key-exchange init (KEXINIT), wait response.
wolf: Algorithms, c->s: 3des-cbc hmac-sha1 none
wolf: Algorithms, s->c: 3des-cbc hmac-sha1 none
wolf: Entering Diffie-Hellman Group 1 key exchange.
wolf: Sent DH public key, waiting for reply.
wolf: Received host key, type 'ssh-dss'.
wolf: Host 'bear' is known and matches the host key.
wolf: Computing shared secret key.
wolf: Verifying server signature.
wolf: Waiting for NEWKEYS message.
wolf: Enabling incoming encryption/MAC/compression.
wolf: Send NEWKEYS, enable outgoing encryption/MAC/compression.
wolf: Sending request for user-authentication service.
wolf: Service accepted: ssh-userauth.
wolf: Trying empty user-authentication request.
wolf: Authentication methods that can continue: publickey,keyboard-interactive.
wolf: Next method to try is publickey.
wolf: Trying pubkey authentication with key file '/home/insaniac/.ssh/id_dsa'
wolf: Authentication methods that can continue: publickey,keyboard-interactive.
wolf: Next method to try is publickey.
Connection failed: No such file or directory