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
ee74110c
Commit
ee74110c
authored
Sep 03, 2010
by
chocolateboy
Committed by
Avery Pennarun
Sep 04, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add option to allow the remote python binary's name/path to be specified
parent
5bf8687c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
client.py
client.py
+4
-4
main.py
main.py
+2
-0
ssh.py
ssh.py
+3
-3
No files found.
client.py
View file @
ee74110c
...
...
@@ -92,7 +92,7 @@ class FirewallClient:
raise
Fatal
(
'cleanup:
%
r returned
%
d'
%
(
self
.
argv
,
rv
))
def
_main
(
listener
,
fw
,
use_server
,
remotename
,
seed_hosts
,
auto_nets
):
def
_main
(
listener
,
fw
,
use_server
,
remotename
,
python
,
seed_hosts
,
auto_nets
):
handlers
=
[]
if
use_server
:
if
helpers
.
verbose
>=
1
:
...
...
@@ -100,7 +100,7 @@ def _main(listener, fw, use_server, remotename, seed_hosts, auto_nets):
else
:
helpers
.
logprefix
=
'client: '
debug1
(
'connecting to server...
\n
'
)
(
serverproc
,
serversock
)
=
ssh
.
connect
(
remotename
)
(
serverproc
,
serversock
)
=
ssh
.
connect
(
remotename
,
python
)
mux
=
Mux
(
serversock
,
serversock
)
handlers
.
append
(
mux
)
...
...
@@ -188,7 +188,7 @@ def _main(listener, fw, use_server, remotename, seed_hosts, auto_nets):
mux
.
check_fullness
()
def
main
(
listenip
,
use_server
,
remotename
,
seed_hosts
,
auto_nets
,
def
main
(
listenip
,
use_server
,
remotename
,
python
,
seed_hosts
,
auto_nets
,
subnets_include
,
subnets_exclude
):
debug1
(
'Starting sshuttle proxy.
\n
'
)
listener
=
socket
.
socket
()
...
...
@@ -220,6 +220,6 @@ def main(listenip, use_server, remotename, seed_hosts, auto_nets,
try
:
return
_main
(
listener
,
fw
,
use_server
,
remotename
,
seed_hosts
,
auto_nets
)
python
,
seed_hosts
,
auto_nets
)
finally
:
fw
.
done
()
main.py
View file @
ee74110c
...
...
@@ -52,6 +52,7 @@ sshuttle --server
l,listen= transproxy to this ip address and port number [0.0.0.0:0]
H,auto-hosts scan for remote hostnames and update local /etc/hosts
N,auto-nets automatically determine subnets to route
python= specify the name/path of the python interpreter on the remote server [python]
r,remote= ssh hostname (and optional username) of remote sshuttle server
x,exclude= exclude this subnet (can be used more than once)
v,verbose increase debug message verbosity
...
...
@@ -99,6 +100,7 @@ try:
sys
.
exit
(
client
.
main
(
parse_ipport
(
opt
.
listen
or
'0.0.0.0:0'
),
not
opt
.
noserver
,
remotename
,
(
opt
.
python
or
"python"
),
sh
,
opt
.
auto_nets
,
parse_subnets
(
includes
),
...
...
ssh.py
View file @
ee74110c
...
...
@@ -19,7 +19,7 @@ def empackage(z, filename):
return
'
%
s
\n
%
d
\n
%
s'
%
(
filename
,
len
(
content
),
content
)
def
connect
(
rhostport
):
def
connect
(
rhostport
,
python
):
main_exe
=
sys
.
argv
[
0
]
l
=
(
rhostport
or
''
)
.
split
(
':'
,
1
)
rhost
=
l
[
0
]
...
...
@@ -48,9 +48,9 @@ def connect(rhostport):
if
not
rhost
:
argv
=
[
'python'
,
'-c'
,
pyscript
]
argv
=
[
python
,
'-c'
,
pyscript
]
else
:
argv
=
[
'ssh'
]
+
portl
+
[
rhost
,
'--'
,
"
python -c '
%
s'"
%
pyscript
]
argv
=
[
'ssh'
]
+
portl
+
[
rhost
,
'--'
,
"
'
%
s' -c '
%
s'"
%
(
python
,
pyscript
)
]
(
s1
,
s2
)
=
socket
.
socketpair
()
def
setup
():
# runs in the child process
...
...
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