Score:0

Why can't I SSH into virtual machine?

in flag

I am using Ubuntu 22.04 as host. Virtual machine is Ubuntu 20.04 with a bridged adapter.

When I SSH into host machine from VM, everything goes right. But when I try SSH in reverse(from host into VM) it gives an error saying Connection refused.

I have tried opening the ports, but nothing has worked. I am suspecting it is an issue or restriction with the VM.

user535733 avatar
cn flag
"*connection refused*" suggests that the ssh server in your VM Guest is not running.
in flag
Generally this happens if: (1) there is no SSH Server listening for connections (2) `ufw` is not permitting the connection through (3) the IP has been recycled and your host sees a different SSH fingerprint, warns you that something has changed, and refuses to let you connect. Could you [edit] your question to include the complete error message?
guiverc avatar
cn flag
You weren't specific as to what Ubuntu 20.04 LTS product you're talking about, desktop installs for example include only the SSH client (not server), as most desktop users only `ssh` to other machines
jtessier72 avatar
cn flag
While on the vm try `ssh localhost`. If you can't do that, you likely won't get external connections. This is a good way to test if ssh is working at all.
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.