2

I've been playing around with a Centos 7 server in VirtualBox, and I have a problem. For whatever reason I can't connect to the server on my Windows using Putty or cmder or whatever else.

I can ping to the server, and from the server, but every time I try to connect I get the following response:

ssh: connect to host 192.168.0.185 port 22: Connection refused

I've installed openssh on the server, I've checked the service and it's running, I've disabled the firewalld service on my Centos, I've rebooted just to make sure that everything is like it should be, and yet I just can't seem to connect to it.

Does anyone have any experience with this kind of problem?

Thanks in advance for your help.

EDIT

I've thought that maybe I used wrong settings for my configuration. I've used the IP, gateway, netmask and DNS' from my Ethernet adapter Ethernet settings. I think that these might be the settings for my Windows host machine. I've looked in ipconfig /all again and saw 2 VirtualBox Host-Only adapters, but these aren't network bridged, and have only an IP and subnet mask, no DNS or gateway, so I've no idea which settings to use.

1
  • Thanks for closing the loop on your question. I deleted the "Solved" from the title as this site doesn't follow that convention. Instead, you will be able to accept your own answer by clicking the checkmark next to it (in 2 days).
    – fixer1234
    Oct 14, 2016 at 17:18

3 Answers 3

1

Use VirtualBox UI to login into your VM. Then, open a terminal and

sudo yum -y install openssh-server

See if that works for you.

2
  • CentOS doesn't have "apt-get", the package manager is "yum"
    – xgMz
    Jun 20, 2017 at 16:06
  • You are quite right. Corrected. Was my mistake.
    – wilco
    Jul 12, 2017 at 15:38
-1

The only thing I had to do was increase the IP by 1 and it all worked like a charm.

1
  • Your solution would be more helpful to others with a similar problem if you could add a sentence or two explaining why this works. Thanks.
    – fixer1234
    Oct 14, 2016 at 17:22
-1

I had the same thing occur and here's what I think was your problem. You were using a VM on the same subnet (bridged) with other VMs and one of them already had that ip address. I forgot I had my SSHD VM bridged on the same 192.168.x.x subnet that my family uses so even though I knew I hadn't created any other VMs with that IP address it was already in use by one of my families device - and there is no error message that tells you about the duplicate IP address. By increasing the IP address by 1 you replaced a duplicate IP with a fresh one. :-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .