SSH is software that allows you to manage your website by typing in powerful commands. It stands for ‘Secure Shell’, and when it is installed on both your computer and web server, you can securely manage your site using a command-line interface.
Less technical users will never need to use SSH. Advanced users might use it to remotely log in to their web server and transfer files and folders, edit directories, or execute commands.
SSH comes pre-installed on Mac or Linux. On Windows, the PuTTY application can be installed to add SSH support. SSH must also be installed and enabled on your hosting provider’s web server.
What Is a Shell?
Most WordPress websites are installed on a server running the Linux operating system. On Linux, the ‘shell’ is the name given to the command-line interface.
Many advanced users enjoy using the shell because they can type in flexible and powerful commands to manage their websites. However, this is optional.
Here are a few examples of the commands you can use:
cd directory_name
changes the specified directory or folder.ls
lists the contents of the current directory.mkdir directory_name
creates a new directory.cp source_file destination_file
copies a file.chmod permissions file_name
changes the permissions of a file.apt-get install package_name
installs new software on the server.
Once you have connected to your website using SSH, you can get a full list of the available commands by entering ‘help’.
Like many users, you may not have technical knowledge of shell commands. In that case, you don’t need to use SSH and can manage your website files using an FTP client or the file manager application provided in your hosting provider’s dashboard.
For more information, see our beginner’s guide on how to use FTP to upload files to WordPress.
How Do You Connect to Your Website Using SSH?
SSH is a client-server technology. This means that you need special software installed on your computer and web server.
So, the first thing to check is that SSH is set up in your hosting account. You can do this by contacting your hosting provider or checking your host’s cPanel or settings.
You will need to keep a record of your website’s IP address and the username and password needed to access SSH.
You will also need to know the port number used by SSH if you changed it from the default setting of 22.
Connecting From a Mac or Linux Computer
Once the server is configured and you have an SSH client, you can connect to your website by typing a command like this into a Mac or Linux terminal app:
ssh username@server_ip_address
Don’t forget to replace the username
and server_ip_address
with the settings you wrote down earlier.
Connecting From a Windows Computer
If you want to connect to your website over SSH from a Windows computer, then you will need to install and launch the PuTTY application.
You will be asked to type in your SSH IP address and port number. PuTTY will remember your settings for future sessions.
After clicking the ‘Open’ button, you will be asked to enter your SSH username. After that, a terminal window will open where you can type your SSH password.
How Can You Use SSH in WordPress?
Once you are familiar with shell commands, you can use SSH to perform many tasks related to managing and maintaining websites.
These include uploading files, installing and updating software, editing server configuration files, backing up the WordPress database, and troubleshooting issues.
Here are a few tutorials we have written that show you different ways to use SSH to manage your WordPress website:
- How to Enable Imagick on Your WordPress Site
- How to Find a Backdoor in a Hacked WordPress Site and Fix It
- How to Fix Secure Connection Error in WordPress
- How to Fix the 500 Internal Server Error in WordPress
- Useful WordPress Configuration Tricks That You May Not Know
How to Use SSH to Make FTP File Transfer Secure
Once you have enabled SSH on your server, you can also use it to secure your FTP sessions. This is known as SFTP.
FTP stands for File Transfer Protocol and is like a file manager for your website, where you can upload, copy, and delete files using drag-and-drop.
When SSH is available, your FTP client can use the SFTP protocol to securely connect to your website. This means that hackers will not be able to intercept your files as they are uploaded.
You can learn more in our glossary entry on SFTP.
We hope this article helped you learn more about SSH in WordPress. You may also want to see our Additional Reading list below for related articles on useful WordPress tips, tricks, and ideas.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.