Question

Remote login does not ask for the password. It appears directly without permission

I use openssh to remotely log in to my host and execute ssh root@188.166.217.201 Permission denied appears. I read your tutorial. The tutorial says that I will be asked for my password, but I have tried many times without a file asking for my password. It directly shows that I have no permission


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

alexdo
Site Moderator
Site Moderator badge
January 5, 2023

Hello @michaelxiao

The droplet was most probably created with only ssh-key access and with ‘Password Authentication’ disabled.

You can either enable ‘Password Authentication’ from the recovery console or upload your ssh-key to access your droplet.

Docs on how to create an ssh key:

https://www.digitalocean.com/community/tutorial_collections/how-to-set-up-ssh-keys

Docs on how to add keys to existing servers:

https://docs.digitalocean.com/products/droplets/how-to/add-ssh-keys/

Regards

KFSys
Site Moderator
Site Moderator badge
January 4, 2023

Hi @michaelxiao,

By default the DigitalOcean Droplets allow only SSHAuthentication and PasswordAuthentication is disabled.

If you want to turn on PasswordAuthentication, you’ll need to use the Recovery Console to enter your Droplet.

https://docs.digitalocean.com/products/droplets/how-to/recovery/recovery-console/

The Recovery Console provides out-of-band access and is available regardless of your network settings. It emulates the access you would have if you were sitting down with a keyboard and monitor attached to the actual server. You can use this feature to log in and revert bad settings to regain normal access.

Once inside, open the /etc/ssh/sshd_config and find the line #PasswordAuthentication No, you’ll need to remove the comment # and change No with Yes. Once done, save the file and restart your sshd service

service sshd restart