Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs

Dashboard
Notifications
Mark all as read
Q&A

Connection closed by remote host in Putty with hosting provider says that the problem is not on their side

+1
−2

I use my smartphone as my "router", with dynamic IP addresses, for nearly 3 years and never had any problem SSHing into various shared hosting environments with Putty.

I host my website on a CentOS based shared server environment by Namecheap (Stellar business plan); I have joined there with that plan a few months ago; I normally SSH into that shared hosting environment with an all default Putty 0.70 and the SSH connection is being done with a keyphrased private key and public key.

My problem

In the last few days I have started to experience sudden disconnections from Namecheap's shared server environment with Putty, with the error:

Connection closed by remote host

This problem would normally occur less than five mintues after the SSH connection to that environment:

  • I can experience a disconnection while typing commands
  • It doesn't matter if commands have been executed or not
  • Changing keepalive value from 0 to 1 didn't help
  • A similar problem happens with MobaXterm

Contacting Namecheap's support

I have tried to contact the customer support of Namecheap and they say that they have tried to SSH into my account from their computer and didn't encounter any problem.

They suggested to reboot the router (my smartphone) and to try again; I did so by principle but it didn't solve the problem.

Namecheap's staff also asked me to execute various tracert NAMECHEAP_IP commands from CMD spanning hundreds of lines (hence I avoid pasting it here) and after reviewing all the output they said:

The issue seems to be caused by a dynamic IP address. It causes a logout very soon after logging in via SSH.
The dynamic IP can be provided by your current ISP (or it can be a feature of the VPN connection if you use any).
The possible solutions are:

  1. Contacting your ISP for providing a static IP address or a dynamic IP address, but within the same /24 subnet only.
  2. Configuring a VPN service with a static IP (or within /24 subnet as well).

Interim note

I have no desire to use a static IP, nor do I want to use a VPN.

My question

How would you suggest to cope with that problem?

In that particular case I can bypass the problem by using GUI tools but I still ask this by principle.

Update_1

I think that the problem is now solved.

Namecheap's support staff reported:

Our technical department has found that the SSH access was not enabled properly for your hosting account:
the cPanel username was not added correctly in whitelist here: /etc/csf/csf.pignore.nc .
As a result, our firewall noticed that some processes kept being open and closed the connection. The cPanel username is added now.

To me that makes sense because indeed the problem started after changing a Cpanel username.

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

1 answer

+5
−0

Fault isolation

You need to take some basic steps to isolate where the problem actually lies.

So far, it seems that you have tried with:

  • one means of connecting to the Internet (presumably your cell phone carrier's data plan)
  • one ISP (presumably your cell phone carrier)
  • one host (your local computer)
  • one remote host
  • one transport-layer protocol (TCP/IP)
  • one application-layer protocol (SSH)
  • one client implementation (PuTTY)
  • one client operating system (presumably some version of Windows)
  • one server implementation (whatever is running on the remote host)
  • one server operating system (whatever is running on the remote host)

This is nowhere near enough to determine where the problem might lie, as any one of these could potentially be the culprit.

So, start thinking about how you can change these, one at a time, and see what, if any, change causes the problem to be reduced in magnitude or even go away entirely. Here are some suggestions for how you can approach that; this is not an exhaustive list.

  • Do you have any other equipment through which you can connect to the Internet? Can you perhaps try using a different phone? A tech-savvy friend, colleague, neighbor, other family member, or any of a number of other categories of people should be able to help you out with this. If this works, it's something about how you're using your phone as an access point and router.
  • Can you try to connect through a different carrier's network? (Or other local upstream provider.) This need not be the same type of upstream connection; if you typically use mobile broadband, for example, don't rule out trying on someone's free WiFi somewhere. If this works, it's likely something that the carrier does that causes your problems.
  • Can you try connecting from a different computer? Failing that, can you boot from some kind of live media (for example one of the Linux live distributions) and connect from there? If this works, it's likely something local to your system.
  • Can you try connecting to a different host over SSH? There's a fair number of places where you can get free SSH accounts with shell access on systems administered by others; the Tildeverse (try here and here) might be a good place to start looking. Alternatively, just spin up a cheap VPS with some other provider; LowEndBox might be a decent place to start looking for cheap, paid options. If this works, it's likely something about the remote host's configuration.
  • Can you try a long-running connection that isn't SSH? For example, do you have the same problem if you connect to your ISP's SMTP server and just let it sit there after the initial SMTP HELO command? Are you able to download a large file (sufficiently large to take those several minutes to download) without the download being interrupted? If this works, it's likely not related to the connection duration as such.
  • Can you try using some other software? Windows provides a rudimentary telnet client that you can install and use to connect to virtually anything but which of course doesn't speak SSH, or you can try using a different SSH client. If this works, it's likely a problem with either PuTTY's SSH implementation, possibly in interaction with the specific software and settings on the remote end, or some setting within your instance or for your connection.
  • Can you try setting your SSH client to some kind of debug or verbose mode? In itself, this won't solve your problem, but there is a chance that it might help point you toward the culprit.
Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

I reside in a country in which I barely speak the native language, my family isn't here, generally al... (2 comments)

Sign up to answer this question »

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!