mirror of
https://github.com/sshuttle/sshuttle.git
synced 2024-11-22 07:53:43 +01:00
Allow remote hosts with colons in the username
This commit is contained in:
parent
5e90491344
commit
abce18cfc2
@ -63,7 +63,7 @@ def empackage(z, name, data=None):
|
||||
def connect(ssh_cmd, rhostport, python, stderr, options):
|
||||
portl = []
|
||||
|
||||
if (rhostport or '').count(':') > 1:
|
||||
if re.sub(r'.*@', '', rhostport or '').count(':') > 1:
|
||||
if rhostport.count(']') or rhostport.count('['):
|
||||
result = rhostport.split(']')
|
||||
rhost = result[0].strip('[')
|
||||
@ -76,7 +76,7 @@ def connect(ssh_cmd, rhostport, python, stderr, options):
|
||||
else:
|
||||
rhost = rhostport
|
||||
else: # IPv4
|
||||
l = (rhostport or '').split(':', 1)
|
||||
l = (rhostport or '').rsplit(':', 1)
|
||||
rhost = l[0]
|
||||
if len(l) > 1:
|
||||
portl = ['-p', str(int(l[1]))]
|
||||
|
Loading…
Reference in New Issue
Block a user