0

I've got a DigitalOcean droplet which is running on Ubuntu 16.04 which I am trying to access via PuTTY (the SSH client).

Whenever I connect to the droplet, I am prompted with the user login as expected, however after putting in the password for a user account, it asks for it again as though the password was incorrect. I can clarify 110% that the password is correct. See below:

I can access the console through the droplet's control panel on the DigitalOcean website, and the login details I am using are identical to that of PuTTY.

Using the console that I can use through the DigitalOcean control panel, I have checked my UFW settings and OpenSSH is allowed in its entirety.

How can I solve this issue? I need SSH access from PuTTY and other external terminals.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
Ryan
  • 101
  • 2

1 Answers1

0

Using user/password for cloud instances is not recommended as passwords can be hacked.

Instead, use ssh keys.

While you are logged into the instance through the web console, type:

ssh-keygen -t rsa

and keep pressing 'Enter' until you get a new prompt line.

That will generate a private and public keys for your instance.

Next, type:

cat ~/.ssh/id_rsa

Copy the content and paste it to a file in your windows machine (Notepad++ is recommended for this as notepad may add extra invisible characters), example: my_private_key.pem

Next, download PuttyGen, open it and load the key file you created, then click save private key and overwrite the key file (my_private_key.pem).

Then configure Putty like:

In the left pane, expand Connection -> SSH -> AUTH and in the right pane click "Browse" and choose the key.

In the left pane again, click "Data" and insert the username you use to login to the instance.

Go back to "Session" fill in the public ip of the instance, give the connection a name and click "Save".

Then double-click the name you gave the session and it should connect automatically using the private key and without the need to enter a password.

Itai Ganot
  • 10,424
  • 27
  • 88
  • 143