By cariboufute
I have been able to connect to SFTP with my own key, but I want my client to have access to SFTP too. I made a key pair for him and added the public key to Digital Ocean. I tried to add the public key with the command sudo ssh-keygen -e -f ~/.ssh/fXXXX_rsa.pub | sudo tee /etc/proftpd/authorized_keys/fXXXX after adding the public key in the ~/.ssh directory, but it didn’t work – asked for a passphrase while the key didn’t have one.
Could someone help me on this ?
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!
Hello,
The SSH keys added through the control panel are used only when creating droplets. To get things working on an existing droplet you just need to add the public key to the ~/.ssh/authorized_keys file.
This file contains a line for each public SSH key you want to add. So I recommend doing the following.
If you have password authentication enabled, run the following command on the client computer that has the key pair.
ssh-copy-id -i /path/to/key user@ip.address
It will ask you to log in with your password, then copy the key. Make sure to update /path/to/key to the path to your private key. user@ip.address should be replaced with the user you want to use and the ip address of your droplet.
If you do not have password authentication enabled, you can manually log into SSH with a user that has access and open the authorized keys file with:
nano ~/.ssh/authorized_keys
Then start on a new line and copy the public key below whatever keys you already have.
Then hit Ctrl + x and then y to accept changes. Then the user can log in with their SSH key.
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.