I’m locked out of my VPS droplet. How can I create a new identity, so I’m able to log in? I don’t recall ever creating a root password
OS: El Capitan 10.11.6 Distribution: Ubuntu 14.04
I used to ssh into my VPS. I have an id_rsa
and a id_rsa.pub
. I’m trying to access it now using:
root@104.236.87.210
Result > “Permission denied, please try again” (3 incorrect entries and then…) > "Permission denied, (publickey,password)
I don’t remember using a password in the past, thats why I configured ssh. Even if I did, what action can I take to “reset” my login password? I’ve tried generating new ssh keys, added them to my known_hosts with ssh-add
. I’ve added the new ssh key to my VPS through the web interface.
Can anyone walk me through the proper process of resetting my login?
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!
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.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hello,
Sorry to hear you had bunch of problems. Anyways I will write few sentences for you (if you didn’t already destroyed Droplet) and for future readers.
First of all, you can try using
ssh-copy-id
from your local machine instead ofssh-add
. Step Four of Initial Server Setup Tutorial have it explained great.Make sure that you have
id_rsa
andid_rsa.pub
in your/home/sammy/.ssh
on local machine.Before using SSH as
root
make sure you didn’t setPermitRootLogin
tono
. Open/etc/ssh/sshd_config
with any text editor from DigitalOcean Web Console if you can’t access SSH:Find line
PermitRootLogin
. Make sure it’s set toyes
and there is no any#
(comment) before line. If you want to use password for login, make surePasswordAuthentication
is set toyes
and there is also no#
(comment).Save file, exit editor and restart SSH:
You can also for debugging create new user, add it to
sudo
group and use it for SSH instead of DigitalOcean Web Console. Initial Sever Setup has it covered in Step One in Step Two. In case you want to use that user with password instead of SSH key, make sure you have enabledPasswordAuthentication
under yoursshd_config
(I wrote in previous step how to check it`.I was able to log in using the digitalocean web console. I logged in as root, but I still cannot ssh into my server from my OS (terminal).
Steps I took to reset root password:
[username] login: _
(Here I entered root as my login)password: _
(I entered the password emailed to me, I typed it out didn’t try pasting)So I’m able to access my server using that process - but doesn’t entirely solve my problem. I’m still being asked for a password when I try to ssh in from my OS terminal. And my new password ONLY works in the web console, it does not work when I’m asked for a password from my OS. I’m not sure whats going on, I’m almost tempted to destroy my droplet, lose all my work and start fresh. Already lost an entire day over this. Hopefully the above atleast gets someone else access to their VPS.