You are not logged in.

#1 Yesterday 18:11:57

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,735

[Solved]Advise on ssh public key debugging

I have two Arch boxes running in this room, on the same subnet.  One named odin, the other labbench.
I have a macbook air that I inherited.  I wiped it yesterday so it is a clean system.   I created a public keypair, and pasted this

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG9jJ70Cta3JN6/ITL5iBN4xRdYOS3t7noD7Jwo1XVo1 eric@Erics-MacBook-Air.local

key to the end the authorized_keys file for user ewaller on both odin and labbench.   There is a blank line at the end authorized_keys on both systems.

odin can ssh to labbench without issue.
The macbook can ssh to odin, no problem.
The macbook cannot connect to labbench.

When connecting from the macbook to labbench, it reports 'Permission denied (publickey)'
The following are posted to the journal of labbench.

Nov 28 10:09:01 labbench sshd-session[85593]: WARNING: connection from 192.168.1.177 port 49492 is not using a post-quantum key exchange algorithm: "ecdh-sha2-nistp256" [preauth]
Nov 28 10:09:01 labbench sshd-session[85593]: Connection closed by authenticating user ewaller 192.168.1.177 port 49492 [preauth]
Nov 28 10:09:01 labbench sshguard[535]: Attack from "192.168.1.177" on service SSH with danger 2.

odin and labbench are both synced as of yesterday, both running the 7.3.6 kernel.

What am I missing and how to I go about troubleshooting this?

Last edited by ewaller (Yesterday 20:43:26)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#2 Yesterday 18:40:29

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 79,087

Re: [Solved]Advise on ssh public key debugging

IP (range) restriction?
Can you authenticate by password?

Offline

#3 Yesterday 18:58:42

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,735

Re: [Solved]Advise on ssh public key debugging

seth wrote:

IP (range) restriction?

Note that I can find in the sshd configs.   I do use sshguard, but when it blocks a port, the firewall drops everything.  The journal entries would seem to counter indicate that.

Can you authenticate by password?

I am configured as 'PasswordAuthentication no' as that systems ssh port is exposed to the wild internet.  I could turn it on (briefly)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#4 Yesterday 19:07:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 79,087

Re: [Solved]Advise on ssh public key debugging

Inadvisable as long as the host is WAN-exposed, but taking it off the WAN would allow you to lower the protection level to analyze the situation w/o IP filter, sshguard and w/ password authentication.

Before that and in case you're using different UIDs to ssh in, see eg. https://bbs.archlinux.org/viewtopic.php … 3#p1770703 which also was the cause in https://superuser.com/questions/1726539 … 60-32-port

Offline

#5 Yesterday 19:09:19

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,735

Re: [Solved]Advise on ssh public key debugging

Okay, I enabled password login and was able to log in from the mac to labbench.   Pardon while I step away and turn that back off....

Edit:  Okay, I missed that there are verbosity flags available (RTFM Eric). Let me dig through and compare a lot of output....

Last edited by ewaller (Yesterday 19:20:21)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#6 Yesterday 20:11:44

dimich
Member
From: Kharkiv, Ukraine
Registered: 2009-11-03
Posts: 858

Re: [Solved]Advise on ssh public key debugging

ewaller wrote:

sshd-session[85593]: WARNING: connection from 192.168.1.177 port 49492 is not using a post-quantum key exchange algorithm: "ecdh-sha2-nistp256" [preauth]

Is there the same warning on odin when connecting from macbook?

I would also check macbook's ssh client configuration if there are some destination-specific settings.

ewaller wrote:

odin and labbench are both synced as of yesterday

With the same mirror? What are openssh versions on both?

Offline

#7 Yesterday 20:30:47

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,735

Re: [Solved]Advise on ssh public key debugging

dimich wrote:

Is there the same warning on odin when connecting from macbook?

Yes.

I would also check macbook's ssh client configuration if there are some destination-specific settings.

Not finding anything obvious.   Same thing happens if I force IPv4 or IPv6.

Just for fun, I just tried coming in through the router using my routers public address and using its NAT forwarding to labbench.  Same thing.

With the same mirror? What are openssh versions on both?

Probably  the same mirror.  But not guaranteed. both are running openssh 10.6p2-1.

Their sshd_config files are the same.  So are the contents of /etc/sshd_config.d


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#8 Yesterday 20:39:31

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 79,087

Re: [Solved]Advise on ssh public key debugging

Did you check the access to the key as was the problem in the other threads?
Or do you ssh in as "ewaller" on labbench from odin as well?

SIdebar: "labench", "la bench" - missed opportunity smile

Offline

#9 Yesterday 20:41:17

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,729
Website

Re: [Solved]Advise on ssh public key debugging

Usual suspect: File / directory permissions on ~/.ssh and children on client and servers, as well as the accompanying configuration on the servers.


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#10 Yesterday 20:41:43

-thc
Member
Registered: 2017-03-15
Posts: 1,236

Re: [Solved]Advise on ssh public key debugging

Have you tried "-ddd" debug mode on sshd?

Offline

#11 Yesterday 20:42:58

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,735

Re: [Solved]Advise on ssh public key debugging

Yeah, I am logging in as ewaller@labbench.local   

But....   I found the problem -- A loose nut in front of the keyboard.   I had added my public key to the authorized_keys backup file.   Facepalm.
Sorry for the noise.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#12 Yesterday 20:48:42

schard
Forum Moderator
From: Hannover
Registered: 2016-05-06
Posts: 2,729
Website

Re: [Solved]Advise on ssh public key debugging

Been there, done it. :-D


Inofficial first vice president of the Rust Evangelism Strike Force

Offline

#13 Yesterday 21:03:32

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 79,087

Re: [Solved]Advise on ssh public key debugging

That's why I don't make backups big_smile
Can we still blame emacs for this?

Though this genius has been editing a config forth and back and it should™ have worked and didn't and then I remembered that I was sudoedit'ing the file…
(No, not the stupid libinput LUA script - that inexplicably *did* change behaviors…)

Offline

#14 Yesterday 21:36:36

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,735

Re: [Solved]Advise on ssh public key debugging

seth wrote:

Can we still blame emacs for this?

Actually, yes.  Labbench is a headless HP laptop with a broken screen I use as a file server and to control my oscilloscope, arbitrary waveform generator, programmable power supply and my 3D printer..  I had connected via ssh from odin and was using emacs in a console.  emacs was in a dired pane on ~/.ssh/, I did a search for 'auth', the point moved to the line, and I missed that little '~' at the end of said line.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB