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
4eec31e4
Commit
4eec31e4
authored
Dec 25, 2014
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改显示1
parent
8d7ab7b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
connect.py
connect.py
+3
-6
No files found.
connect.py
View file @
4eec31e4
...
...
@@ -15,13 +15,10 @@ import getpass
from
django.core.exceptions
import
ObjectDoesNotExist
from
Crypto.Cipher
import
AES
from
binascii
import
b2a_hex
,
a2b_hex
import
re
os
.
environ
[
'DJANGO_SETTINGS_MODULE'
]
=
'jumpserver.settings'
django
.
setup
()
from
juser.models
import
User
,
Group
from
jasset.models
import
Asset
,
IDC
from
juser.models
import
User
from
jasset.models
import
Asset
from
jpermission.models
import
Permission
try
:
...
...
@@ -109,6 +106,7 @@ def posix_shell(chan, user, host):
if
not
os
.
path
.
isdir
(
today_connect_log_dir
):
try
:
os
.
makedirs
(
today_connect_log_dir
)
os
.
chmod
(
today_connect_log_dir
,
0777
)
except
OSError
:
alert_print
(
'Create
%
s failed, Please modify
%
s permission.'
%
(
today_connect_log_dir
,
connect_log_dir
))
...
...
@@ -258,7 +256,6 @@ def connect(username, password, host, port):
# Set PS1 and msg it
channel
.
send
(
ps1
)
channel
.
send
(
login_msg
)
print
channel
.
get_name
()
# Make ssh interactive tunnel
posix_shell
(
channel
,
username
,
host
)
...
...
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