Score:0

SSH to a VM with local IP using port forwarding on kvm/qemu server

by flag

I am struggling to find how I can ssh to a vm from outside just by port forwarding on a kvm server host. And is this possible at all?

VM IP - 192.168.122.10
Server public IP - 110.110.110.110 (for an example)

I'll open port 45 on both and if I try

ssh user@110.110.110.110 -p 45

it should ssh to the vm. Not sure if this is possible, maybe I just don't understand the idea correctly of port the port forwarding.

Christian Ehrhardt avatar
sl flag
You can establish something permanent, but if all you need is login you might as well use ssh port forwarding itself. To do so you'd log into the host and as long as that connection is active create a port on your workstation that will reach through that tunnel to a port on the VM. The benefit of that is that no one but you can even try to connect to the VM - but OTOH you might not want logins to you host in the first place. In the latter case you need to do something like https://www.debuntu.org/how-to-redirecting-network-traffic-to-a-new-ip-using-iptables/
Baequiraheal avatar
by flag
@ChristianEhrhardt will give it a try. Thanks!
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.