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 <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20221221220305.1809-1-ollieparanoid@postmarketos.org%3E
This commit is contained in:
Oliver Smith 2022-12-21 23:03:05 +01:00
parent 917ff92f63
commit faccbdc2eb
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 1 additions and 1 deletions

View File

@ -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":