SSH FAILS: PRotocol Not Available Virtualbox Host-only adapter

Issues related to configuring your network
Post Reply
cjsdfw
Posts: 2
Joined: 2019/09/22 19:57:17

SSH FAILS: PRotocol Not Available Virtualbox Host-only adapter

Post by cjsdfw » 2019/09/22 20:35:11

Hi,
I have not been able to resolve the SSH connection issue I am experimenting, hopefully someone can shed some light:

I setup Centos release 7.7.1908 as Guest in Virtualbox 6.0 under Windows 10 host and defined two network adapters:
1st Adapter: NAT/DHCP (10.0.2.15 default)
2nd Adapter: Host-only, STATIC 192.168.56.100 (Windows Host Only Adapter: 192.168.56.1)
No firewall is enabled
Network Addresses verified OK through IFCONFIG
netstat -tlnp shows machine listening on 0.0.0.0:22

If I try to ssh into Centos from Windows:

Code: Select all

cjsdf@CJS-ALIENWARE MINGW64 ~
$ ssh -vvv root@192.168.56.100
OpenSSH_7.9p1, OpenSSL 1.1.1a  20 Nov 2018
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolve_canonicalize: hostname 192.168.56.100 is address
debug2: ssh_connect_direct
debug1: Connecting to 192.168.56.100 [192.168.56.100] port 22.
debug1: connect to address 192.168.56.100 port 22: Connection timed out
ssh: connect to host 192.168.56.100 port 22: Connection timed out

$ ping 192.168.56.100

Pinging 192.168.56.100 with 32 bytes of data:
Reply from 192.168.56.100: bytes=32 time<1ms TTL=255
Reply from 192.168.56.100: bytes=32 time<1ms TTL=255
Reply from 192.168.56.100: bytes=32 time<1ms TTL=255
Reply from 192.168.56.100: bytes=32 time<1ms TTL=255

Ping statistics for 192.168.56.100:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

cjsdf@CJS-ALIENWARE MINGW64 ~
If I try to ssh from an Ubuntu Guest setup same as Centos Guest:

Code: Select all

csanchez@ububtu-lamp:~$ ssh -vvv root@192.168.56.100
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "192.168.56.100" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 192.168.56.100 [192.168.56.100] port 22.
debug1: connect to address 192.168.56.100 port 22: Protocol not available
ssh: connect to host 192.168.56.100 port 22: Protocol not available
csanchez@ububtu-lamp:~$

csanchez@ububtu-lamp:~$ ping 192.168.56.100
PING 192.168.56.100 (192.168.56.100) 56(84) bytes of data.
64 bytes from 192.168.56.100: icmp_seq=1 ttl=255 time=0.145 ms
64 bytes from 192.168.56.100: icmp_seq=2 ttl=255 time=0.254 ms
64 bytes from 192.168.56.100: icmp_seq=3 ttl=255 time=0.231 ms
64 bytes from 192.168.56.100: icmp_seq=4 ttl=255 time=0.137 ms
64 bytes from 192.168.56.100: icmp_seq=5 ttl=255 time=0.528 ms
64 bytes from 192.168.56.100: icmp_seq=6 ttl=255 time=0.243 ms
^C
--- 192.168.56.100 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5071ms
rtt min/avg/max/mdev = 0.137/0.256/0.528/0.130 ms
csanchez@ububtu-lamp:~$
I can enable Port Forwarding on Adapter 1 and SSH into Centos Guest but that is not what I want. I need to setup several machines and allow communication between them hence the use of the Host-only adapter.

Any help will be greatly appreciated.

cjsdfw
Posts: 2
Joined: 2019/09/22 19:57:17

Re: SSH FAILS: PRotocol Not Available Virtualbox Host-only adapter

Post by cjsdfw » 2019/09/25 19:09:51

SOLVED

It turns out even though I had made apparently correct changes to the nic configuration file (/etc/sysconfig/network-scripts/ifcfg-enp0s8) the system was still assigning a DHCP ip address. Strange since IFCONFIG was reflecting the IP ADDRESS I specified in the configuration file.

I changed the configuration file to specify the bare minimum and that solved the problem.

I am including the configuration file that did not worked and the one that worked in case someone else experiences the same issue.

/etc/sysconfig/network-scripts/ifcfg-enp0s8 (that did not work):

Code: Select all

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s8
UUID=7f1dca9e-962f-43be-93e3-309706c7577e
DEVICE=enp0s8
ONBOOT=no
[\code]
/etc/sysconfig/network-scripts/ifcfg-enp0s8 (that worked fine):
[code]
DEVICE=enp0s8
BOOTPROTO=none
ONBOOT=yes
PREFIX=24
IPADDR=192.168.56.100
[\code]

Please marked as resolved! Thanks

Post Reply