Connecting to SFTP for Shared Accounts
Generate access keys via cPanel
If you have not already done so, create your public and private keys as per the instructions in the SSH access for Resellers and Shared Servers article. If you already have created keys for SSH access, the same keys will be used for SFTP.
Create the FileZilla profile
After your keys have been generated, you will need to create your SFTP profile in your FileZilla application. There are twos steps to this process. First you will need to attach your private keyfile to FileZilla and then you will need to create your connection profile.
Attach your private keyfile.
- Log into your FileZilla application.
- From the upper toolbar, click on Edit and then Settings.
- A settings popup will appear. From there click on SFTP in the left-hand toolbar. In the right panel, click on the Add keyfile... button.
- Using the popup window, navigate to the ppk file you saved for your private key and click Open.
- The keyfile will appear in the list. Click the OK button to save the information.
Set up the SFTP connection profile
- Using the upper toolbar, click on File and then Site Manager.
- A popup will appear for you to create a new profile. Click on the New Site.
- The right hand form will appear brighter, indicating you can now enter data in it. Be sure to enter data into the following fields:
Field Description Host Enter your domain name here. (ie: example.com) Port Set this to "2222". Protocol Set this to "SFTP - SSH File Transfer Protocol". Logon Type Set to "Ask for Password". User Enter your cPanel username. Password Enter your current cPanel password.
- Once all data has been entered, click Connect to let FileZilla connect to your server.
Once you have completed the above, you should be able to connect to your shared account using SFTP.
Support Center Login
Social Media Login
2015-04-15 3:37 pm
I'm trying this method to log in to a subdomain's FTP account, but the passphrase to the key isn't accepted, Coda 2 on Mac Yosemite.
2015-04-15 3:38 pm
Unable to extract public key from private key file: Wrong passphrase or invalid/unrecognized private key file format
2015-04-16 10:36 am
Sorry for the problems with connecting Coda2 through SFTP. I would suggest using SSH instead - as I do not have Coda2 to test. However, I did see this article with another Coda2 user having the same problems, so he switched to SSH: How to Setup Coda2 SFTP using Private SSH Key. Check that out, and also our own article for connecting to a shared server SSH with a Mac. Hopefully, that will cover all the bases.
If you have any further questions or comments, please let us know.
2015-09-03 1:36 am
I followed the steps to add the key to my mac's keychain, then tried connecting with Coda, restarting coda after every step. It still doesn't work: says that the login doesn't authenticate.
2015-09-03 12:18 pm
Thank you for contacting us. An authentication error is usually related to username, and password. I recommend confirming your FTP Settings are correct and without misspellings.
If your problems persist, I recommend checking the FTP logs for additional errors, or clues. If you are on a shared server, Live Support can help you with this.
2016-03-09 3:12 am
I was able to get this working in Coda 2, finally! I found that using the keys generated through cPanel was not possible in Coda, so I tried generating my own through Terminal like this:
Give it a unique name, like inmotionhosting and set your passphrase - just like you do through cPanel.
After generating the key, add it to your Keychain with:
ssh-add -K inmotionhosting (but replace 'inmotionhosting' with whatever you name your key)
Once that's done, head over to Security -> SSH Shell Access in cPanel and click Manage SSH Keys. Then click Import Key.
Enter the name that you gave your key in the relevant field. Then copy and paste the contents of your private and public key files that you generated earlier in their respective boxes. Type in your passphrase where it asks for it.
If you want to quickly view the contents of these key files in Terminal, use these commands (assuming you named your key 'inmotionhosting'):
Copy and paste the results of those commands into the private field (first one) and then the public field (second one) in cPanel. Then click Import. Go back to the list of your keys and click Manage Authorization next to the key name you just imported, then click Authorize.
Go back to Terminal on your Mac and create a new 'config' file in the '.ssh' directory if there is not already one there. You can do this with nano like this:
In it, add a new host record that looks like this:
Then save the file with CTRL-X and hit Y to confirm, then Enter.
Go back to edit your site within Coda, and go to the Server tab. Select SFTP under Protocol, then type in the name of your shared server in the Server field. Leave everything else blank. The config file that you just created will be pulled when attempting to connect and will use the details you entered above.
By doing all of this, I am now able to successfully connect to my account via SFTP in Coda 2!