SSH Error: No supported authentication methods available (server sent public key)

Nyxynyx

On an Ubuntu 16.04 system on Google GCP, I need to create a new user hello and allow other users to SSH to the system as user hello using their current SSH keys.

Here's what I did to add my SSH public key to hello's authorized_keys:

sudo useradd -m hello -s /bin/bash
sudo mkdir /home/hello/.ssh
sudo chown hello:hello -R /home/hello
sudo chmod 777 /home/hello/.ssh
sudo cat ~/.ssh/authorized_keys >> /home/hello/.ssh/authorized_keys
sudo chmod 700 /home/hello/.ssh/
sudo chmod 600 /home/hello/.ssh/authorized_keys

Problem: When I try to SSH to the server as hello user, I get the error

Disconnected: No supported authentication methods available (server sent public key)

/var/log/auth.log contains

Nov 4 17:37:05 hello sshd[27298]: error: Received disconnect from 174.63.124.9 port 62346:14: No supported authentication methods available [preauth] Nov 4 17:37:05 hello sshd[27298]: Disconnected from 174.63.124.9 port 62346 [preauth]

What went wrong? Thank you!

Hubert

You need to change the owner of the file authorized_keys after it is created, since it will be owned by the user running the script.

Adding this as last line to your script should do the trick.

sudo chown hello:hello /home/hello/.ssh/authorized_keys

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

SSH Public Key - No supported authentication methods available (server sent public key)

From Dev

gcloud ssh -- No supported authentication methods available (server sent: publickey)

From Dev

AWS SFTP error Disconnected: No supported authentication methods available (server sent: publickey) on filezilla

From Dev

Tortoise git fails with No supported authentication methods available (server sent: publickey)

From Dev

Disconnected : No supported authentication methods available (server sent :publickey)

From Dev

AWS - Disconnected : No supported authentication methods available (server sent :publickey)

From Dev

disconnected: no supported authentication methods available (server sent: publickey, gssapi-with-mic)

From Dev

Moving files in Filezilla gives Disconnected: No supported authentication methods available (server sent: publickey)

From Dev

ssh no supported authentication methods supported

From Dev

Server key refused. No authentication methods available

From Dev

Server with ssh public key authentication with libssh

From Dev

Disconnected: no supported authentication methods available

From Dev

No supported authentication methods available in FileZilla

From Dev

SSH Public Key Authentication

From Dev

ssh public key authentication not working

From Dev

ssh public key authentication not working

From Dev

SSH failed public key authentication

From Dev

ssh public key authentication fails

From Dev

SSH public key error

From Dev

How do I prevent a "No supported authentication methods available" error when using TortoiseHg?

From Dev

adding ssh public key to server

From Dev

ssh no longer allows public key authentication

From Dev

ssh no longer allows public key authentication

From Dev

SSH authentication by public key and password in the same time

From Dev

How to Debug Public Key SSH Authentication Failure

From Dev

Cannot SSH to Windows with public key authentication

From Dev

Amazon EC2: No supported authentication methods available

From Dev

Where do i need to put my public rsa key on the server to allow passwordless ssh authentication?

From Dev

How can I use public key authentication to access a ssh server on android?

Related Related

  1. 1

    SSH Public Key - No supported authentication methods available (server sent public key)

  2. 2

    gcloud ssh -- No supported authentication methods available (server sent: publickey)

  3. 3

    AWS SFTP error Disconnected: No supported authentication methods available (server sent: publickey) on filezilla

  4. 4

    Tortoise git fails with No supported authentication methods available (server sent: publickey)

  5. 5

    Disconnected : No supported authentication methods available (server sent :publickey)

  6. 6

    AWS - Disconnected : No supported authentication methods available (server sent :publickey)

  7. 7

    disconnected: no supported authentication methods available (server sent: publickey, gssapi-with-mic)

  8. 8

    Moving files in Filezilla gives Disconnected: No supported authentication methods available (server sent: publickey)

  9. 9

    ssh no supported authentication methods supported

  10. 10

    Server key refused. No authentication methods available

  11. 11

    Server with ssh public key authentication with libssh

  12. 12

    Disconnected: no supported authentication methods available

  13. 13

    No supported authentication methods available in FileZilla

  14. 14

    SSH Public Key Authentication

  15. 15

    ssh public key authentication not working

  16. 16

    ssh public key authentication not working

  17. 17

    SSH failed public key authentication

  18. 18

    ssh public key authentication fails

  19. 19

    SSH public key error

  20. 20

    How do I prevent a "No supported authentication methods available" error when using TortoiseHg?

  21. 21

    adding ssh public key to server

  22. 22

    ssh no longer allows public key authentication

  23. 23

    ssh no longer allows public key authentication

  24. 24

    SSH authentication by public key and password in the same time

  25. 25

    How to Debug Public Key SSH Authentication Failure

  26. 26

    Cannot SSH to Windows with public key authentication

  27. 27

    Amazon EC2: No supported authentication methods available

  28. 28

    Where do i need to put my public rsa key on the server to allow passwordless ssh authentication?

  29. 29

    How can I use public key authentication to access a ssh server on android?

HotTag

Archive