Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
Adding public key to an existing droplet failed
I created a droplet and selected the “ssh key” option, without actually generating the key pair. After the droplet was created, I think I need to add a public key I locally generated on my Linux machine to the droplet, but I can’t make it work. I generate the key pair locally, and executed:
ssh-copy-id -i .ssh/idjenkinsrsa.pub root@my_ip_address.
Now I check on the authorized_keys on the droplet, and found there are two keys, one being the added one.
But when I tried to ssh the the server, I am still asked to enter a password. How can I make it work? Can I remove the .ssh/authorized_keys on the droplet and copy my local public key file to the remote droplet?
It has been very annoying. My machine is CentOS 7. Thanks.
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.×