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.
Step-By-Step Walkthrough (Recommended)
Do you already have an SSH key that you want to use?
Yes - Tell me how to add it to Atomic. No - Tell me how to generate an SSH key.
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
- Begin by opening a new Terminal window.
- Next, you'll want to start the SSH agent in the background. To do so, enter the following command:
eval "$(ssh-agent -s)"
- Once the SSH agent is started, add your SSH key to the agent like so:
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.ssh-add -K ~/.ssh/id_rsa
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.
- Begin by opening a new Terminal window.
- 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
- Inside your SSH config file, add the following lines and modify them to fit your site:
Note: Be sure to pay attention to the indentation here on the lines after the initial host declaration.Host example.com HostName your_server_hostname.vps.pagelyhosting.com ForwardAgent yes User client_example IdentityFile ~/.ssh/id_rsa
- 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? For more information on connecting over SFTP, see our article on configuring SFTP clients.