How to Fix the SSH “Connection Refused” Error

How to Fix the SSH “Connection Refused” Error


How to Fix the SSH “Connection Refused” Error

Are you getting the ‘Connection refused’ error over SSH? 🙅‍♂️ Learn why that’s happening and how to troubleshoot SSH connectivity errors.
👉Subscribe: https://www.youtube.com/c/Kinsta?sub_…

Secure Shell (SSH) is a WordPress development tool. It allows advanced users access to crucial platforms and software that make coding and other tasks more efficient and organised. If you attempt to use SSH and see a “Connection refused” error, don’t panic. This is a common error and it has a fairly simple fix.

In this video, we’ll discuss what SSH is and when to use it. Then we’ll explain some common reasons your connection may be refused and provide tips on how to solve SSH related issues.

ℹ️ About Kinsta

Kinsta is an award-winning Cloud Platform designed to host and manage your WordPress sites, Applications, and Databases faster and more efficiently. Trusted by 25,000+ companies worldwide, from developers, startups, and agencies, to multinational brands, we guarantee lighting-fast performance, enterprise-level security, ease of use, and exceptional support.

🚀 Try our flagship Managed WordPress Hosting plans and get $240/month worth of premium features included in every plan. That’s free unlimited migrations, 20% faster load times thanks to Google’s fastest servers and Premium Tier network backed by Cloudflare’s 275+ CDN locations worldwide, and 24/7/365 multilingual technical support from humans in less than 2 minutes.

👉 Try risk-free with our 30-day money-back guarantee Powerful Managed WordPress Hosting

👤Follow us:
https://kinsta.com/blog/
https://kinsta.com/newsletter/
https://twitter.com/kinsta
https://instagram.com/kinstahosting
https://facebook.com/kinstahosting

💡Discover all of our hosting solutions ► https://kinsta.com/



🕘Timestamps

0:00 How to Fix the SSH “Connection Refused” Error
0:48 What Is SSH and When Should I Use It?
1:48 Why Is My SSH Connection Refused?
5:28 Why Does PuTTY Say Connection Refused?
5:50 How Do I Troubleshoot SSH Connectivity Errors?



For more information on how to fix the SSH “Connection Refused” error, check out our blog post:
https://kinsta.com/knowledgebase/ssh-

___________________________________________________________________________

🔇This video has captions (translated by real humans!) in English, Spanish, Italian, French, Portuguese, German, Dutch, Japanese, Danish and Swedish. Click on the CC to set your preferred language.

#connectionrefused #ssh #ssherror


Content

0.15 -> - Hello, I'm Mike and today I'm going to show you,
2.32 -> how to fix the SSH connection refused error.
5.023 -> (upbeat music)
11.18 -> Secure Shell or SSH is a key WordPress development tool.
15.31 -> It grants advanced users access
17.29 -> to key platforms and software
19.27 -> that makes coding and other tasks easier, faster
22.35 -> and more organized.
23.8 -> So if you attempt to use SSH only
25.87 -> to see a connection refused error,
27.81 -> you may start to feel concerned,
29.47 -> however, this is a common issue
31.46 -> and it's entirely possible to fix on your own
33.59 -> with just a bit of troubleshooting.
35.43 -> But before we get too far,
36.67 -> I wanna let you know
37.503 -> that there'll be links to more resources
39.25 -> in the video's description below,
40.79 -> and remember to subscribe and ring that bell
43.06 -> to get notifications for future helpful content.
46.05 -> All right, let's get started.
49.87 -> SSH, also sometimes called Secure Socket Shell,
53.33 -> is a protocol for securely accessing your site server
56.91 -> over an unsecured network, in other words,
59.29 -> the way to safely log into your server remotely
61.57 -> using your preferred command-line interface.
64.02 -> Unlike FTP, which only enables you to upload, delete,
67.51 -> and edit files on your server,
69.43 -> SSH can accomplish a wide range of tasks.
72.17 -> For instance,
73.003 -> if an error locks you out of your WordPress site,
75.09 -> you can use SSH to access it remotely.
77.29 -> This protocol also enables you
78.83 -> to use several key developer tools including WP-CLI
82.95 -> the WordPress command-line.
84.87 -> Composer, a PHP package manager,
87.71 -> Git, a version control system used to track changes in code.
92.17 -> NPM, a JavaScript package manager.
95.76 -> It's important to note that using SSH is an advanced skill.
99.3 -> Generally speaking, lay users of WordPress
101.78 -> should contact the developers
103.24 -> or hosting providers for help,
104.84 -> rather than trying to resolve issues with SSH themselves.
109.738 -> Here's are some of the most common issues
111.28 -> that might be causing problems for you,
113.11 -> your SSH service is down,
115.1 -> in order to connect to your server with SSH,
117.33 -> it must be running an SSH daemon,
119.76 -> a program that runs in the background to listen for
122.03 -> and accept connections.
123.64 -> If the service is down,
124.76 -> you will not be able to successfully connect to your server
127.35 -> and may receive a connection refused error.
129.76 -> Your servers SSH daemon
131.66 -> may be down for a wide variety of reasons,
133.88 -> including unexpected traffic spikes, resource outages,
137.4 -> or even a DDoS attack.
139.25 -> In addition to the troubleshooting steps
140.89 -> we will cover in this video,
142.31 -> you may want to contact your hosting provider
144.24 -> to determine the root cause of this issue.
147.08 -> If you suspect that the SSH service might be down,
149.87 -> you can run this command to find out.
152.46 -> If the command-line returns a status of down,
155 -> then you've likely found the reason
156.34 -> behind your connectivity error.
158.23 -> You have the wrong credentials.
159.82 -> Although it may seem too simple to be true,
161.68 -> it's possible that you're just entering
163.16 -> the wrong credentials when trying to connect to your server.
166.03 -> There are four pieces of information needed to run SSH,
169.79 -> host name, the IP address of the server
172.22 -> you're trying to connect to or your domain name,
175.12 -> username, your SFTP or FTP username,
179.03 -> password, your SFTP password or your FTP password,
183.26 -> port, the default port is 22,
186.24 -> however, some hosting providers including Kinsta,
189.22 -> change their SSH port number for security reasons.
192.37 -> If this is the case, you should be able to find it
194.25 -> by logging into your MyKinsta dashboard.
196.89 -> You can also check to see which port is being used for SSH
199.91 -> by running this command,
201.67 -> the command-line should return the correct port.
205.03 -> The port you're trying to use is closed.
207.74 -> A port is simply the endpoint
209.64 -> to which you're directed when connecting to your server.
212.52 -> In addition to making sure you have the correct one,
214.94 -> you'll also want to check to see
216.28 -> if the port you're trying to use is open,
218.24 -> any open port is a security vulnerability
220.76 -> as hackers can try to exploit it
222.27 -> and gaining access to the server.
224.16 -> For this reason,
225.15 -> unused ports are often closed to prevent attacks.
227.8 -> In the event that port 22,
229.42 -> or the custom SSH port for your server has been closed,
232.88 -> you will likely see a connection refused error.
235.35 -> You can check to see if the port is listening,
237.51 -> by running this command,
239.43 -> the command-line should return a list of ports
241.4 -> and the respective states.
242.97 -> You want port 22 or the custom SSH port
245.93 -> for your server state to be listen,
248.52 -> if it's not, you'll need to reopen the port
250.7 -> in order to connect to your server.
252.83 -> SSH isn't installed on your server.
255.26 -> As we briefly mentioned earlier,
256.95 -> servers use SSH daemons to listen for
259.86 -> and accept connections.
261.47 -> Therefore, if the server you're trying to connect to
263.62 -> doesn't have one installed,
265.27 -> you obviously won't be able to access it using SSH.
268.18 -> Generally speaking, almost all hosting providers
270.58 -> will have SSH deamons installed on their servers by default.
274.22 -> This particular issue is more common on localhost
276.82 -> or dedicated servers.
278.19 -> Firewall settings are preventing an SSH connection.
281.07 -> If your setup appears to be in order
282.7 -> and you still can't connect,
284.36 -> take a look at your firewalls rules,
286.71 -> you can display them in your command-line interface
289.01 -> with the following commands
291.36 -> Your results will vary,
292.74 -> but you want to look for these elements
294.14 -> to determine if your firewall is blocking SSH connections.
297.44 -> dport 22, this refers to the destination port,
301.03 -> which for SSH is usually port 22.
304.07 -> REJECT, this would indicate
305.86 -> that connections are being refused
307.5 -> from the specified destination.
309.87 -> DROP, like reject, this means that connections
313.44 -> to the relevant port are being blocked.
315.62 -> If you search the results of the commands for dport 22,
318.7 -> you should be able to determine
319.95 -> if your firewall is preventing an SSH connection,
323.01 -> if so, you'll have to change the rules to accept requests.
326.81 -> Why does PuTTY say connection refused?
329.56 -> PuTTY is an SSH client, if you're familiar with FTP,
333.54 -> this platform is the FileZilla
335.24 -> equivalent to SSH on Windows machines.
338.07 -> In other words, PuTTY enables users
339.86 -> to input their credentials and launch an SSH connection.
343.38 -> If you're PuTTY user and see the connection refused error,
346.12 -> the cause is likely one of those I previously mentioned.
348.9 -> How do I troubleshoot SSH connectivity errors?
351.71 -> When you're experiencing an SSH connectivity error,
354.46 -> there are a few steps you can take to troubleshoot it
356.43 -> depending on the cause.
357.54 -> Here's some tips for troubleshooting
359 -> a connection refused error.
361.19 -> If your SSH service is down,
363.26 -> contact your hosting provider
364.55 -> to see why your SSH service isn't running.
367.42 -> For local host or dedicated servers,
369.57 -> you can use this command to try to get it running again.
373.57 -> If you entered the wrong credentials,
375.81 -> after you've double checked the SSH port
378.03 -> using the appropriate command,
379.63 -> try connecting again with the correct details.
382.33 -> If your SSH port is closed, either install an SSH daemon
386.06 -> on the server you want to connect to,
387.77 -> or change your firewall rules
389.19 -> to accept connections to your SSH port.
391.64 -> If SSH isn't installed on your server,
394.09 -> install an SSH tool such as OpenSSH
397.12 -> on the server you want to connect to
398.68 -> using this command.
401.45 -> If your firewall is blocking your SSH connection,
404.24 -> disable the firewall rules blocking your SSH connection
407.09 -> by changing the destination ports settings to accept.
410.4 -> If you're attempting to connect
411.56 -> to your hosting provider server,
413.34 -> it may be wiser to contact support,
415.42 -> than to try troubleshooting these problems yourself.
418.21 -> Users on localhost or dedicated servers
420.48 -> may be able to find further support on more advanced forums
423.74 -> if none of these troubleshooting solutions works.
428.41 -> Kinsta WordPress hosting can speed up your website
430.95 -> by up to 200%, and you'll get 24/7 support
434.12 -> from our expert WordPress engineers.
436.55 -> Let us show you the Kinsta difference,
438.46 -> try a free demo of our MyKinsta dashboard
441.06 -> at demo.kinsta.com.
443.49 -> Thank you for watching and don't forget to subscribe
445.95 -> to get notifications for the remaining videos in the series,
448.68 -> and of course, other tutorials and explainers
451.33 -> and helpful content like this.
453.009 -> (upbeat music)

Source: https://www.youtube.com/watch?v=-tl_-d0JfuU