LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   CentOS 7 Connection Refused for SSH (https://www.linuxquestions.org/questions/linux-newbie-8/centos-7-connection-refused-for-ssh-4175604096/)

antriksh 04-18-2017 01:43 PM

CentOS 7 Connection Refused for SSH
 
I've installed centos 7 on virtual box and assigned "Host only adapter" to the VM so that i can access the VM from the host.

After fresh installation when i am trying to ssh to the centos VM from host i am getting connection refused error. I've switched off the firewall but still getting the connection refused error. Can anyone suggest what is wrong? Why i am getting connection refused error?

Please note i am able to ping the VM from host so there is no connectivity issue.

sundialsvcs 04-18-2017 03:03 PM

Do this:
  1. From the host, use the route command to be sure that there is a route leading to the virtual machine's adapter. (You will see it being handled by a virtual-device that is obviously associated with VirtualBox.)
  2. Make sure that the sshd daemon is, in fact, running on the VM.
  3. Check the configuration file for sshd to be sure that it is listening to that adapter. (Sometimes, it's only listening to itself, e.g. 127.0.0.1.)

"Connection Refused" occurs when the port is not open: when there's no one on the other side listening to it, therefore "nothing to connect to."

antriksh 04-19-2017 02:27 PM

It seems somehow virtualbox host only adapter was messed up. I reinstalled virtual box and reconfigured host only adapter and now i am able to connect to VM from host.


All times are GMT -5. The time now is 09:37 AM.