Cannot enable SSH on Google Cloud downloaded centos vmdk on VirtualBox
Hi,
I am facing an strange issue. Recently, I have downloaded a Google Cloud based CentOS vmdk from my G-Cloud and tried using it on VirtualBox. The plan is, I want to shift that VM to another cloud, Oracle Cloud. The instance has an application running, based on NGINX, MySQL and CodeIgniter v2, as well as postfix is in use. All is good on the Google Cloud, but when the same instance is running in VirtualBox, the application is working fine, but I cannot enable SSH at all. Service is enabled, but SSH cannot start. I tried running "sshd -t" but no error returned. I am attaching some required screenshot, from the grub parameter of the boot kernel to sshd config file, netstat and ssh service status. uploaded on my organization OneDrive folder, link given below. Please help how I can enable the SSH on the downloaded VM, if I can enable the SSH on downloaded VM, then I can shift the VM to another cloud. I tried uploading the VM to Oracle Cloud, and SSH does not work, but no issue with SSH on original Google Cloud instance. https://rapplesentertainment-my.shar...cK2WQ?e=E2sYw0 |
What happens if you use other options, including illegal options?
What is the output of Code:
ls -l /usr/sbin/sshd Have you tried reinstalling sshd and the openssh libraries? By the way, you can use a serial console with Virtualbox, which would allow you to copy and paste to/from your VM's command line. |
Quote:
Yes I have tried completely uninstalling the openssh server using yum uninstall and yum remove command, also tried "ssh-keygen -A" by regenerating all keys. For all the output, allow me some moment, I will get back with the required output. I think as you mentioned, some library or architecture problem, since the VM is based on Google Cloud, but need to fix it. |
4 Attachment(s)
Quote:
Yes I have tried completely uninstalling the openssh server using yum uninstall and yum remove command, also tried "ssh-keygen -A" by regenerating all keys. For the required output, please check the screenshots here attached as well as the complete output of strace. Help me enabling the sshd please. Strange issue, when I uninstall postfix, I was able to turn on sshd once, but cannot do that anymore now. I need the postfix for my application deployed on the VM. |
Any help here please?
|
Sorry for not reacting earlier.
Good news: My suspicion that sshd couldnkt run because of an incompatible architecture in the binary itself or a library it's using seems to be unfounded. The system call trace shows that sshd works. Bad news: I can't see anything else, since the system call trace does not include the child process launched by sshd. To see those traces, use strace -f. My bad for not thinking of this. Another thing I would try is running sshd with a very verbose option (sshd -vvv). Perhaps the debug messages thus printed will reveal the problem. |
3 Attachment(s)
Quote:
Also for output - I have provided the output for "sshd -ddd" and "strace -f". running "/usr/sbin/sshd -ddd" enable a listening to sshd, but status shows sshd is inactive/dead. Also netstat -tupln shows sshd is listening, but netstat -tpln does NOT show port 22 is listening. And I can ssh to the VM from my mac/local machine, even checking the sshd status from the mac also shows sshd is dead. |
When you run sshd from the command line, you just launch a process, not the sshd service. Therefore systemctl status reports that the service is dead. However, sshd is running, and you can log in.
Your netstat output is rather unexpected. Unfortunately you don't share it. Why the regular start of sshd doesn't work, I will try to find by looking at the trace files you attached. That will take some time. |
Quote:
|
Quote:
Anyway, I also checked the strace -f output, and I see some DenyWrite and files not found issue. Can you please check and let me know how to solve this? My curious question is why and how this sshd is working on Google Cloud, but not on local VMware/Virtualbox or even in other cloud. |
Quote:
|
Quote:
Code:
sudo /usr/sbin/sshd -T | sort Code:
sudo /usr/sbin/sshd -d -E /tmp/one-off-sshd.log |
Quote:
here are the outputs: Code:
sudo /usr/sbin/sshd -T | sort Code:
[test@pulsuat-2c689991 ~]$ sudo /usr/sbin/sshd -T | sort Code:
sudo /usr/sbin/sshd -d -E /tmp/one-off-sshd.log Code:
debug1: sshd version OpenSSH_7.4, OpenSSL 1.0.2k-fips 26 Jan 2017 |
The configuration looks normal. Have you changed 'usedns' though?
The log output shows that sshd runs and appears to be listening on all interfaces. Two more questions while waiting for the strace: Can you SSH to it from the same machine which it is on using the local host address? Can you SSH to it from the same machine which it is on using an external address? |
Quote:
about usedns - can you elaborate please? no change in resolv.conf file actually. everything is default as per the centos OS. |
All times are GMT -5. The time now is 08:47 PM. |