arrow_upward

Pages (2):
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connection refused
#11
@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.
Terminal
Thank you to Post4VPS and VirMach for my awesome VPS 9!  
#12
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.
root@server:~# apt-get upgrade -y
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
[...]
Processing triggers for initramfs-tools (0.122ubuntu8.14) ...
Errors were encountered while processing:
openssh-server

I tried reinstalling the package but that resulted in the same issue. I checked syslog to find these errors:
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!

apt-get --purge remove openssh-server -y && apt-get --purge autoremove -y
apt-get install openssh-server -y
mkdir /var/run/sshd
chmod 755 /var/run/sshd

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.
[Image: zHHqO5Q.png]
#13
i really thank you brother it really working fine now all your works thanks a lot i really love it @Hidden
thank you post4vps and  racknerd for wonderful vps3  Heart
 
#14
(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!

apt-get --purge remove openssh-server -y && apt-get --purge autoremove -y
apt-get install openssh-server -y
mkdir /var/run/sshd
chmod 755 /var/run/sshd

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.
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?
Terminal
Thank you to Post4VPS and VirMach for my awesome VPS 9!  
#15
@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 Smile .


@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/...r-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/+sourc...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.
if [ ! -d /var/run/sshd ]; then
   mkdir /var/run/sshd
   chmod 0755 /var/run/sshd
fi

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.
[Image: zHHqO5Q.png]
#16
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
Terminal
humanpuff69@FPAX:~$ Thanks To Shadow Hosting And Post4VPS for VPS 5
#17
OK probably time to close this thread. If you have further issues @Khadeer143, please feel free to open a new support thread.
Terminal
Thank you to Post4VPS and VirMach for my awesome VPS 9!  
Pages (2):
lockThread Closed 


Possibly Related Threads…
Thread
Author
Replies
Views
Last Post
4,163
01-25-2019, 06:05 AM
Last Post: deanhills

person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting