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
fe70ca80
Commit
fe70ca80
authored
Dec 24, 2014
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bUg
parent
17ef381d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
connect.py
connect.py
+5
-4
No files found.
connect.py
View file @
fe70ca80
...
@@ -11,6 +11,7 @@ import fcntl
...
@@ -11,6 +11,7 @@ import fcntl
import
signal
import
signal
import
textwrap
import
textwrap
import
django
import
django
import
getpass
from
django.core.exceptions
import
ObjectDoesNotExist
from
django.core.exceptions
import
ObjectDoesNotExist
from
Crypto.Cipher
import
AES
from
Crypto.Cipher
import
AES
from
binascii
import
b2a_hex
,
a2b_hex
from
binascii
import
b2a_hex
,
a2b_hex
...
@@ -154,7 +155,7 @@ def get_user_host(username):
...
@@ -154,7 +155,7 @@ def get_user_host(username):
hosts
=
{}
hosts
=
{}
try
:
try
:
user
=
User
.
objects
.
get
(
username
=
username
)
user
=
User
.
objects
.
get
(
username
=
username
)
except
AttributeError
:
except
AttributeError
,
ObjectDoesNotExist
:
red_print
(
"Don't Use Root To Do That or User isn't Exist."
)
red_print
(
"Don't Use Root To Do That or User isn't Exist."
)
else
:
else
:
perm_all
=
user
.
permission_set
.
all
()
perm_all
=
user
.
permission_set
.
all
()
...
@@ -164,8 +165,7 @@ def get_user_host(username):
...
@@ -164,8 +165,7 @@ def get_user_host(username):
def
print_prompt
():
def
print_prompt
():
msg
=
"""
msg
=
"""
\033
[1;32m### Welcome Use JumpServer To Login. ###
\033
[0m
\033
[1;32m### Welcome Use JumpServer To Login. ###
\033
[0m
1) Type
\033
[32mIP ADDRESS
\033
[0m To Login.
1) Type
\033
[32mIP ADDRESS
\033
[0m To Login.
2) Type
\033
[32mP/p
\033
[0m To Print The Servers You Available.
2) Type
\033
[32mP/p
\033
[0m To Print The Servers You Available.
3) Type
\033
[32mE/e
\033
[0m To Execute Command On Several Servers.
3) Type
\033
[32mE/e
\033
[0m To Execute Command On Several Servers.
...
@@ -222,7 +222,8 @@ def connect(username, password, host, port):
...
@@ -222,7 +222,8 @@ def connect(username, password, host, port):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
login_name
=
os
.
getlogin
()
#login_name = os.getlogin()
login_name
=
getpass
.
getuser
()
print_prompt
()
print_prompt
()
try
:
try
:
while
True
:
while
True
:
...
...
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