Koozali.org: home of the SME Server

Obsolete Releases => SME Server 9.x => Topic started by: gieres on July 08, 2018, 05:58:21 PM

Title: [SOLVED] ssh can't access to server with key
Post by: gieres on July 08, 2018, 05:58:21 PM
Hi,
I install a new server 9.2 in mode server and gateway. I create only one user, no group, etc.
I can connect to this server as root from LAN (Debian workstation) without keys (with password).
I can't connect with keys.
With the same keys, I can connect to another old kOOZALI server 9.2.
In the two Koozali servers, the only difference beetween the 2 files /etc/ssh/sshd_config is ListenAddress
On the new server, it's the server LAN adress ; on the old, it's 0.0.0.0

Thank you for the attention.
Title: Re: ssh can't access to server with key
Post by: ReetP on July 08, 2018, 06:16:09 PM
Did you read the wiki?

Did you paste your public key in authorized_keys?

Have you checked the ssh setting in server-manager? The difference in Listen Address is because you probably have sshd set to the default LAN only connections.

Again, read the wiki.

Check:

config show sshd
Title: Re: ssh can't access to server with key
Post by: gieres on July 08, 2018, 09:20:08 PM
Hi,
Thank you.
Did you read the wiki?
Yes.
Quote
Did you paste your public key in authorized_keys?
Yes, I have paste first in /root/.ssh/authorized_keys, then in authorized_keys2 (as in my old Koozali).
Quote
Have you checked the ssh setting in server-manager?
When connection with password is on, connection work.
When it's forbidden, response is «denied public key» or something equivalent.

Thanks in advance.
Title: Re: ssh can't access to server with key
Post by: ReetP on July 08, 2018, 09:55:56 PM
Don't use keys2... it is becoming deprecated. You only need it once anyway.

Check your logs and use ssh -v to see what happens.

If the key is correct it should just work.
Title: [SOLVED] Re: ssh can't access to server with key
Post by: gieres on July 09, 2018, 10:39:07 PM
Hi,
Excuse me, I'm tired.
I write authorized.keys instead of authorized_keys as in the post...

Thanks you ReetP.
Title: Re: [SOLVED] ssh can't access to server with key
Post by: ReetP on July 09, 2018, 11:37:04 PM
Hehe... we've all been there.

Glad you have it working.