1

I am having difficulty connecting remotely to the ubuntu server from the mac terminal.

So far I have run:

sudo apt-get install openssh-server

when I try to connect via the ip address I get an error:

$ ssh root@*ip address*
ssh: connect to host *ip address* port 22: Connection refused. 

How do I go about resolving this? Thanks in advance for your help

Note: I am not actually typing ip address. I'm just using this in place of my actual server ip address

muru
  • 207,228

1 Answers1

0

First try to ssh into the server with another user besides "root". Root remote connection is disabled by default. Or you can allow remote access with root. You will need to edit /etc/ssh/sshd_config, and comment out the following line:

PermitRootLogin without-password 

Just below it, add the following line:

PermitRootLogin yes

Then restart SSH:

service ssh restart

Another suggestion would be to ensure that the firewall was turned off on the VM before proceeding with the network adapter changes. Some O/S versions default with the firewall turned on which may block incoming SSH connection attempts. After turning off iptables or ufw depending on your O/S version or whichever service you are using. IF this doesn't resolve the issue, then try each network adapter setting within VirtualBox.

sudo ufw disable

or

sudo service iptables stop
muru
  • 207,228
ddlingo
  • 130