SSH

SSH is a protocol for secure remote login and other secure network services over an insecure network. Kinsta provides SSH access with all of our Managed WordPress Hosting plans. SSH access allows you to log into a command prompt, perform common sysadmin tasks, and execute commands just as if you were sitting at the server itself. You can run additional tools such as Git, Composer, WP-CLI, etc. If you’re on an Enterprise plan, you can also use tools like npm. Follow the directions below on how to connect to SSH on your WordPress site.

SSH should be used by advanced users only. Running improper commands via SSH could easily break your site. If you are not comfortable doing this, please check with a developer or our Support team first.

SSH Access Login Info

To connect to SSH, you’ll need the following pieces of information:

  • host/server address (IP address)
  • username (SFTP Username, not your email address)
  • password
  • port (we take security seriously here at Kinsta, each site uses a different port)

You can find this information under the SFTP/SSH section of each site’s Info tab within MyKinsta.

SFTP and SSH details in MyKinsta.
SFTP and SSH details in MyKinsta.

How To Connect to SSH With a Username and Password

The easiest method for connecting via SSH is to use a username and password.  The steps to do that vary depending on your operating system. We’ve outlined the process for each below.

Connect to SSH With a Username and Password on Windows

For those of you running Windows, you will need a terminal client to connect to SSH.

Step 1

We recommend downloading the free PuTTY client. Grab the .msi installer as this also includes PuTTYgen. If you want to use SSH keys later down the road, you’ll need this.

Step 2

Launch PuTTY and enter your Host IP Address and the unique Port number (both found in MyKinsta > Sites > sitename > Info > SFTP/SSH > Host). Then click Open.

SSH PuTTY client for Windows.
SSH PuTTY client for Windows.

Step 3

If this is your first time connecting, you will most likely see a rsa2 key prompt. Go ahead and click Yes, which will trust the host in the future.

PuTTY security alert about rsa2 key.
PuTTY security alert about rsa2 key.

Step 4

In the terminal screen, you’ll need to enter your Kinsta username and press Enter/return.

Enter your Kinsta username in PuTTY and press Enter/return.
Enter your Kinsta username in PuTTY and press Enter/return.

Step 5

You’ll then be prompted to enter your password. Press Enter/return again.

Enter your SSH password in PuTTY.
Enter your SSH password in PuTTY.

You’re now connected via SSH to your WordPress site.

SSH login successful with PuTTY.
SSH login successful with PuTTY.

You can run commands such as ls or cd to list items and navigate throughout your site’s directories. WP-CLI is also installed by default on all sites.

Running SSH commands in PuTTY.
Running SSH commands in PuTTY.

Connect to SSH With a Username and Password on Mac/Linux

On Mac or Linux, it’s a lot easier to connect to SSH because the operating system (OS) already has a terminal built into it.

Step 1

Open the terminal by going to Applications > Utilities and double-clicking on Terminal.

Step 2

Then enter the command like this (You can copy/paste this command directly from MyKinsta):

ssh username@hostip -p portnumber
SSH terminal command in MyKinsta.
SSH terminal command in MyKinsta.

How to Connect to SSH With SSH Keys

Another option for connecting to SSH is to generate an SSH key pair. SSH keys provide a more secure way of logging into a server and eliminate the need for a password. You can also further protect your login by adding a passphrase, but this isn’t required.

How to Generate SSH Key Pair on Windows

Step 1

Launch PuTTYgen. If you haven’t downloaded it yet, you can grab it here.

Step 2

The default parameters should be fine in most configurations. Click on Generate.

Generate a new key in PuTTY Key Generator.
Generate a new key in PuTTY Key Generator.

Step 3

Move your mouse around to generate some randomness.

Moving your mouse around to create randomness in PuTTY Key Generator.
Moving your mouse around to create randomness in PuTTY Key Generator.

Step 4

Save both your public (.txt) and private key (.ppk). Important: Keep your private key safe and don’t share it with anyone.

Save public and private keys from PuTTY Key Generator.
Save public and private keys from PuTTY Key Generator.

Step 5

Leave the PuTTY window open and skip down to where you add your public key to MyKinsta.

How to Generate SSH Key Pair on MAC/Linux

Step 1

Launch the Terminal from Applications > Utilities > Terminal.

Step 2

Use the following command to start the key generation.

ssh-keygen -t rsa

Step 3

Choose a location to save your private key. If you leave it blank, it will save it here:

/home/youruser/.ssh/id_rsa

The public key (.PUB) will get created in the same location.

/home/youruser/.ssh/id_rsa.pub

Step 4

You will then be prompted to choose a passphrase. You can leave it empty if you don’t want to use a passphrase.

How to Add SSH Keys in MyKinsta

Now that you have your SSH keys, you can upload your public key to MyKinsta.

Step 1

Click into your user profile in the top-right corner, and click on User Settings.

MyKinsta user settings.
MyKinsta user settings.

Step 2

In the My Account tab, click on the Add SSH key button.

Add SSH key in MyKinsta.
Add SSH key in MyKinsta.

Step 3

Choose a label and paste your publickey.

  • If you’re running Windows, copy and paste the public key directly from PuTTYgen.
  • If you’re running Mac/Linux, you can copy your public key to your clipboard by using the following command in Terminal:
pbcopy < ~/.ssh/id_rsa.pub

After you paste your public key, click the Add SSH key button.

A valid rsa key in MyKinsta.
A valid rsa key in MyKinsta.

How to Connect to SSH on Windows With SSH Keys

Step 1

Launch PuTTY and enter your Host IP Address and the unique Port number (both found in MyKinsta > Sites > sitename > Info > SFTP/SSH > Host).

Host Name and Port number in PuTTY client.
Host IP and Port number in PuTTY client.

Step 2

Under Connection > Data enter your Kinsta username in the Auto-login username field.

SSH Auto-login username in PuTTY.
SSH Auto-login username in PuTTY.

Step 3

Under Connection > SSH > Auth > Credentials, click the Browse button and select your private key file for authentication.

Add your SSH private key file in PuTTY.
Add your SSH private key file in PuTTY.

Step 4

Under Session, enter a new Saved Sessions name and click on Save. Click the Open button to start a new session.

Name and save your SSH session in PuTTY.
Name and save your SSH session in PuTTY.

You’ll most likely see a security alert about a change in keys. Click on Yes.

Click Yes in the PuTTY security alert about a change in keys.
Click Yes in the PuTTY security alert about a change in keys.

If you set up a passphrase, you’ll need to enter that.

Enter passphrase for key, if applicable.
Enter passphrase for key, if applicable.

Otherwise, you’ll be logged right in.

Logged into the site with an SSH key.
Logged into the site with an SSH key.

How to Connect to SSH on MAC/Linux With SSH Keys

Step 1

Launch the Terminal from Applications > Utilities > Terminal.

Step 2

You now need to load your saved private key using the following command:

ssh-add ~/.ssh/id_rsa

Step 3

If you set a passphrase for your key, you’ll be prompted to enter that.

Step 4

Enter the command in the following form (You can copy/paste this directly from MyKinsta):

ssh username@hostip -p portnumber
SSH terminal command in MyKinsta.
SSH terminal command in MyKinsta.

Additional Notes

If you have trouble connecting, you might need to reset your SSH password or delete entries from your known_hosts file.

Was this article helpful?