mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-04-24 19:29:21 +02:00
Allow no remote to work.
Pull request #502 made -r/--remote required. However, the documentation still indicates that using no remote is a valid way to test sshuttle (see Examples section of man page). I think this mode might be useful for testing performance local without ssh, local with ssh, and remote with ssh. This patch adds a warning when -r/--remote is missing but restores the previous behavior.
This commit is contained in:
parent
c1cc3911df
commit
574ed8e564
@ -572,9 +572,9 @@ def main(listenip_v6, listenip_v4,
|
|||||||
user, sudo_pythonpath):
|
user, sudo_pythonpath):
|
||||||
|
|
||||||
if not remotename:
|
if not remotename:
|
||||||
# XXX: We can't make it required at the argparse level,
|
print("WARNING: You must specify -r/--remote to securely route "
|
||||||
# because sshuttle calls out to itself in FirewallClient.
|
"traffic to a remote machine. Running without -r/--remote "
|
||||||
raise Fatal("You must specify -r/--remote.")
|
"is only recommended for testing.")
|
||||||
|
|
||||||
if daemon:
|
if daemon:
|
||||||
try:
|
try:
|
||||||
|
@ -43,6 +43,8 @@ def parse_hostport(rhostport):
|
|||||||
"""
|
"""
|
||||||
# leave use of default port to ssh command to prevent overwriting
|
# leave use of default port to ssh command to prevent overwriting
|
||||||
# ports configured in ~/.ssh/config when no port is given
|
# ports configured in ~/.ssh/config when no port is given
|
||||||
|
if rhostport is None or len(rhostport) == 0:
|
||||||
|
return None, None, None, None
|
||||||
port = None
|
port = None
|
||||||
username = None
|
username = None
|
||||||
password = None
|
password = None
|
||||||
|
Loading…
Reference in New Issue
Block a user