[Ssh-sftp-perl-users] ssh authentication / cipher / ? can't log in
Brought to you by:
dbrobins
|
From: Iain B. <ia...@ne...> - 2006-07-06 01:56:11
|
Hi all,
sorry for the cryptic subject, but I've been chasing this for a few days
and I can't figure out what's going on. I'm using
Net-SSH-Perl-1.30.tar.gz
Basically I'm getting a "permission denied" when I log in with
ssh->login. I know about eval, that's not the issue.
The problem is: I can't log in even with the correct username /
password. The CPU usage seems to hit 100% for a while, and eventually
fails after the debug message "Next method to try is publickey."
I checked the logs for the machine I'm ssh-ing to, and there are no
"failed log-in attempts" messages. Just to make sure, I logged in by
hand (command line) and saw the messages in the log.
I've searched all over google and the mailing list, but I still can't
find out why it's not working in my case.
Heres the script:
#!/usr/bin/perl -w
use strict;
use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new('172.16.0.52', debug=>1);
print "logging in\n";
eval {
$ssh->login('iain', 'abcd'); # real password replaced!
};
if ($@) {
die "Sftp connection failed:\n $@\n";
}
print "executing ls\n";
my($stdout, $stderr, $exit) = $ssh->cmd('ls');
print "stdout:\n$stdout\nstderr:\n$stderr\nexit: $exit\n";
# end of script
and here's the output. I added some <*** x seconds ***> to show you
where it uses 100% cpu and for roughly how long:
$ ./sshtest.pl
orpheus: Reading configuration data /home/iain/.ssh/config
orpheus: Reading configuration data /etc/ssh_config
orpheus: Connecting to 172.16.0.52, port 22.
orpheus: Remote version string: SSH-2.0-OpenSSH_4.3
orpheus: Remote protocol version 2.0, remote software version
OpenSSH_4.3
orpheus: Net::SSH::Perl Version 1.30, protocol version 2.0.
orpheus: No compat match: OpenSSH_4.3.
orpheus: Connection established.
logging in
orpheus: Sent key-exchange init (KEXINIT), wait response.
orpheus: Algorithms, c->s: 3des-cbc hmac-sha1 none
orpheus: Algorithms, s->c: 3des-cbc hmac-sha1 none
<*** 11 seconds ***>
orpheus: Entering Diffie-Hellman Group 1 key exchange.
orpheus: Sent DH public key, waiting for reply.
orpheus: Received host key, type 'ssh-dss'.
orpheus: Host '172.16.0.52' is known and matches the host key.
orpheus: Computing shared secret key.
<*** 11 seconds ***>
orpheus: Verifying server signature.
<*** 13 seconds ***>
orpheus: Waiting for NEWKEYS message.
orpheus: Enabling incoming encryption/MAC/compression.
orpheus: Send NEWKEYS, enable outgoing encryption/MAC/compression.
orpheus: Sending request for user-authentication service.
orpheus: Service accepted: ssh-userauth.
orpheus: Trying empty user-authentication request.
orpheus: Authentication methods that can continue:
publickey,keyboard-interactive.
orpheus: Next method to try is publickey.
Sftp connection failed:
Permission denied at ./sshtest.pl line 10
And lastly, when I log in with ssh by hand, it is almost
"instantaneous".
I would appreciate any tips to point me in the right direction - I tried
specifying different ciphers, different authentication methods, etc, but
the server logs don't even show an ssh failed or succeeded... The ip
address is definitely correct.
TIA,
--
Iain Buchanan <iaindb at netspace dot net dot au>
QOTD:
"She's about as smart as bait."
|