Reputation: 590
I am trying to copy a folder from my digital Ocean server to my computer. I have successfully connected as root to my server and I have the ssh Public key setup
I use command root@my-server_ip to
connect successfully.
When I try to copy a file like
scp -r root@my-server_ip:/file/path/ /where/to/put
I get this error Permission denied (publickey).
I can't figure out what the heck is the issue
Upvotes: 1
Views: 2716
Reputation: 163
Permission denied
occurs when the server is not able to validate the incoming connection. You need to provide the path to your identity file (ssh key) explicitly when making a request through scp.
Something like this:
scp -i <path_to_identity_file> -r root@my-server_ip:/file/path/ /where/to/put
Upvotes: 2