Getting Started with SSH for WordPress users
Running a WordPress website often involves many time-consuming maintenance tasks. Update WordPress, delete or add files, check the database; for everything you need to do, log in to the WordPress Dashboard. In this SSH Beginners Guide, you will learn how secure Shell access can make your life easier.
SSH allows you to securely access the server remotely via the command line. Now you can do what takes minutes of back-end clicks in seconds with a simple command click.
In this article, we will teach you everything you know about SSH, help you connect to the site, and show you some basic getting started commands.

article directories
What is SSH?
Access to remote computers requires careful handling. Although protocols like FTP exist, they are not very secure. FTP only allows the transfer of files and not much else.
SSH is the solution: functions that can be accessed directly from the desktop and controlled by running remote commands. It is powerful, safe and very convenient for developers.
Thanks to the secure shell, no one can easily listen to what you are doing or intercept your connections to send their own commands. This is critical when you are performing sensitive operations, such as viewing hidden folders or downloading files to a server.

How it works is simple: the host at your site is running an SSH server, waiting for requests. If you know the server’s address, you can connect to it using the SSH client on your PC. Using a username and password, the connection will open and you can type terminal commands freely.
The direct nature of SSH makes it much faster than logging in to WordPress or even using an FTP client. So if you frequently move files, manage WordPress tasks, or constantly perform other server maintenance responsibilities, then it’s definitely worth a try.
SSH and FTP
You may be thinking: It sounds familiar. Isn’t it just FTP remote connections to your site?
SSH is just one of several ways to connect to a website remotely. FTP, FTPS, SFTP, SSH, and SSH-based FTP usually do the same thing, but each method has a different way to handle it.
FTP / FTPS, SFTP and FTP on SSH all have one thing in common: they are mainly used for file transfer. FTP is the most basic version of this concept and runs on insecure networks, while FTPS is a secure version of the same protocol. FTP over SSH uses an SSH tunnel between the FTP client and the server. SFTP is just an SSH protocol with file transfer functions.

Except for not encrypting FTP, there are no major drawbacks in any other way. They all have different use cases. When you need to transfer files, you should use FTP and its derivative tools, while SSH helps execute remote commands. It is worth noting that SFTP is generally considered more secure than FTPS or SSH FTP.
Who can use SSH?
Whether you have access to SSH depends on your host. Some are more restrictive than others. SSH gives you access to sensitive commands, and if you don’t know what you’re doing, it can easily destroy your website, so not every hosting company can provide SSH access. In particular, virtual hosting plans are unlikely to have it, otherwise critical features could be disabled.
Not sure? The ability to send email to your virtual host or check plans. You may have SSH access or the ability to install it. Even if you purchased an unmanaged host or are running your own server, you can still install OpenSSH yourself.
In addition, there are no special system requirements for installing or connecting to SSH, but you should be familiar with managing servers before trying to set up the server yourself.
How to connect to WordPress via SSH
SSH may sound like a very complex matter, but getting into it is actually very simple, especially if it is already installed on the server. Just get your credentials, start the terminal and connect. This is what we will discuss next in this SSH Beginners Guide.
Get SSH credentials
Before connecting to the site, you need to obtain SSH credentials. If you have used FTP before, the process is very similar.
Log in to your virtual host’s dashboard. Look for the section labeled “SSH Credentials”,”Access”/”Root Access” or similar. If you can’t find it, check the host’s documentation or send them an email asking for your SSH connection information.

If you set up SSH yourself on an unmanaged server, you should note the credentials you set up. In case you lose them, some SSH programs will include password verification. Or your host may allow you to reset them through the backend.
After obtaining the user name, password, connection address and port, you can start connecting. However, make sure to back up your website first, because if you don’t know what you’re doing, you could destroy it.
Although some hosts have a built-in console on the back end that lets you run SSH commands, you may use a built-in terminal in your Mac or Linux installation, or install programs on Windows.
Connect to Mac or Linux
For users running a UNIX-like operating system (MacOS or Linux), connecting to SSH is easy. You don’t need to download any external software or activate anything; you just need to use a pre-installed terminal.
- Mac users: Click the Launchpad icon in the Dock and search for “Terminal”, or open the Finder and go toApplications> Utilities, and then click to start Terminal.
- Linux users: Just open the application menu and launch the terminal.

You should see an empty console appear on the screen. To connect, type the following command:
ssh username@example.com
username
Replace with your SSH credentials and replace the example URL example.com with the IP or address of the SSH server.
You may connect via port 22, but if your host SSH port is not 22, add-p port
Go to the end of the above command. replacedport
is the correct port number. For example:
ssh username@example.com -p 21
You may see security warnings. just typeyes
You can continue; it should only happen the first time you connect to a new server.
When prompted, enter your SSH password. This way, you should connect!

Final note: If the host does have an SSH console on the back end, the connection works exactly the same as on a Mac or Linux.
Connecting with Windows
For Windows users, the process is similar, but only requires a little more work. Recently, Windows 10 implemented both an OpenSSH client and a way to run Linux distributions (including terminals), so this could be very easy. If you are using an older version of Windows, you need to install an SSH client.
The easiest way: Use the OpenSSH client built into Windows 10.
You can install OpenSSH servers and clients by setting up-applications-applications and functions-manage optional functions-add functions, prompting you to restart the installation, and restarting your computer.

Open a command prompt and typessh
To check if it is operating properly. If an error occurs, try restarting the computer or restarting the program.
If it does work, you can now connect to the common commands mentioned above:
ssh username@example.com
Another option is to run the Linux subsystem on the computer. The 64-bit version of Windows comes with a built-in Linux bash shell. In this case, all you need to do is activate the feature and install the Linux distribution from the Windows Store.
This is a guide to installing the Windows subsystem for Linux. Ubuntu is a good place to start because it particularly supports Terminal. After setting up is complete, just follow the guidelines above to run the correct commands and connect to the server.
The last option (and the only option if you are not running Windows 10) is to install an SSH client such as PuTTY.

Start the program and enter the host name/ IP and port number. Make sure the connection type is SSH, and clickopen。Then, enter your username and password and you are ready to connect.
Learn the command line
Compared to FTP clients or WordPress dashboards, SSH is unique in that it uses the command line. Graphical interfaces are generally easier to navigate, but much less efficient. With SSH, you don’t have to navigate menus or click on anything. You just type the command and execute it.
However, the downside is that the command line can be difficult to adapt to. This is a list of the basic SSH commands to start you.
ssh username@example.com
– Connect to the server. added-p port
Go to the end to use another port.cd
– Move to another folder.ls
– List the files in the folder.mkdir
–Create a new folder.pwd
– Displays the path to the folder you are currently in.touch
– Create a new file.rm
– Delete files.cat
– Display the contents of the file.head
– Read the first ten lines of the file.tail
– Read the last ten lines of the file.du
– Displays the size of the file.cp
– Copy files or folders.mv
– Move files or folders.zip
– Compress files or folders.unzip
– Extract files or folders.find
– Search for files and folders.grep
– Search for phrases in files and folders.wget
– Download files from the Internet to the server.scp
– Copy files to your computer.vim
/nano
– Edit files using Vim or Nano text editor.clear
– Clear the terminal.history
– Displays the 50 recently used commands.exit
– Close the connection.
If you want to learn more, there are many resources to delve into basic SSH commands. You can also try the Linux Command Line Starter Guide.
Using WP-CLI
WordPress users should definitely study WP-CLI, a command-line interface designed specifically for CMS. A lot of work can be done using default commands, but there are many WordPress specific tasks that cannot be done with basic SSH access.
Your host may already have WP-CLI installed, so all you have to do is connect via SSH and start issuing commands.
Otherwise, if you already have SSH access, you can install it yourself. You only need PHP 5.4 +, WordPress 3.7+ and Linux or Mac OS. You can find the WP-CLI installation guide in the WordPress documentation.
Here are some WP-CLI commands that may be useful to you:
wp cli
– Get information about WP-CLI and check that it is installed correctly.wp core
– Manage WordPress core installations, updates, etc.wp plugin
– Root of various commands used to manage plug-ins. example,wp plugin list
List installed plug-ins, orwp plugin deactivate pluginname
Deactivate a plug-in with that name.wp theme
– Activate, delete and install themes.wp user
– Manage, create and delete users; delete or add permissions.wp comment
– Review, add and delete comments.wp post
– Manage your articles.wp db
– Manage the database.
From executing PHP code to managing Cron plans on websites, WP-CLI can perform many more advanced operations.
SSH is for beginners
Why waste time working on a slow WordPress backend? Becoming a developer means finding more effective ways to complete all the mundane tasks you face every day. Using SSH, you can instantly connect to a website and execute commands from anywhere.
Not everyone can connect via SSH, especially users using virtual hosts. Also, if you have never used the command line before, or are new to Web development, it may take some getting used to. But once you try it, you will never look back.
Note: The content of this article is from Torque, written by Nick Schäferhoff, and translated and compiled by WordPress University.
Recommended reading:
- Manage Linux servers with WinSCP and PuTTY
- Operation and maintenance WordPress website under Pagoda Panel