By nfujioka
I have a ssh access via terminal on my mac working fine. Lately I got another computer (Ubuntu 20 Linux). I am trying to set up ssh access, but it just does not let me in, saying “Permission denied (publickey)”.
I added my ssh pub key (id_rsa.pub) on my local computer(Ubuntu) to the Digital Ocean (settings -> security). But, it does not fix the issue.
I also pasted the pub key in ~/.ssh/authorized_keys in the droplet.
What do I need to do to ssh access on my local ubuntu machine?
FYI: I can set password login by changing PasswordAuthentication yes in /etc/ssh/sshd_config in the droplet. However, this is not ssh access without password.
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!
Hi there @nfujioka,
You would need to first create a new SSH key pair on your Ubuntu computer. You can follow the steps on how to do that here:
https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2
Once you have your keys ready, copy your public key and add it to your Droplet in the ~/.ssh/authorized_keys.
That way you will be able to SSH with your new key pair from your Ubuntu computer to your Droplet.
Hope that this helps! Regards, Bobby
On the REMOTE server: $ sudo vim /etc/ssh/sshd_config PubkeyAuthentication yes PasswordAuthentication yes $ sudo systemctl restart sshd
On LOCAL server: $ ssh-copy-id user@remote_server_ip
On REMOTE server: $ sudo vim /etc/ssh/sshd_config PasswordAuthentication no $ sudo systemctl restart sshd
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.