Using SFTP With Pagely

Last Updated -


SFTP is an alternative to the old, insecure FTP protocol and allows you to upload files to your Pagely account with ease.

In this article, we'll show you how to generate SSH keys for authentication and connect them to your Pagely account for fast, secure access to your site's files.

Getting Started

  • If you have a VPS or Enterprise account and DO NOT have an SSH key, start here.
  • If you have a VPS or Enterprise account and DO have an SSH key that you want to use, start here.
  • If you're on a legacy shared hosting account, start here.

VPS/Enterprise Hosting

Note: These instructions apply to all VPS and Enterprise level hosting when using Pagely's Atomic control panel. If you're on an older legacy account with the older control panel, you'll want to take a look at the section later in this article on accessing SFTP for legacy shared hosting accounts.

Checking For Existing SSH Keys

Before generating a new SSH key pair, you'll first want to make sure you don't have any existing SSH keys to use (or potentially overwrite!). Here's how to check for an existing SSH key:

Mac/Linux

To search for an existing SSH key, open up a Terminal window and run the following command:

ls ~/.ssh | grep pub

This command will allow you to see all public keys that are present in your account. If an SSH key already exists, you'll see a file ending in .pub, most commonly named id_rsa.pub.

If you DO find an SSH key, skip to the section on getting your SSH key.

If you DO NOT see an SSH key listed, follow the next section to generate a new SSH key pair.

Windows

First, we need to check to see if you already have an existing SSH key present. Open up a Command Prompt window and run the following command:

dir %userprofile%/.ssh

This command will list any SSH keys that are present on your user profile. If an SSH key exists, you'll see a file listed that ends with .pub, usually id_rsa.pub.

If you DO find an SSH key, skip to the section on getting your SSH key.

If you DO NOT see an SSH key listed, follow the next section on generating a new SSH key pair.

Generating a New SSH Key Pair

This section covers the process of generating an SSH key pair for securely connecting to your hosting account. An SSH key pair consists of a public key that will be uploaded to the server, and a private key on your computer to match it.

If you already have an SSH key pair that you want to use, you can go ahead and skip this section.

Note: Be sure that you don't have an existing SSH key present. If you do, you'll want to back it up first to avoid possibly losing it.

To generate a new SSH key pair, open a terminal window (Command Prompt if in Windows) and enter the following command:

ssh-keygen -t rsa -C "YOUREMAIL@example.com"

Windows Users: If this command gives you an error that the command is not found, you may need to install ssh-keygen via Git For Windows. Alternatively, you can also generate a key pair with a GUI such as PuTTYgen.

When running that command, it'll walk you through the process of creating a new SSH key pair. Once complete, continue on to the next step on getting your SSH key.

Getting Your SSH Public Key

Mac

Open a Terminal window and enter the following:

Note: The following command assumes that your public key is named id_rsa.pub. If your key is named something different, you'll need to replace it in the command with the correct file name.

pbcopy < ~/.ssh/id_rsa.pub

Your SSH public key has now been copied to the clipboard. You're ready to continue with adding your SSH key to your Pagely account.

Windows

Open a Command Prompt window and enter the following:

Note: The following command assumes that your public key is named id_rsa.pub. If your key is named something different, you'll need to replace it in the command with the correct file name.

clip < %userprofile%/.ssh/id_rsa.pub

Your SSH public key has now been copied to the clipboard. You're ready to continue with adding your SSH key to your Pagely account.

Linux

Open a new terminal window and enter the following command to display your public key:

cat ~/.ssh/id_rsa.pub

Then, just copy the contents of the file that are output. You're ready to continue with adding your SSH key to your Pagely account.

Creating an SSH User and Uploading a Public Key

atomic-ssh-key-upload.gif

Once you have your SSH key, adding it to Pagely's Atomic control panel is easy. Here's how to do it:

  1. Begin by logging into your Pagely account.
  2. Next, visit your Account Settings page by clicking on the menu item at the left side of the page.
  3. From within your account settings, click on the button labeled SSH to go to your SSH settings.
  4. Inside the SSH Username field, enter the username that you want to use and click Save. This will be automatically prefixed with client_, so if you entered jeff, your username would become client_jeff
  5. Remember that public key that you got earlier in this article? It's time to use it. Inside the text box labeled Add a Public Key, paste the contents of your public key. Alternatively, you can also upload your public key using the file upload button and browsing for your public key (public key file names will end in .pub).
  6. Once your public key has been set, be sure to click the Save Public Key button to upload it.

You're all set! You'll now be able to log in via SFTP using your username (don't forget the client_ prefix!) and your SSH key pair.

Note: Be sure not to lose your private key that's stored locally on your computer. Without it, you won't be able to authenticate with your public key!

Connecting Over SFTP

Depending on the SFTP client you're using, the specific settings will vary a bit. Generally, you'll want to set these settings:

Host: The IP or hostname for your app.
Username
: The username you set when adding your key, prefixed by client_.
Password: Leave this blank, but look for a key icon near the field. That's where you'll add your SSH key. In some clients such as Transmit for Mac, it will automatically look for your keys in the default locations.
Port: 22
Protocol: SFTP

For example, a configuration in Transmit would look something like this:

transmit-sftp-screenshot.png

Legacy Shared Hosting

If you're on a legacy shared hosting account, you will need to access your account with a username and password instead of the more secure method of using an SSH key that was mentioned above. Here's how to enable SFTP and gain access:

  1. Begin by logging into your legacy shared hosting account.
  2. Once inside your control panel, click on Sites, then on All Sites to get a listing of the sites on your account.
  3. Next, click on the site that you want to gain SFTP access to, then click on App Details.
  4. Within the Common Actions section, click on the Enable sFTP button.

Once SFTP is enabled, you will be sent an email that contains your SFTP username and a link to set your password.

Using SFTP With Legacy Accounts

Most SFTP clients will work just fine with the default settings. If you don't already have a preferred SFTP client, here's a few to try:

Of course, if you need any help configuring your particular SFTP client let us know! Our support team is happy to help!

Related Topics

Pagely is the Managed WordPress Hosting Platform designed to exceed the needs of media, business, and Enterprise customers alike. We help the world's biggest brands scale WordPress.

Copyright © 2006-2017 Pagely, Inc. All rights reserved.
Pagely® and WordPress® are registered trademarks.

Pagely
Powered by Zendesk