Question

Fail to ssh into droplet with floating ip

Hi guys,

Currently I’m facing a problem that is I cannot ssh into a server with floating ip using sudoer user.

I can:

ssh root@$DROPLET_IP

But when I try to

ssh user_abc@$DROPLET_IP #out: Permission denied (publickey)

I had check user and user folder (as root).

su $sudoer_user
groups wheel  # output: user_abc wheel
cat /home/user_abc/.ssh/authorized_keys # output exactly the same with root user

Can anyone help me?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @SaboteurKid,

Check if user has bee allowed Please make sure your user does have SSH enabled. If you haven’t try the following

echo "AllowUsers NewUser" >> /etc/ssh/sshd_config

and then

service sshd restart

The above should help out with the newuser not being allowed.

Check your SSH Config The next suggestion is a long shot but please check in your /etc/ssh/sshd_config you have the following line

PubKeyAuthentication Yes

This will allow you to connect with a public key to your droplet.

Local SSH key used Another possible issue would be your local terminal using the wrong SSH keys. Try to SSH like so

ssh -i ~/.ssh/private_key newuser@DropletIp

Where ~/.ssh/private_key would be the path to your local SSH keys you want to use.

DigitalOcean article

Lastly, please check this article - https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/to-existing-droplet/ and make sure you have followed it to add the SSH key for your user. Of course, you’ll need to change of your .ssh folder to your root user’s directory.

Regards, KDSys