By thuram
HI,
I use ubuntu 16.04 to work, but I needed to format my computer and now I can not access my droplets via SSH only through the Launch Console.
My droplet is with DOKKU and I need access to access the repositories.
I would like to know how I add new SSH keys so I can access my droplets again.
I have already tried to add a new key through the settings / security, but when I try to access my droplet through ssh root @ ipdroplet the Permission denied (publickey) message appears.
Please help me, I’m desperate !!!
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!
So you still have access to the server which is good.
If you have not, you need to generate some ssh-keys. Once you have done that you need to find your public key.
Which should look something like this example key, If your on windows your key might look different but needs to have this format.
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7kGBwVKF0E54AZl/kGHEn9PgnfbGAbvNMebdSl3YNswRvW0bGdrL8KpW/BQZ76eZV9H5mdMgH6GPxLWhjFTz1jVWtW03s3c2q83xqXsyoXCnHp3NAEggwTHzkzd+OyMSSO2+fSc9ACGfpTvxZGvU5cRAeXkjTg1PQppxBv7lkG8HINYyYiEt6ck70aSUo2Fzck2IQrdTgD62riiUNOGusRGWXPB5thAd/1lNiAxQFu0dssiuDS8BwoU3DaaM0Vm5HH0NUp8Zzxkb7bcbatqs8Yd0F9NEJLtUAyjTxKjbaTcHCQLshtDi+WLMS3kUrJkYPsk/vAyPcLYqiPrvldMjj example@snapshooter.io
You then need to copy this and use the Launch console to access your droplet.
Once in run the following command to edit the authorized_keys file
nano /root/.ssh/authorized_keys
Then append your public key to the authorized keys file. Once this is complete you should be able to log in. This will give you root access, if you need access to a different user account it would be
nano /home/example/.ssh/authorized_keys
Hope this helps
Hello, all
The Copy/Paste functionality of our web console is a bit odd; the code backing it is custom due to the way the VNC window is implemented for accessing your Droplet. It isn’t a good idea, in my experience, to rely on the console for long copy/pasting like an SSH key.
My recommended method to get the key on the Droplet is over SSH itself. You can enable PasswordAuthentication for your Droplet by modifying your /etc/ssh/sshdconfig file. Once set to Yes restart the SSH service and connect via an SSH client for a more stable connection. You can then modify your ~/.ssh/authorizedkeys file to add the appropriate public key.
This should do the job for you as well.
The other option is to temporary enable the PasswordAuthentication from no to yes in order to access your droplet using password and then once you’ve entered your key to disable the PasswordAuthentication again. This way is considered more secure than uploading the key to a Dropbox in case you don’t have any other server to us.
/etc/ssh/sshd_configssh username@[hostname or IP address] or if on a Windows box use PuTTY for password login making sure authentication parameters aren’t pointing to a private key~/.ssh/authorized_keys/etc/ssh/sshd_configHope that this helps! Regards, Alex
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.