Skip to content

Commit

Permalink
Force SSH command in client script to fail if requested port is in use
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
RussellJoyce committed Apr 24, 2020
1 parent b2e1f76 commit 8771dab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 8771dab

Please sign in to comment.