One of the most convenient and secure methods for accessing your WordPress website is using SSH Tunnel. In this article, we will talk about the SSH protocol and its function on WordPress sites.
An introduction to WordPress SSH
Running a WordPress site can be time-consuming. Updating WordPress, installing plugins, adding or deleting files, checking the database, and every little thing connected to WordPress sites can make you log in to the dashboard several times. But, using Secure Shell (SSH) can make your tasks a lot easier. Also, SSH connections are much more secure than FTP connections that are supported by WordPress. So, enabling WordPress SSH access can give you a higher level of encryption and security when working with your website.
In order to learn how to enable WordPress SSH on your site, let’s start with an introduction of SSH protocol.
What is SSH?
SSH is an acronym for Secure Shell or Secure Socket Shell. It is a cryptographic network protocol typically used for communicating and sharing data between two computers. Using a client-server architecture, SSH provides a secured channel for SSH File Transferring Protocol (SFTP) or SSH Secure Copy Protocol (SCP). (Note that SFTP is different from FTP over SSH.) It is also used to log into a remote machine and execute commands. In fact, SSH is a protocol for secure remote login that mainly consists of three components:
- The Transport Layer Protocol: SSH-TRANS provides confidentiality, integrity protection, key-exchange, and server-host authentication. It may also provide compression, optionally. However, this layer will often be executed over a TCP/IP connection but a unique Id session may be derived to be used by higher-level protocols.
- The User Authentication Protocol: SSH-USERAUTH authenticates the client-side user to the server. In this protocol, the client sends packets of the type USERAUTH-REQUEST that contain user credentials. All of these requests should contain a username, a service name, and a method name. shortcode of this request will be something like this:
def userauth-request (username, next-service, auth-method, *others)
- The Connection Protocol: SSH-CONNECT multiplexes several channels of data over an authenticated transport. In fact, several channels multiplex into a single encrypted tunnel. Overall, SSH-CONNECT provides forwarded TCP/IP connections, forwarded x11 connection, interactive login sessions, and remote execution of commands.
As a remote administration protocol, SSH allows users to manage, control, and modify their remote server. But do you know how does SSH exactly work?
Why is SSH Used and How Does it Work?
As you know, SSH protocol enables at least two parties to communicate and share data in a secure way. It provides users with strong password authentication and public key. In fact, secure shell is created to replace insecure connections or login programs such as rlogin (Remote Login), Telnet, and rsh (remote shell). Also, some file transfer programs like rcp (remote copy) or File Transfer Protocol (FTP) can be replaced by SSH.
Regarding administrators, SSH is widely used by them as a secure remote desktop protocol. When a secure shell connects to a remote host for a terminal session, the form of the connection is something like the following command:
This command will let the client attempt to connect to the server named server.example.com by using the user ID UserName. The encryptions and authenticating between client and server is made using a client-server model. by default, TCP port 22 is used. In this stage, the host (server) listens to this port (or any assigned port) for incoming connections. If the verification is successful, the secure connection will be established by authenticating the client and opening the correct shell environment.
Then, the SSH connection must begin by initiating a TCP handshake with the server by the client. In this session, the users must authenticate themselves. If the credentials match, then access to the SSH is granted.
How to Connect to WordPress SSH?
In order to access your WordPress website over SSH, you need to know your login data and server information. Remember, this information is a set of credentials you use with your web host, and login data are not the same as your WordPress Dashboard login (wp-admin).
Once you find the server credential, you just need to install an application to get connected (for Windows users). First, log in to the website for your hosting provider. Look for finding cPanel or hosting control panel or anything related to Shell Access or SSH. Make sure it’s enabled. As we mentioned before, you need your server and login information, which can be something looking like this:
- Server: name.com
- User: username
- Password: **********
Now, you take the credentials and connect to your server using a program on your PC. Notice, for Mac and Linux users there is no need to any installation. For these operating systems, do the following steps:
- Type the following command:
ssh [email protected]
- You will be prompted for a password.
- Now, you are connected. You can check that you are in the root directory of your WordPress website by typing:
This command will show you the list of all contents of the folder you are in. All WordPress files in those folders (wp-admin, wp-content, wp-includes, etc) can be seen.
As I said, there is a built-in Terminal to use for Linux and macOS users. They can access their WordPress site via SSH by using this interface. But what to do if you are a Windows user? For Windows, you need to install an SSH client. In the next part, we will explain the instructions for PuTTY, an SSH client for Windows.
Best Virtualizor VPS Hosting Panels
Virtualizor is a powerful graphical based Control Panel to manage servers and VPS servers. With Virtualizor you have fully access to your Windows VPS or Linux VPS. Not only limited to VNC (Remote Access) when your server is down or ability to hard reboot your Server.Plans & Pricing
What Is PuTTY and How to Use It for WordPress SSH?
PuTTY is the world’s most popular SSH client for Windows users. This is a free and open-source application that can support several network protocols including SSH, SCP, Telnet, rlogin, and new socket connections with good terminal emulation. It supports public key authentication and Kerberos single-sign-on, and includes command-line SFTP and SCP implementations. Although PuTTY is commonly used on Windows, it is also available on Mac and Linux. You can download it from the following links:
After downloading PuTTY SSH, you should learn how to use it on your site in order to connect to a VPS or to your WordPress hosting account. First, install PuTTY in your Windows OS. Next, there are a few requirements for the configuration of PuTTY set up. You will need:
- Server IP Address or Host Name
- SSH Port
- SSH Username
- SSH Password
After entering the required information, click on Open (or press Enter). When you connect for the first time, you may see a Security Alert Dialog Box saying that the Server’s host key is not cached in the registry. This is normal when you are connecting for the first time. But next time you get this error, this means someone is trying to attack your connection and steal your password via a man-in-the-middle attack.
Advantages of Using SSH on WordPress Sites
SSH helps a WordPress sites increase the level of their security. Below is the list of some specific things SSH protects you from:
- IP Source Routing or Spoofing: your IP can be used by malicious users. They can collect some useful information such as network’s topology in order to perform an attack. SSH can help you against these types of attacks.
- DNS Spoofing: this kind of attack is preventable by using SSH over WordPress. DNS Spoofing is a hacking attack where data is inserted into Domain Name System (DNS) of name server’s cache database.
- SSH Commands Are Fast: Using commands can be much quicker than WordPress admin screen.
- It Is Convenient: you can connect to your website from anywhere. By using SSH over WordPress, you do not need to have a web browser or connect to WordPress Admin screen.
Being able to access your WordPress site via SSH can give you more security and encryption. It also brings you the fastest experience of working with WordPress, thanks to its useful commands.
Best WordPress VPS Server Hosting
You may want to have dedicated and reliable resources just allocated to your website or multiple websites then you have to get a WordPress VPS server to run your website securely and on reliable resources, in the other words, you have secure, fast, and your own resources. With our one-click VPS.Plans & Pricing
How Can I Automate SSH Commands with WordPress?
When you use WordPress SSH, you can automate commands that you frequently use. Use WP-CLI or WordPress command-line interface to do this. It can help automate WordPress management tasks such as updating your WordPress installation, configuring remote access, and installing plugins.
Is It Important to Have SSH Access For WordPress Hosting?
SSH is very essential for WordPress Hosting. Since WordPress SSH provides more security and convenience for users and administrators, it is very important to have SSH access for WordPress hosting.
How To Login to WordPress Hosting Using Your SSH Key?
The quick step-to-step walkthrough can be something like this:
- Configure SSH access to your account.
- Connect to your account using SSH by using SSH commands for Linux and macOS, and a client such as PuTTY for Windows users.
- Login to your WordPress site via SSH.
How to Connect to Your Websites via SSH?
Learning how to connect to your WordPress website via SSH is fairly simple. It can be done by following steps:
- Download and set up an SSH Client
- Access your server via SSH
- Interact with your server using the command line
How Do I Access My WordPress Command-Line?
WP-CLI is one of the command-line tools designed to manage your WordPress websites using the command line. In order to access the WordPress command line, first, download and set up an SSH client. Then, access your server via SSH WordPress command line. Finally, interact with your server using the command line.