Score:0

Cannot SSH from Windows 10 to Ubuntu 20.04 server guest in VirtualBox

ug flag

Trying to set up a Ubuntu 20.04 server guest in Windows 10 VirtualBox (sorry, don't know if it's a Ubuntu question or a VB question) which I can SSH into from Windows. I've done it with CentOS multiple times but can't do it with Ubuntu out-of-the-box (Guest Additions installed) and I'm stumped:

C:\Users\Mark>ssh [email protected]
ssh: connect to host 192.168.1.108 port 22: Connection refused

Internet setup looks OK:

Internet setup looks OK

SSH running and listening on all adapters on port 22:

SSH running and listening on all adapters on port 22

Firewall turned off:

Firewall turned off

In sshd I have:

AllowUsers mark

(I don't have a root user as I installed Ubuntu with the default setting)

Also:

PermitRootLogin yes
PubkeyAuthentication yes
PasswordAuthentication yes
ChallengeResponseAuthentication no
UsePAM yes

I think everything else of relevance is on the default setting, the above settings might be a bit mixed up but I've pretty much tried every combo up till now! I just want to log in with a simple password, it's just a machine for dev stuff.

I also tried

PubkeyAuthentication no
PreferredAuthentications password

to no avail...

My auth.log is on verbose, but it doesn't seem very helpful:

auth.log

Only not sure why it says USER=root if I am trying to log in as mark. Is that right?

I'm surprised this isn't more straightforward out of the box.

in flag
Silly question, but have you confirmed the network settings in VirtualBox to allow for traffic? The network adapter should have its “promiscuous mode” set to “allow all” for greatest accessibility.
hr flag
Your systemctl status output doesn't necessarily show "firewall turned off", it just shows that the ufw.service is currently disabled - ufw is a oneshot service that loads rules then exits, and afaik disabling it doesn't flush the rules. Something like `sudo ufw status verbose` would be more helpful.
Bodd avatar
ug flag
@matigo Not a silly question, but yes, it's set to Allow All, tried that...
Bodd avatar
ug flag
@steeldriver Thought you might be onto something there but I get `Status: inactive` so I guess it really is inactive?
hr flag
@Bodd yes that should be definitive, thanks. BTW do you really need both the bridged (192.168.x.x) and NAT (10.x.x.x) interfaces enabled? At least for troubleshooting purposes, you might try disabling the latter. As well, you should be able to get more detailed debug info by running the ssh client with additional verbosity (`ssh -v ...` or `ssh -vv ...`).
Bodd avatar
ug flag
@steeldriver I am probably missing a simpler way of doing it but it was the only way I could get Internet access for the guest machine. When I disable the NAT adapter I get a Temporary failure in name resolution, maybe I need to simplify my Internet settings, I mean it should be listening on all adapters but maybe that's what's throwing it off...
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.