Connection issue using SSH and FileZilla

I cannot connect to my droplet both using SSH and using FileZilla. Using: https://www.infobyip.com/sshservertest.php I can see the IP is active and I can ping it but permission is denied every time.

I have also tried to deactivate the firewall but nothing works. Please some help would be appreciated because a server I cannot access is of little use to me :/

edited by MattIPv4

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.

×
2 answers

Hello, @simonburgermeister

What you can do is to access your droplet via the console from your DigitalOcean’s control panel and then make sure that your ssh-key is added or you can enable the PasswordAuthentication and then access the droplet from your machine and then add your keys and tweak the configuration if needed.

If you access the droplet via the console you can check if your key is present in the ~/.ssh/authorized_keys file and if not you can add it and this should sort the connectivity issue for you. However if you’re finding difficulties to do so due to issues with the text editor or copying/pasting the key there is another way to achieve this.

You can tweak temporary tweak the ssh configuration and allow PasswordAuthentication in order to access your droplet from your PC. In order to do that you need to access the droplet from the console again.

Use vim or nano to edit the contents of /etc/ssh/sshd_config
Eg.

vi /etc/ssh/sshd_config or nano /etc/ssh/sshd_config

Now go to the very bottom of the file (to the line with PasswordAuthentication) - Change the value next to PasswordAuthentication from no to yes.
It should now look like this:

# Change to no to disable tunnelled clear text passwords
PasswordAuthentication yes

Save the file and then run the following command to reload the SSH config:

sudo service sshd reload

With this done, you can now set up your new SSH key for your LOCAL device.
To do this, you can run the following from your LOCAL device, not the server:

ssh-copy-id username@droplet.ip

Alternatively, you can paste in the keys using SSH:

cat ~/.ssh/id_rsa.pub | ssh username@droplet.ip "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >>  ~/.ssh/authorized_keys"

Note: You need to change username and droplet.ip with your actual username and Droplet’s IP address

Hope this helps!

Let me know how it goes.

Regards,
Alex

Thank you for your reply, unfortunatly the PasswordAuthentication in sshd_config was already set to yes so the next steps still don’t work

  • Hello, @simonburgermeister

    If the PasswordAuthentication is enabled then you should see the password prompt message when trying to connect to the server via ssh? Let me know if this is the case or you’re still getting the Permission Denied error message.

    Also if you do not remember the root password for the droplet, you can reset the password from the control panel.

    Let me know how it goes.

    Regards,
    Alex

Submit an Answer