Koozali.org: home of the SME Server

[SOLVED] ssh can't access to server with key

Offline gieres

  • *
  • 213
  • +0/-0
[SOLVED] ssh can't access to server with key
« 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.
« Last Edit: July 09, 2018, 10:39:45 PM by gieres »

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: ssh can't access to server with key
« Reply #1 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
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline gieres

  • *
  • 213
  • +0/-0
Re: ssh can't access to server with key
« Reply #2 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.

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: ssh can't access to server with key
« Reply #3 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.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline gieres

  • *
  • 213
  • +0/-0
[SOLVED] Re: ssh can't access to server with key
« Reply #4 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.

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: [SOLVED] ssh can't access to server with key
« Reply #5 on: July 09, 2018, 11:37:04 PM »
Hehe... we've all been there.

Glad you have it working.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation