By eduardoutc
Hi all,
I can have two ssh key from different computer, right now I have one ssh key on my droplet, but I need another one ssh from my other computer.
I try this.
cat .ssh/id_rsa.pub | ssh root@dropletipaddress "cat >> ~/.ssh/authorized_keys"
but doesn’t work, but I not have password from my droplet, only connect with ssh.
as I can fix it.
thanks in advance.
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!
What that command tries to do is take the contents of the file containing the public portion of your SSH key pair, ~/.ssh/id_rsa.pub and append it to the bottom of the file ~/.ssh/authorized_keys on your server.
So to add the new key, all you need to do is send the contents of ~/.ssh/id_rsa.pub to the computer that already has access to the server and then copy and paste it into the ~/.ssh/authorized_keys on the server.
If you are using Debian or Ubuntu and you have your public key on GitHub, you can use the ssh-import-id on the server to do this automatically. Run:
ssh-import-id gh:github_username
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.