Cannot login to vps shell.

Posted November 20, 2015 3.4k views

I have wrong config with ssh key. when I close my putty and then I login again server say access denied. How can I fix it.

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


If the SSH Key you set for the Droplet is invalid, or does not work, you would not be able to reset the root password, so you would most likely need to submit a support ticket through the DigitalOcean CP and request that the support team either provide a temporary password or remove the SSH Key file.

Once an SSH Key is set, contacting support or simply creating a new SSH Key, uploading it through the CP, and deploying a new Droplet are really the only options.

  • Even easier, just choose “Reset Root Password” from the droplet’s dashboard page. That will shut down your droplet, reset the root password (or set it if not already set), and e-mail the password to you. Then log in from the console or via ssh, set the new key and remove the password.

    • @larry

      IIRC, when using an SSH Key that you’ve uploaded from the DigitalOcean CP, resetting the root password will have no effect as the root password is never set or sent out in the first place.

      • It’s possible to add SSH keys through the Droplet Panel right? Maybe that helps.

        • @khnvonline

          You can add SSH Keys at the time of deployment, though not after. You may be able to backup the current Droplet and then re-image it to a new one. That should allow him to setup a new SSH Key on a new Droplet while not having to go through the process of creating a new Droplet and then migrating data, though that would be the only other option that I can think of that would be available.

          Passwords and SSH Keys are something that should be backed up on a regular basis and if they are linked to something truly important, a backup of the backup should be made and stored elsewhere.

          I keep a backup of important files on my local disk, an external disk, two USB drives and 3 cloud accounts. Everything is encrypted, thus, even if someone did manage to break a 64-80 character password (exceeding 256-bits), the files would still be useless as they’d have to break various other methods as well (which fall between 2048 and 8192 bits) :-).