BubbleMonster
BubbleMonster

Reputation: 1416

cannot connect to host 127.0.0.1 Virtualbox

So I'm using a Macbook Pro with virtualbox and trying to SSH to CentOS virtual machine.

I've started the SSH service on centOS and I've gone into the network settings of virtualbox and made sure that the adaptor was set to NAT and that port forwarding was set to port 22 for the guest and host.

When I run the following on my mac: ssh 127.0.0.1

It says: ssh: connect to host 127.0.0.1 port 22: Connection refused

Any ideas why?

Upvotes: 1

Views: 2940

Answers (1)

BubbleMonster
BubbleMonster

Reputation: 1416

Fixed the issue by enabling ssh on mac. I didn't realize it was off as default! If you go into the sharing options in system preferences you can tick a box which enables ssh. To connect you must use: $ ssh username@192.168.1.111 (or whatever the ip is of the machine).

Upvotes: 1

Related Questions