Skip to content

Commit 0d26e0e

Browse files
committed
ssh: only export the port to localhost
It doesn't seem safe to expose the socket to everybody around. Restrict it to localhost only. Please note that it also means other users on the same machine can still connect to it. But they will need credentials / keys. Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
1 parent f564701 commit 0d26e0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

virtme/commands/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ def ssh_server(args, arch, qemuargs, kernelargs):
10021002

10031003
# Setup a port forward network interface for the guest.
10041004
qemuargs.extend(["-device", "%s,netdev=ssh" % (arch.virtio_dev_type("net"))])
1005-
qemuargs.extend(["-netdev", "user,id=ssh,hostfwd=tcp::%d-:22" % args.port])
1005+
qemuargs.extend(["-netdev", "user,id=ssh,hostfwd=tcp:127.0.0.1:%d-:22" % args.port])
10061006

10071007

10081008
# Allowed characters in mount paths. We can extend this over time if needed.

0 commit comments

Comments
 (0)