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.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2024%2F06%2Fwordpress-sftp-ssh.png&w=3840&q=75)
Change the SFTP/SSH password
If you want to update the SFTP/SSH password for the current environment, hover over the password and click Generate new SFTP password.
![Generate a new SFTP/SSH password for your WordPress site.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2024%2F06%2Fwordpress-sftp-generate-new-password-1024x304.png&w=2048&q=75)
To confirm the password change, click Generate new password.
![Confirm the password change by clicking Generate new password.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fwordpress-sftp-generate-new-password-1024x324.png&w=2048&q=75)
Set a password expiration
If you want the STFP/SSH password to expire and regenerate at regular intervals automatically for the current environment, click the edit icon under Password expiration.
![Change the STFP/SSH password expiration time.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2024%2F06%2Fwordpress-sftp-password-expiration-1024x316.png&w=2048&q=75)
Choose how often you want the password to expire and regenerate, and click Save changes.
![Choose the interval for the password expiration.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fwordpress-sftp-change-password-expiration-1024x488.png&w=2048&q=75)
Authentication methods
To change the SSH authentication methods to enable or disable access with a username and password for the current environment, click the edit icon under Authentication methods.
![Change the SSH authentication methods.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2024%2F06%2Fwordpress-sftp-authentication-methods-1024x316.png&w=2048&q=75)
Select Password to enable or disable SSH access with a username and password, and click Save changes. You cannot disable access using an SSH key; however, you can disable all SFTP/SSH access.
![Select Password to enable or disable SSH access with a username and password.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fwordpress-sftp-change-authentication-method-1024x500.png&w=2048&q=75)
IP allowlist
To specify a list of IP addresses that are allowed to access your environment via STFP/SSH, click the edit icon under IP allowlist.
![Specify which IP addresses can access the environment via SFTP/SSH.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2024%2F06%2Fwordpress-sftp-ip-allowlist-1024x316.png&w=2048&q=75)
Enter the IP addresses you want to allow access via SFTP/SSH and click Add. You can specify multiple addresses separated by a comma, e.g., 1.1.1.1, 2.2.2.2. You can also specify a range of IP addresses using a slash, e.g., 1.1.1.1/32.
![Specify the IP addresses that are allowed to access your environment via SFTP/SSH.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2024%2F06%2Fwordpress-specify-IP-address-1024x430.png&w=2048&q=75)
Once you have entered all of the required IP addresses, click Update IP allowlist.
![Update the IP allowlist for SFTP/SSH.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2024%2F06%2Fwordpress-sftp-update-ip-allowlist-1024x686.png&w=2048&q=75)
How to connect to SSH with a username and password
The easiest method for connecting via SSH is to use a username and password. To connect with a username and password, you must ensure the password authentication method is enabled. 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
Windows users require a terminal client to connect to SSH.
- We recommend downloading the free PuTTY client using the .msi installer. This also includes PuTTYgen, which you’ll need if you want to use SSH keys.
- 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. - 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. - 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. - You’ll then be prompted to enter your password. Press Enter/return again.
Enter your SSH password in PuTTY.
You’re now connected via SSH to your WordPress site.
![SSH login successful with PuTTY.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2015%2F04%2Flogin-successful-ssh.jpg&w=1920&q=75)
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.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2015%2F04%2Frun-ssh-commands.jpg&w=1920&q=75)
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.
- Open the terminal by going to Applications > Utilities and double-clicking on Terminal.
- 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.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2024%2F06%2Fwordpress-ssh-terminal.png&w=3840&q=75)
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
- Launch PuTTYgen. If you haven’t downloaded it yet, you can grab it here.
- The default parameters should be fine in most configurations. Click on Generate.
Generate a new key in PuTTY Key Generator. - Move your mouse around to generate some randomness.
Moving your mouse around to create randomness in PuTTY Key Generator. - 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. - 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
Launch the Terminal from Applications > Utilities > Terminal and use the following command to start the key generation:
ssh-keygen -t rsa
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
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.
- Click into your user profile in the top-right corner, and click on User Settings.
MyKinsta user settings. - In the My Account tab, click on the Add SSH key button.
Add SSH key in MyKinsta. - 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.
How to connect to SSH on Windows with SSH keys
- Launch PuTTY and enter your Host IP Address and the unique Port number (both found in MyKinsta > Sites > sitename > Info > SFTP/SSH > Host).
Host IP and Port number in PuTTY client. - Under Connection > Data enter your Kinsta username in the Auto-login username field.
SSH Auto-login username in PuTTY. - 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. - 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. - 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. - If you set up a passphrase, you’ll need to enter that.
Enter passphrase for key, if applicable. Otherwise, you’ll be logged right in.
Logged into the site with an SSH key.
How to connect to SSH on MAC/Linux with SSH keys
- Launch the Terminal from Applications > Utilities > Terminal.
- You now need to load your saved private key using the following command:
ssh-add ~/.ssh/id_rsa
- If you set a passphrase for your key, you’ll be prompted to enter that.
- 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.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2024%2F06%2Fwordpress-ssh-terminal.png&w=3840&q=75)
Disable/enable SFTP/SSH access
If you want to disable SFTP/SSH access so no users can connect via STFP/SSH, on your site’s Info tab, click Disable.
![Disable SFTP/SSH access.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2024%2F06%2Fwordpress-sftp-disable-1024x316.png&w=2048&q=75)
To confirm the changes, click Disable SFTP/SSH access.
![Confirm the changes to disable SFTP/SSH access.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fwordpress-sftp-disable-confirm-1024x369.png&w=2048&q=75)
When SFTP/SSH access is disabled, the connection details are no longer shown.
![SFTP/SSH access disabled.](/_next/image/?url=https%3A%2F%2Fkinsta.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fwordpress-sftp-disabled-1024x152.png&w=2048&q=75)
If you want to enable access and show the connection details, click Enable > Enable SFTP/SSH access.
Additional notes
If you have trouble connecting, you might need to change the password or delete entries from your known_hosts file.