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
59657329
Commit
59657329
authored
Oct 30, 2014
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify connect_one view
parent
93bd0201
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
jumpserver.py
jumpserver.py
+6
-7
No files found.
jumpserver.py
View file @
59657329
...
...
@@ -109,7 +109,7 @@ def connect(host, port, user, password):
os
.
mkdir
(
log_dir
)
logfile
=
open
(
"
%
s/
%
s_
%
s_
%
s"
%
(
log_dir
,
host
,
time
.
strftime
(
'
%
Y
%
m
%
d'
),
user
),
'a'
)
logfile
.
write
(
'
\n\n
%
s
\n\n
'
%
time
.
strftime
(
'
%
Y
%
m
%
d_
%
H
%
M
%
S'
))
cmd
=
'ssh -p
%
s
%
s@
%
s'
%
(
port
,
user
,
host
)
cmd
=
'ssh -
q -
p
%
s
%
s@
%
s'
%
(
port
,
user
,
host
)
global
foo
foo
=
pexpect
.
spawn
(
'/bin/bash'
,
[
'-c'
,
cmd
])
foo
.
logfile
=
logfile
...
...
@@ -267,15 +267,14 @@ def connect_one(username, option):
if
ip_len
==
1
:
ip
=
ip_matched
[
0
]
else
:
for
one_ip
in
ip_matched
:
if
one_ip
.
endswith
(
ip_input
):
ip
=
one_ip
break
else
:
if
ip_input
in
ip_matched
:
ip
=
ip_input
else
:
for
one_ip
in
ip_matched
:
print
one_ip
if
ip
:
password
=
jm
.
decrypt
(
sth_select
(
username
=
username
))
port
=
sth_select
(
ip
=
ip
_input
)
port
=
sth_select
(
ip
=
ip
)
print
"Connecting
%
s ..."
%
ip
connect
(
ip
,
port
,
username
,
password
)
else
:
...
...
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