I successfully managed to gain access to the server in my terminal through the ssh command. What i can’t do or perform is uploading the static files of my website to the server through the scp command. It provides the error shown above (Permission denied (publickey)). I tried adding my rsa key to the known_hosts file through the droplet console but to no avail. Please assist.
I also tried to delete the files in the known_host file, said yes to the ssh host verification but the same error still finds me. What is the best way to avoid this error?
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.