This is a quick step-by-step walkthrough for logging into your WordPress Hosting container via SSH.
Before you start using SSH, you will need to create a private and public keys. For more information on creating SSH keys, please read our Knowledge Base article ‘How to create an SSH key’.
Logging into your WordPress Hosting container
Configure SSH access to your account
Shell access to your account uses the same details as FTP, so you may need to follow our guide on ‘How to Manage Your FTP Access Details’, in order to update your password. You will also need to unlock your FTP account before you can SSH into your container.
Connect to your account using SSH
You will need to connect to your account using SSH in order to access WP-CLI. Exactly how to do this will depend on the operating system that you are using.
You should use a client such as PuTTY.
Mac OS X
The ssh command is available from Terminal (Applications > Utilities > Terminal).
Login via SSH
Once you have unlocked STP, login to your WordPress Hosting container using your SFTP username and your container’s IP address.
You may then receive a connection authenticity warning. Type ‘yes’ and hit return to continue.
When prompted, enter your SFTP password to login.
Create a new folder called ‘.ssh’
Then you’ll need to create a new folder called ‘.ssh’. To do this, simply enter the following command.
mkdir -p /var/www/vhosts/yourdomain.com/.ssh
Please note: Replace yourdomain.com with your own domain name.
Set permissions on your ‘.ssh’ folder
After the folder has successfully been created, you then need to set the folder’s permissions. To so this, simply enter the following command.
chmod 700 .ssh
Create a new file called ‘authorized_keys’
Then you’ll need to create a new file called ‘authorized_keys’ inside your ‘.ssh’ folder. To do this, simply enter the following command.
Set permissions on your ‘authorized_keys’ file
After the file has successfully been created, you then need to set the files’s permissions. To so this, simply enter the following command.
chmod 600 .ssh/authorized_keys
Add your public key to the .ssh/authorized_keys file
You then need to copy and paste your key into your ‘authorized_keys’ file. Firstly, copy your public key to your clipboard. Then enter the following command.
Press I key on your keyboard, go to into insert mode. Then paste your key into the editor provided.
Then press the ESC on your keyboard, go exit insert mode.
Finally, type the following command to write your changes and quit VIM.