I (really) need some help connected to SSH. (very new to this)

Posted March 13, 2020 358 views
DigitalOcean Accounts

I have looked through the docs, followed the guides, but I am not sure what I am doing wrong. I created SSH two keys. One public and one private. They are in the root directory of my macbook.
I uploaded the public key in the proper places on the dashboard.
I tried running ssh root@ip but got “permission denied” publickey. Then I tried to specify the file using ssh -i /users/name/name-of-private-key userid@ip, but still.
got “permission denied, publickey” This is the first step and I already feel like a failure. Please help. Thank you.

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.

Submit an Answer
1 answer

Hi there @IBP0,

There are a few things that I could suggest:

  • First make sure that your SSH key is set with proper file permissions:
chmod 600 /users/name/name-of-private-key

Note, change the /users/name/name-of-private-key with the actual path to your private key.

  • Then try to SSH again and if you still get the same error try running SSH with verbose mode by adding the -vvv tag:
ssh -vvv -i /users/name/name-of-private-key userid@ip

This should give you more information on what the problem could be.

  • Another thing that you need to keep in mind is that when you add a new SSH key to your DigitalOcean control panel it does not get added to any existing Droplets, this means that you need to create a new Droplet and select the SSH key during the creation process, or you need to follow the steps here on how to regain access to your existing Droplet in case that you are not able to connect:

Hope that this helps!

  • Bobby, thank you very much for the suggestions.

    But unfortunately it is still not working. I feel pretty dumb. I tried all those things. I kept the public key, destroyed the droplet, recreated a new one using the already established public key. Ran the commands you suggested and ran the verbose version.

    This was the end result. (replaced sensitive data)

    debug1: Offering public key: /users/user/key RSA SHA256:flxhgrziui3Kk4U8G7Glsp4Ffza9JB/J1vOqGo8TsA8 explicit
    debug3: send packet: type 50
    debug2: we sent a publickey packet, wait for reply
    debug3: receive packet: type 51
    debug1: Authentications that can continue: publickey
    debug2: we did not send a packet, disable method
    debug1: No more authentication methods to try.
    IBP-0@ProjectIP: Permission denied (publickey).
    Computer:~ user$

    • Hi there @IBP0,

      If this is a new Droplet you should try using root as the username. Let me know how it goes!


      • Ok Bobby! I will try it! Thanks for the continued help. :pray:

      • Hey Bobby. Thanks for the continued support. I tried changing my username from IBP-0 to root and still nothing. Destroyed the droplet. Created a new one synced with existing public key. Still

        *Warning: Permanently added ‘’ (ECDSA) to the list of known hosts. Permission denied (publickey).
        Computer:~ user$

        • Update! Success! I think! I reset the permissions and ran the commands I had been trying all night, and this was the result!

          *Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-66-generic x86_64)

          System information as of Fri Mar 13 12:02:54 UTC 2020

          System load: 0.0 Processes: 81
          Usage of /: 4.0% of 24.06GB Users logged in: 0
          Memory usage: 11% IP address for eth0:
          Swap usage: 0%

          0 packages can be updated.
          0 updates are security updates.*

          Now on to step two! Thank you!