Connection refused - Printable Version +- Post4VPS Forum | Free VPS Provider (https://post4vps.com) +-- Forum: VPS Discussion (https://post4vps.com/Forum-VPS-Discussion) +--- Forum: VPS Support (https://post4vps.com/Forum-VPS-Support) +--- Thread: Connection refused (/Thread-Connection-refused--3360) Pages:
1
2
|
RE: Connection refused - deanhills - 09-11-2019 @Khadeer143 I've referred the issue to @Dynamo. What you're asking us to do you can do yourself too, but I've asked Dynamo to check whether there are other issues that we may have missed about the VPS. RE: Connection refused - Mashiro - 09-11-2019 It turned out to be exactly as I said before. There is a normal SSH emergency access option available and it is called "Serial Console" in Virtualizor. This "Serial Console" doesn't require a Java plugin or something similar/different. You create a normal session that is valid for an hour and then you get SSH login details. Exactly just like with the SolusVM emergency SSH feature. I created such a session and could log into the VPS to run diagnostics: - Network: the network adapters are configured properly and connections to the Internet are working (tested with "ip addr" and "apt-get update"). - Firewall: the firewall is at the OpenVZ default configuration which means it is fully open and blocks no connection. - SSH: the OpenSSH server was not running and couldn't be started due to errors. Unfortunately the journalctl entries were not really helpful for debugging. I performed a update of the OS and packages and was instantly greeted with a error message about packages being hold back. I ran the command in the error message and it performed 99% of all hold back updates. Only the OpenSSH server failed once again to update. Code: root@server:~# apt-get upgrade -y I tried reinstalling the package but that resulted in the same issue. I checked syslog to find these errors: Code: Missing privilege separation directory: /var/run/sshd A bit of research revealed a bug in Ubuntu 16.04. An important folder where the SSH server will store its PID file is not being created during the upgrade. The solution is quite simple! Code: apt-get --purge remove openssh-server -y && apt-get --purge autoremove -y After that the SSH service started normally again. Because I fully reinstalled the OpenSSH server it was necessary to edit /etc/ssh/sshd_config and change "PermitRootLogin prohibit-password" to "PermitRootLogin yes". Otherwise you can't login as root via SSH unless start using SSH public key authetication. After changing this simply restart the SSH server process and you're done. As far as I could see your other services (whatever all they may be) seemed to be running. Apache was running for example. To be honest the way the VPS looks like it's just a totally fresh Ubuntu 16.04 installation that was about to be updated and failed because of that bug with the openssh-server package. Server is up to date now and running. RE: Connection refused - Khadeer143 - 09-11-2019 i really thank you brother it really working fine now all your works thanks a lot i really love it @Hidden RE: Connection refused - deanhills - 09-11-2019 (09-11-2019, 06:59 PM)Hidden Refuge Wrote: A bit of research revealed a bug in Ubuntu 16.04. An important folder where the SSH server will store its PID file is not being created during the upgrade. The solution is quite simple!Great support, many thanks @"Hidden Refuge" and much appreciated. As per usual all of us are learning at the same time as well. I have a question. Is this the same bug that Rehan came across at VPS 9 in this support thread? https://post4vps.com/Thread-Connection-Refused Will your solution work with VPS 9 update of Ubuntu as well? RE: Connection refused - Mashiro - 09-12-2019 @Khadeer143 If you really want to thank me without the thanks post that is basically against the rules (low quality and that stuff) you can either simply thank me in the private message or use the reputation feature . @deanhills It is possible that @Rehan faced the same issue. The only way to verify would be to install Ubuntu 16.04 on a spare VPS 9 and perform an update to see what happens. If the error messages and etc. are the same --> it is exactly the same bug. I used this piece of information to fix the issue: https://askubuntu.com/questions/1110828/ssh-failed-to-start-missing-privilege-separation-directory-var-run-sshd However I believe my solution is not permanent and the SSH might again stop working on the next reboot. To make the solution permanent there is a need to modify the rc.local file in /etc. This way the OS will apply the fix at every reboot. Like in this bug report: https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/45234/comments/7 Basically one needs to open /etc/rc.local with a text editor (nano, vi or whatever) and add the following code before the "exit 0" line. Code: if [ ! -d /var/run/sshd ]; then This simple if instruction checks if the folder exists. If the folder exists everything is fine. If it does not the content of the if will create it and apply the right permission. RE: Connection refused - humanpuff69 - 09-13-2019 Connection refused mostly mean 2 thing . The servee isnt turned on or the port is blocked Make sure that the vps is turned on , have ssh instaled and allow the 22 port fro ufw/iptables Or maybe you didnt install sshd . But most vps come with it so it is very unlikely RE: Connection refused - deanhills - 09-13-2019 OK probably time to close this thread. If you have further issues @Khadeer143, please feel free to open a new support thread. |