LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-18-2017, 01:43 PM   #1
antriksh
Member
 
Registered: Aug 2010
Location: In my world
Distribution: Oracle Linux 6
Posts: 83

Rep: Reputation: 0
Question 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.
 
Old 04-18-2017, 03:03 PM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177Reputation: 3177
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."

Last edited by sundialsvcs; 04-18-2017 at 03:05 PM.
 
Old 04-19-2017, 02:27 PM   #3
antriksh
Member
 
Registered: Aug 2010
Location: In my world
Distribution: Oracle Linux 6
Posts: 83

Original Poster
Rep: Reputation: 0
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.
 
  


Reply

Tags
ssh, ssh sshd root


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH Connection Refused jdwpv4 Linux - Networking 1 05-12-2015 11:43 AM
SSH Connection Refused noelllll Linux - Software 7 02-26-2015 03:42 PM
ssh connection refused - trying to set up ssh server at home openSauce Linux - Server 10 10-18-2007 04:38 PM
SSH connection refused bmccorm2 Linux - Networking 4 05-15-2007 02:59 PM
ssh - connection refused Murdock1979 Linux - Networking 1 11-22-2006 11:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration