Setting Up SSH Access on MacOS

Last Updated -


In order to access your new VPS server, there are a few steps that need to be completed. By Using your SSH key and agent forwarding you will not have to enter a password when connecting to your server. This is also a more secure way of connecting as opposed to using a password.

Getting Your SSH Key

At Pagely, we want to make sure your sites are as secure as possible. Because of our security practices, we require you to use an SSH key to authenticate with your VPS.

To get an existing SSH public key or generate a new SSH key pair, see our article on generating SSH keys on MacOS.

Adding Your SSH Public Key to Your Account

After you have an SSH key pair, you'll need to add your public key to your Pagely account using the Atomic control panel. To learn more about uploading your public key, see our article on adding SSH keys to your Pagely account.

Configuring Your SSH Connection

Finished generating your SSH key and adding it your Pagely account? Awesome! Now it's time to configure your SSH connection by setting up an SSH agent and creating a new SSH configuration for your VPS.

Setting Up the SSH Agent

  1. Begin by opening a new Terminal window.
  2. Next, you'll want to start the SSH agent in the background. To do so, enter the following command:
    eval "$(ssh-agent -s)"
  3. Once the SSH agent is started, add your SSH key to the agent like so:
    ssh-add -K ~/.ssh/id_rsa
    Note: If you've chosen to store your private key elsewhere or used a different file name other than the default, you'll need to modify this command to fit the path to your key.

Configuring the SSH Connection

With the SSH agent now running, let's go ahead and add a few configuration settings to make any connections much easier.

  1. Begin by opening a new Terminal window.
  2. Next, use the following command to edit the ~/.ssh/config file. In this example, we're using Nano for simplicity's sake, but feel free to whatever text editor you prefer.
    nano ~/.ssh/config
  3. Inside your SSH config file, add the following lines and modify them to fit your site:
    Host example.com
    HostName your_server_hostname.vps.pagelyhosting.com
    ForwardAgent yes
    User client_example
    IdentityFile ~/.ssh/id_rsa
    Note: Be sure to pay attention to the indentation here on the lines after the initial host declaration.
  4. Once you've put your changes in place, press Ctrl+X to exit the editor. Don't forget to save your changes when prompted!

Connecting Over SSH

Now you've generated an SSH key, added your public key to Atomic, and configured your SSH agent to simplify the connection arguments, you're ready to connect!

To connect over SSH, just open up a Terminal window and enter the following:

ssh example.com

That's all there is to it! Thanks to the extra bit of configuration, it already knows your username, hostname, and where your SSH public key is located. All you have to do for any subsequent connections is enter this one command and you'll quickly be connected!

Connecting Over SFTP

Need to connect over SFTP? Most SFTP clients such as Transmit will use your existing configuration. All you'll have to do is tell it where to connect.

For more information on connecting over SFTP, see our article on using SFTP on Pagely.

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