From faccbdc2eb346ee495d4bedb103e3645352c78df Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Wed, 21 Dec 2022 23:03:05 +0100 Subject: [PATCH] qemu: ssh hostfwd on 127.0.0.1 instead of 0.0.0.0 Make it accessible over localhost only. The idea is that users can login into the VM on their own PC while developing, not that it's exposed over the network. If somebody needs to have hostfwd on another IP, send a patch to make this configurable via argparse. Reviewed-by: Luca Weiss Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20221221220305.1809-1-ollieparanoid@postmarketos.org%3E --- pmb/qemu/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmb/qemu/run.py b/pmb/qemu/run.py index e9a6d00d..8d17b9aa 100644 --- a/pmb/qemu/run.py +++ b/pmb/qemu/run.py @@ -184,7 +184,7 @@ def command_qemu(args, arch, img_path, img_path_2nd=None): else: command += ["-device", "virtio-mouse-pci"] command += ["-device", "virtio-keyboard-pci"] - command += ["-netdev", "user,id=net,hostfwd=tcp::" + port_ssh + "-:22"] + command += ["-netdev", f"user,id=net,hostfwd=tcp:127.0.0.1:{port_ssh}-:22"] command += ["-device", "virtio-net-pci,netdev=net"] if arch == "x86_64":