Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
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
ops
jumpserver
Commits
d3e9c8c9
Commit
d3e9c8c9
authored
Sep 24, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace ssh server dir
parent
cfef3744
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
32 deletions
+14
-32
.gitignore
.gitignore
+1
-0
hands.py
apps/terminal/hands.py
+0
-1
README.md
apps/terminal/keys/README.md
+0
-0
host_rsa_key
apps/terminal/keys/host_rsa_key
+0
-27
__init__.py
ssh_server/__init__.py
+7
-0
server.py
ssh_server/server.py
+6
-4
No files found.
.gitignore
View file @
d3e9c8c9
...
...
@@ -16,3 +16,4 @@ db.sqlite3
config.py
migrations/
*.log
host_rsa_key
apps/terminal/hands.py
View file @
d3e9c8c9
...
...
@@ -2,5 +2,4 @@
# -*- coding: utf-8 -*-
#
from
users.utils
import
ssh_key_gen
,
check_user_is_valid
apps/terminal/keys/README.md
deleted
100644 → 0
View file @
cfef3744
apps/terminal/keys/host_rsa_key
deleted
100644 → 0
View file @
cfef3744
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAxreMFq9tp1hb2NOIkV7PqeyfS0GTJSfW2WcXuqkGPSVtPdYw
cJRY/s5eBn0KbO6JVj9yfwXNTKdnq1ODuuJDMnhTWXq1x7VICcou/69kFdSGiAzl
wfYP6LATEMCmpFRVi5UZip7SWopLE1JEw79nYWrbhUpDOpGTRKoIxoz+Uvg0h15G
pec3faL7PXj/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a388VC29JHYukBjj5rs2GXm
ji6TWuxV/J2e7QxlZ9yALRntPJu0g+I8j//PQTnr5jM6ckfSDbLAOjZ1DnpqZpEX
zV+CzafKDVgCVxi2K3Np9qnC3C1+i3KEpCOBvEbHfK1Sdo6AazSZCpG0tV5GRipd
F4RhAoGAUJBoemipDjFoLSD3cpKpUXHIc6eieAI1GwYiL4CVugrvj5gO2B5c5yYb
3E8VWfuEHbBg0rmZIQ0sQf2ospZha7WBNhg9WB016aHyeZTIuHchfU4y3l2Jl8Re
enz4SSi6ZR6hgbJ9XzeiI+UTcDEuUzDUy9YktREuIBmMPXm7u5s=
-----END RSA PRIVATE KEY-----
ssh_server/__init__.py
0 → 100644
View file @
d3e9c8c9
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
if
__name__
==
'__main__'
:
pass
apps/terminal
/server.py
→
ssh_server
/server.py
View file @
d3e9c8c9
...
...
@@ -21,7 +21,7 @@ import django
from
paramiko.py3compat
import
b
,
u
,
decodebytes
BASE_DIR
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
APP_DIR
=
os
.
path
.
dirname
(
BASE_DIR
)
APP_DIR
=
os
.
path
.
join
(
os
.
path
.
dirname
(
BASE_DIR
),
'apps'
)
sys
.
path
.
append
(
APP_DIR
)
os
.
environ
[
'DJANGO_SETTINGS_MODULE'
]
=
'jumpserver.settings'
...
...
@@ -32,7 +32,7 @@ except IndexError:
from
django.conf
import
settings
from
common.utils
import
get_logger
from
hand
s
import
ssh_key_gen
,
check_user_is_valid
from
users.util
s
import
ssh_key_gen
,
check_user_is_valid
logger
=
get_logger
(
__name__
)
...
...
@@ -45,7 +45,7 @@ class SSHService(paramiko.ServerInterface):
# good_pub_key = paramiko.RSAKey(data=decodebytes(data))
# host_key = paramiko.RSAKey(filename='test_rsa.key')
host_key_path
=
os
.
path
.
join
(
BASE_DIR
,
'
keys'
,
'
host_rsa_key'
)
host_key_path
=
os
.
path
.
join
(
BASE_DIR
,
'host_rsa_key'
)
def
__init__
(
self
):
self
.
event
=
threading
.
Event
()
...
...
@@ -211,7 +211,9 @@ class SSHServer:
try
:
client
,
addr
=
self
.
sock
.
accept
()
print
(
'Listening for connection ...'
)
threading
.
Thread
(
target
=
self
.
handle_ssh_request
,
args
=
(
client
,
addr
))
.
start
()
t
=
threading
.
Thread
(
target
=
self
.
handle_ssh_request
,
args
=
(
client
,
addr
))
t
.
daemon
=
True
t
.
start
()
except
Exception
as
e
:
print
(
'*** Bind failed: '
+
str
(
e
))
traceback
.
print_exc
()
...
...
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