[Ssh-sftp-perl-users] SSH Pubkey problem
Brought to you by:
dbrobins
From: Cali <cit...@in...> - 2005-05-25 16:21:54
|
I'm trying to setup a connection, and in some host i did but in others i can´t. This is my script: use Net::SSH::Perl; use Net::SFTP; my $host = "xxxxx"; my $identity = $ENV{HOME}."/.ssh/id_rsa"; my %params = (debug =>1, # identity_files =>[$identity], options =>["HostbasedAuthentication no","PasswordAuthentication no","PubkeyAuthentication no"], protocol => '2' # port => 80 ); #my %args = ( # 'user' => 'xxxxxx', # 'password' => 'xxxxxx', # 'debug' => '1', # 'ssh_args' => ["HostbasedAuthentication yes","PasswordAuthentication yes"] #); #my $sftp = Net::SFTP->new($host,%args); #$sftp->put("yo.txt", "/home/cguerrero/yo.txt"); my $cfg = Net::SSH::Perl::Config->new($host); $cfg->read_config("/etc/ssh_config"); $cfg->merge_directive("PubkeyAuthentication no"); my $ssh = Net::SSH::Perl->new($host,%params); $ssh->login('xxxxx','xxxx'); my ($stdout, $stderr, $exit) = $ssh->cmd("mkdir kali"); warn ("error performing command: $command ($stderr)") if ($exit); print $stdout; print "Envio archivo"; exit; And this is what i get on the screen: cluster1 sftp # perl sftp.pl cluster1: Reading configuration data /root/.ssh/config cluster1: Reading configuration data /etc/ssh_config cluster1: Allocated local port 1023. cluster1: Connecting to 10.22.6.90, port 22. cluster1: Remote protocol version 2.0, remote software version OpenSSH_3.8.1p1 Debian 1:3.8.1p1-11ubuntu3.1 cluster1: Net::SSH::Perl Version 1.25, protocol version 2.0. cluster1: No compat match: OpenSSH_3.8.1p1 Debian 1:3.8.1p1-11ubuntu3.1. cluster1: Connection established. cluster1: Sent key-exchange init (KEXINIT), wait response. cluster1: Algorithms, c->s: 3des-cbc hmac-sha1 none cluster1: Algorithms, s->c: 3des-cbc hmac-sha1 none cluster1: Entering Diffie-Hellman Group 1 key exchange. cluster1: Sent DH public key, waiting for reply. cluster1: Received host key, type 'ssh-dss'. cluster1: Host '10.22.6.90' is known and matches the host key. cluster1: Computing shared secret key. cluster1: Verifying server signature. cluster1: Waiting for NEWKEYS message. cluster1: Enabling incoming encryption/MAC/compression. cluster1: Send NEWKEYS, enable outgoing encryption/MAC/compression. cluster1: Sending request for user-authentication service. cluster1: Service accepted: ssh-userauth. cluster1: Trying empty user-authentication request. cluster1: Authentication methods that can continue: publickey,keyboard-interactive. cluster1: Next method to try is publickey. Permission denied at sftp.pl line 25 Any idea???? thanx |