Solved ssh public keys

Hello Unix gurus!

I just setup 3 linux machines with ssh running PublicKeyAuthentication.

Tumbleweed to Ubuntu server(acting as host)
Tumbleweed to Fedora-38 (acting as host)
Tumbleweed to Debian-12 (acting as host)

All instances are working fine.

I just tried a 4th instance to FreeBSD 13.1
(The BSD box is presently working fine as a samba server for a Windoze box)
But, even though I followed the same ssh setup procedures, it is, of course, not working on BSD.
As long as I leave BSD set for password authentication, it connects.

So, I don’t know; I have triple checked the sshd_config, etc, etc.
Can anyone offer any solutions?
 
What do you mean "of course, not working on BSD"?

I assure you, FreeBSD, and all other flavours of BSD are just fine.

What does
Code:
ssh -vvv
tell you?
 
Please doublecheck /var/log/auth.log
Of course you can see log records like wrong permissions on .ssh/authorized_keys
Ssh key auth don't require any sshd_config tuning except the case when you like to completely disable password auth.
 
it is, of course, not working on BSD.
OpenSSH was invented and is maintained on BSD systems.

I use it extensively with Debian, Ubuntu, and FreeBSD systems, without issues.

To assist, we need a little more information than "not working".

Is the sshd(8) running on the FreeBSD server? Show us the output of service sshd status.

As thatchrisp has suggested, show us the output of ssh -vvv when connecting from the client.
 
Do you use
Code:
AuthenticationMethods
to specify exactly which authentication methods must succeed ?
Do you need to use pam for authentification (like if you want to use 2fa modules for examples) ?
What is your configuration ?
 
Hello Unix gurus!

I just setup 3 linux machines with ssh running PublicKeyAuthentication.

Tumbleweed to Ubuntu server(acting as host)
Tumbleweed to Fedora-38 (acting as host)
Tumbleweed to Debian-12 (acting as host)

All instances are working fine.

I just tried a 4th instance to FreeBSD 13.1
(The BSD box is presently working fine as a samba server for a Windoze box)
But, even though I followed the same ssh setup procedures, it is, of course, not working on BSD.
As long as I leave BSD set for password authentication, it connects.

So, I don’t know; I have triple checked the sshd_config, etc, etc.
Can anyone offer any solutions?

Are you trying this as root?
 
I'm assuming you are trying to do "Tumbleweed to FreeBSD", is that correct? What OS is running on Tumbleweed?
As others ask, more info needed, look at the log files, what user, etc.
 
No need to configure anything with sshd_config on the FreeBSD side, the default will allow both password and key logins and should work just fine. Root logins are disabled though.
 
Hi,
Thanks to all for the replies, gentlemen.

It had been a long day of installing 3 new OSes and setting up samba & ssh.
I took a look in the auth.log and found a clue.
Though I had the id_rsa.pub & authorized_keys files chmodded to 600, I had foolishly left the .ssh folder too high –probably because of fiddling with the samba setup.

As soon as I corrected that, ssh dropped the user-password question, accepted the key, and asked for my extra passphrase.. So, all is as it should be -- ssh is using pubkey only -- PasswordAuthentication is reset to NO..

I don’t spend as much time with FreeBSD as I should. I’m utilizing it as a no-GUI, command only samba & ssh server.

I appreciate all the replies.
I’m not sure how to mark this thread as solved – but it is.
Thanks again!
 
  • Like
Reactions: mer
Back
Top