Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sshuttle
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pub
sshuttle
Commits
8173925b
Commit
8173925b
authored
May 04, 2010
by
Avery Pennarun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ssh.py: allow hostnames of the form hostname:port
Feature requested by Wayne Scott and Ed Maste.
parent
0cdd72c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
main.py
main.py
+1
-1
ssh.py
ssh.py
+7
-2
No files found.
main.py
View file @
8173925b
...
@@ -45,7 +45,7 @@ def parse_ipport(s):
...
@@ -45,7 +45,7 @@ def parse_ipport(s):
optspec
=
"""
optspec
=
"""
sshuttle [-l [ip:]port] [-r [username@]sshserver] <subnets...>
sshuttle [-l [ip:]port] [-r [username@]sshserver
[:port]
] <subnets...>
sshuttle --iptables <port> <subnets...>
sshuttle --iptables <port> <subnets...>
sshuttle --server
sshuttle --server
--
--
...
...
ssh.py
View file @
8173925b
...
@@ -2,8 +2,13 @@ import sys, os, re, subprocess, socket
...
@@ -2,8 +2,13 @@ import sys, os, re, subprocess, socket
import
helpers
import
helpers
from
helpers
import
*
from
helpers
import
*
def
connect
(
rhost
):
def
connect
(
rhost
port
):
main_exe
=
sys
.
argv
[
0
]
main_exe
=
sys
.
argv
[
0
]
l
=
(
rhostport
or
''
)
.
split
(
':'
,
1
)
rhost
=
l
[
0
]
portl
=
[]
if
len
(
l
)
>
1
:
portl
=
[
'-p'
,
str
(
int
(
l
[
1
]))]
nicedir
=
os
.
path
.
split
(
os
.
path
.
abspath
(
main_exe
))[
0
]
nicedir
=
os
.
path
.
split
(
os
.
path
.
abspath
(
main_exe
))[
0
]
nicedir
=
re
.
sub
(
r':'
,
"_"
,
nicedir
)
nicedir
=
re
.
sub
(
r':'
,
"_"
,
nicedir
)
myhome
=
os
.
path
.
expanduser
(
'~'
)
+
'/'
myhome
=
os
.
path
.
expanduser
(
'~'
)
+
'/'
...
@@ -29,7 +34,7 @@ def connect(rhost):
...
@@ -29,7 +34,7 @@ def connect(rhost):
sh -c PATH=
%
s:'$HOME'/
%
s:'$PATH exec sshuttle --server
%
s'
sh -c PATH=
%
s:'$HOME'/
%
s:'$PATH exec sshuttle --server
%
s'
"""
%
(
escapedir
,
escapedir2
,
"""
%
(
escapedir
,
escapedir2
,
' -v'
*
(
helpers
.
verbose
or
0
))
' -v'
*
(
helpers
.
verbose
or
0
))
argv
=
[
'ssh'
,
rhost
,
'--'
,
cmd
.
strip
()]
argv
=
[
'ssh'
]
+
portl
+
[
rhost
,
'--'
,
cmd
.
strip
()]
debug2
(
'executing:
%
r
\n
'
%
argv
)
debug2
(
'executing:
%
r
\n
'
%
argv
)
(
s1
,
s2
)
=
socket
.
socketpair
()
(
s1
,
s2
)
=
socket
.
socketpair
()
def
setup
():
def
setup
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment