cmv has asked for the wisdom of the Perl Monks concerning the following question:
Looking for guidance on debugging the following issue:
I have generated an RSA key on my system that works fine when I use ssh(1) to access my login on either of two target hosts in my network (craigs-mac-mini or new-mac-mini).
Craigs-New-MBP: Reading configuration data /Users/cmv/.ssh/config Craigs-New-MBP: Reading configuration data /etc/ssh_config Craigs-New-MBP: Connecting to new-mac-mini, port 22. Craigs-New-MBP: Remote version string: SSH-2.0-OpenSSH_9.0 Craigs-New-MBP: Remote protocol version 2.0, remote software version O +penSSH_9.0 Craigs-New-MBP: Net::SSH::Perl Version 2.14, protocol version 2.0. Craigs-New-MBP: No compat match: OpenSSH_9.0. Craigs-New-MBP: Connection established. Craigs-New-MBP: Sent key-exchange init (KEXINIT), waiting for response +. Craigs-New-MBP: Using curve25519-sha256@libssh.org for key exchange Craigs-New-MBP: Host key algorithm: ssh-ed25519 Craigs-New-MBP: Algorithms, c->s: chacha20-poly1305@openssh.com <impli +cit> none Craigs-New-MBP: Algorithms, s->c: chacha20-poly1305@openssh.com <impli +cit> none Craigs-New-MBP: Generating ephemeral key pair. Craigs-New-MBP: Entering Curve 25519 Key Exchange. Craigs-New-MBP: Sent client public key, waiting for reply. Craigs-New-MBP: Received host key, type 'ssh-ed25519'. Craigs-New-MBP: Host 'new-mac-mini' is known and matches the host key. Craigs-New-MBP: Verifying server signature. Craigs-New-MBP: Send NEWKEYS. Craigs-New-MBP: Waiting for NEWKEYS message. Craigs-New-MBP: Enabling encryption/MAC/compression. Craigs-New-MBP: Sending request for user-authentication service. Craigs-New-MBP: SSH2_MSG_EXT_INFO received Craigs-New-MBP: SSH Extension activated: server-sig-algs=ssh-ed25519,s +sh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sh +a2-nistp384,ecdsa-sha2-nistp521 Craigs-New-MBP: SSH Extension activated: publickey-hostbound@openssh.c +om=0 Craigs-New-MBP: Service accepted: ssh-userauth. Craigs-New-MBP: Trying empty user-authentication request. Craigs-New-MBP: Authentication methods that can continue: publickey,pa +ssword,keyboard-interactive. Craigs-New-MBP: Next method to try is publickey. Craigs-New-MBP: Publickey: testing agent key 'cvotava@peoplegistics.co +m' Craigs-New-MBP: Authentication methods that can continue: publickey,pa +ssword,keyboard-interactive. Craigs-New-MBP: Next method to try is publickey. Craigs-New-MBP: Publickey: testing agent key 'cvotava@peoplegistics.co +m' Craigs-New-MBP: Authentication methods that can continue: publickey,pa +ssword,keyboard-interactive. Craigs-New-MBP: Next method to try is publickey. Craigs-New-MBP: Trying pubkey authentication with key file '/Users/cmv +/.cmvtools/toolauth' Craigs-New-MBP: Authentication methods that can continue: publickey,pa +ssword,keyboard-interactive. Received disconnect message: Too many authentication failures at /Users/cmv/perl5/lib/perl5/darwin-thread-multi-2level/Net/SSH/Perl +/AuthMgr.pm line 159.
I believe I have checked all the basic things:
My perl script to use Net::SSH::Perl is pretty simple, attached below if you are interested.
What should I do next to try and find the issue?
Thanks!
-Craig
#!/opt/homebrew/bin/perl # # ssh -v -o "IdentityFile=$HOME/.cmvtools/toolauth" new-mac-mini # use strict; use warnings; use Net::SSH::Perl; my $host="new-mac-mini"; # FAILS #my $host="craigs-mac-mini"; # WORKS my $cmd="ls -las /"; my $user="cmv"; my $ssh = Net::SSH::Perl->new($host, debug=>1, protocol=>2, interactive=>0, identity_files =>[ "/Users/cmv/.cmvtools/toolauth" ], ); $ssh->login($user); my($stdout, $stderr, $exit) = $ssh->cmd($cmd); print "stdout=$stdout\n"; print "stderr=$stderr\n"; print "exit=$exit\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Successful RSA key fails with Net::SSH::Perl
by bliako (Abbot) on Apr 06, 2023 at 18:09 UTC | |
by cmv (Chaplain) on Apr 06, 2023 at 21:16 UTC |