A vital tool for developing WordPress is Secure Shell (SSH). It makes critical platforms and tools available to expert users, making coding and other tasks simpler, quicker, and more structured. Therefore, if you try to utilize SSH and receive a “Connection rejected” message, you can start to worry.
But since this is a typical problem, you should be able to resolve it on your own with a little bit of troubleshooting. In no time at all, you’ll be back to issuing orders. We’ll go through what SSH is and when to utilize it in this article. Then, we’ll go over some typical explanations for why your connection can be denied, especially in PuTTY. We’ll offer some troubleshooting advice towards the end. Let’s start now!
SSH: What Is It?
Let’s take a quick look at what SSH is before we get started fixing this problem. A network protocol called Secure Shell (SSH) is used to connect to a web server. In essence, it enables secure encryption for connections to your website, even when using an unprotected network. SSH and FTP/SFTP, another method for connecting to your website, are frequently contrasted.
A TCP/IP network is used to move files between computers using the FTP (File Transfer Protocol) protocol. FTP’s lack of encryption is by far its worst drawback. Your connection may be hijacked, and your server’s files may be altered by a malicious party. SFTP was created as a remedy for this. FTP functions similarly to SFTP, which stands for Secure File Transfer Protocol or SSH File Transfer Protocol.
It does this, though, over a secure connection as opposed to an unencrypted one. SFTP makes advantage of the more advanced SSH protocol to safeguard your connection. Thus, SFTP operates “on top of” SSH. SSH gives you the ability to perform many more operations than FTP/SFTP, which is just capable of file management. These consist of
1. Remote command line
SSH enables you to switch from the usual GUI to a Command Line Interface (CLI). In reality, you can use the command line to activate your Astra license!
Unable to log into your WordPress website? SSH is a legitimate method for logging in.
3. Execution of Commands Remotely
Want to remotely run commands on your server? With SSH, there is no issue.
4. Use WordPress Developer Tools
5. Eliminate Corrupt or Compromised Files
Using SSH, you can inspect any recently updated files and check to see whether they contain harmful code or if your website has been hacked. In the end, SSH is a secure protocol for accessing your server, whereas FTP/SFTP is a method of moving files to and from a server.
What Is the SSH “Connection Refused” Error?
The “connection rejected” problem is one of the most frequent ones you’ll encounter when attempting to use SSH. What does that mean, though? What Connect Refused actually means is what it says. It indicates that your login information is incorrect or that the connection could not be established properly. This error may have a number of distinct root causes. Let’s quickly go over each of these.
1. There’s a Problem with Your Network
SSH will likely be impacted if there are performance issues with your network.
2. The Qualifications Are Incorrect
SSH won’t connect if your hostname, username, password, or port is incorrect.
3. SSH isn’t Set Up
Although SSH is typically pre-installed on web providers, some dedicated hosting plans demand that you do so.
4. SSH has Problems
SSH could be unavailable for a number of reasons, such as a DDoS assault or excessive traffic.
5. Access is Being Restricted by Firewalls
Universities, businesses, and educational institutions frequently block communication on port 22, which is used for SSH.
Read More: How to Fix Lag in Android Phone Easily?
How to Fix the SSH “Connection Refused” Error
Let’s now go over a few alternative solutions. Starting at the top and working your way down will help you determine which of them has the best chance of working.
1. Check Your Network Connection
Even while it might seem obvious, it never hurts to double-check! Is there a problem with your network connection? Do you have any trouble accessing other websites? Does your website load properly? Verify that everything functions as it should.
Solution: There are a few things you can do if it isn’t. Restart your computer or router. Test the connection using an alternative network location if at all possible. A quick approach to achieve this is by using the tethered Internet connection from your phone. Check whether other web services, such as SFTP, are operational.
2. Verify Your Credentials Again
Is the connection stable? How about your login information? The most frequent cause of a broken connection is using incorrect credentials.
Solution: You’ll need to make sure the following are accurate:
Host Name: The Host Name is either your full domain name (also known as an FQDN) or your IP address. Uncertain of your IP address? Utilize this handy tool.
Username: You must provide your FTP/SFTP account in the username field. Usually, you can find this in your web hosting control panel or in an email, your host sent you when you bought the plan. Here are some links to popular hosts:
SiteGround – How to create, edit and delete FTP accounts
BlueHost – How to Create an FTP account
GreenGeeks – Getting Started: Setting Up FTP Accounts in cPanel
Password: This also serves as your FTP/SFTP account password. Look on your hosting panel if you can’t locate it there.
3. Restart the Server
You’re on a dedicated server, right? Alternatively, do you actually own your server?
Solution: Consider restarting your server. This frequently resolves connectivity problems. If you’re operating your website from it, just be sure rebooting won’t affect visitors!
4. Verify SSH Installation
A program known as a daemon must be installed on the server for PuTTY to connect to in order for SSH to function. This is a simple application that watches for incoming connections and, if the credentials are valid, accepts them. This daemon will almost certainly be deployed on all servers, especially if you use a managed WordPress host. However, you might have to install it manually if you’re utilizing a dedicated host.
Solution: Depending on your host and server, the installation procedure will vary. Use OpenSSH if you wish to manually install it on a Linux Ubuntu server. SSH may be quickly enabled if you use SiteGround by navigating to Site Tools > Devs > SSH Keys Manager. Input a key name and create a random password there, then click Create.
You’ll need these credentials to visit your site through PuTTY, so be sure to write them down. The complete instruction is available to read on SiteGround’s website. You must navigate to Advanced > SSH/Shell Access in cPanel, fill out the necessary fields, and then click Generate. Similar procedures for adding SSH keys are used by other hosts.
5. Verify SSH is Operating Properly
As was already said, installing a daemon is required to connect via SSH. You won’t be able to access your server if it isn’t functioning. The daemon may not be responding for a variety of reasons, including hosting issues, DDoS assaults, or heavy traffic.
Solution: You must type a command into PuTTY to see if your daemon is active. Who is it? Your server’s specific Linux installation and configuration will determine how it responds. The most widely used operating system among web hosting companies is Linux.
6. Firewalls and Ports
It’s quite likely that a firewall is blocking port 22 if you’re signed in from a university, corporate campus, or another sizable establishment. Test of SSH server connectivity
Solution: Use this tool to find out if it is. Simply add your domain, confirm that port 22 is specified, and click Check. Success in the connection test indicates that the problem is with your computer or connection rather than the port. Contact your network’s system administrator or check the firewall rules.
7. Speak with Your Host
Problems persisting? Time to get in touch with your host! They might be able to assist you. The error could even be completely different, such as “ERR CONNECTION REFUSED.” Therefore, you must also consider this possibility.
Learning how to utilize SSH will be well worth your effort because it is a powerful technology. It enables secure site access, file management, process execution, and a host of other practical functions. I hope this article helped you fix the “Connection Refused” error. Despite the confusion, this issue may cause, fixing it shouldn’t be too difficult.
All you have to do is run a few of the tests we discussed before. Have you ever encountered the “Connection Refused” error? What remedy did you employ? To assist us and other readers, please share it in the comments!