Setting up SFTP
I have a WordPress site and I haven't made a public key for my server and now I have Permission denied (publickey). Is there a way to fix the issue?
1 Reply
SFTP fundamentally relies on SSH protocol in order to establish connections between your client and server. Ultimately, whatever program you are attempting to use to connect to your server needs to have permission to access it, hence the permission denied (publickey)
error.
Just to clarify, you wouldn't necessarily need to create a public key for your Linode server unless you intended to use SSH public key authentication from your Linode to another client. Since you appear to be unable to connect to your Linode, you need to make sure you create a public key on your local machine and upload it to the ~/etc/authorized_keys
file on your Linode.
I'd start by making sure your local computer has a public key:
MacOS/Linux:
cat ~/.ssh/id_rsa.pub
Windows:
type C:\Users\username\.ssh\id_rsa.pub
If this file is not present, or you feel the desire to create a new key, you can do so by following the steps detailed here:
Once located or created, you will need to add that key to your Linode's authorized_keys file mentioned above. More information about the directory/file permissions necessary are listed in our guide to securing your Linode:
For more information about how to setup an SFTP Server or connect to an existing SFTP server, check out the following guide: