From 8771dabfdc2a25d16c4f214befb39696ab05923a Mon Sep 17 00:00:00 2001 From: Russell Joyce Date: Fri, 24 Apr 2020 13:27:35 +0100 Subject: [PATCH] Force SSH command in client script to fail if requested port is in use This stops a user from accidentally opening a connection without actually creating a tunnel, but no error handling is done at the moment. First step towards fixing #29. --- vlab.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlab.py b/vlab.py index f099491..c9c19b4 100755 --- a/vlab.py +++ b/vlab.py @@ -173,7 +173,8 @@ def err(s): else: relay_command = "{}:{}".format(parsed.board[0], ephemeral_port) -ssh_cmd = "ssh -L {}:localhost:9001 -L {}:localhost:{} -o PasswordAuthentication=no -e none -i {} {} -p {} -tt {} {}"\ +ssh_cmd = "ssh -L {}:localhost:9001 -L {}:localhost:{} -o PasswordAuthentication=no -o ExitOnForwardFailure=yes " \ + "-e none -i {} {} -p {} -tt {} {}"\ .format( parsed.webport[0], parsed.localport[0],