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
9d7c3033
Commit
9d7c3033
authored
Jan 11, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复中文字符报错
parent
ff5b339c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
next.py
install/next.py
+4
-4
zzjumpserver.sh
install/zzjumpserver.sh
+11
-0
user_api.py
juser/user_api.py
+2
-2
No files found.
install/next.py
View file @
9d7c3033
...
@@ -81,9 +81,9 @@ class Setup(object):
...
@@ -81,9 +81,9 @@ class Setup(object):
os
.
system
(
'id
%
s &> /dev/null || useradd
%
s'
%
(
self
.
admin_user
,
self
.
admin_user
))
os
.
system
(
'id
%
s &> /dev/null || useradd
%
s'
%
(
self
.
admin_user
,
self
.
admin_user
))
@staticmethod
@staticmethod
def
_
ensure_
sh
():
def
_
cp_zz
sh
():
jshell
=
os
.
path
.
join
(
jms_dir
,
'connect.py'
)
os
.
chdir
(
os
.
path
.
join
(
jms_dir
,
'install'
)
)
os
.
chmod
(
jshell
,
0755
)
shutil
.
copy
(
'zzjumpserver.sh'
,
'/etc/profile.d/'
)
@staticmethod
@staticmethod
def
_run_service
():
def
_run_service
():
...
@@ -97,7 +97,7 @@ class Setup(object):
...
@@ -97,7 +97,7 @@ class Setup(object):
self
.
_sync_db
()
self
.
_sync_db
()
self
.
_input_admin
()
self
.
_input_admin
()
self
.
_create_admin
()
self
.
_create_admin
()
self
.
_
ensure_
sh
()
self
.
_
cp_zz
sh
()
self
.
_run_service
()
self
.
_run_service
()
...
...
install/zzjumpserver.sh
0 → 100644
View file @
9d7c3033
#!/bin/bash
if
[
"
$USER
"
!=
"admin"
]
||
[
"
$USER
"
!=
"root"
]
||
[
"
$USER
"
!=
""
]
;
then
python /opt/jumpserver/connect.py
if
[
$USER
==
'guanghongwei'
]
;
then
echo
else
exit
3
echo
fi
fi
juser/user_api.py
View file @
9d7c3033
...
@@ -151,8 +151,8 @@ def server_add_user(username, password, ssh_key_pwd='', ssh_key_login_need=True)
...
@@ -151,8 +151,8 @@ def server_add_user(username, password, ssh_key_pwd='', ssh_key_login_need=True)
add a system user in jumpserver
add a system user in jumpserver
在jumpserver服务器上添加一个用户
在jumpserver服务器上添加一个用户
"""
"""
bash
(
"useradd
-s
%
s/connect.py
'
%
s'; echo '
%
s'; echo '
%
s:
%
s' | chpasswd "
%
bash
(
"useradd '
%
s'; echo '
%
s'; echo '
%
s:
%
s' | chpasswd "
%
(
BASE_DIR
,
username
,
password
,
username
,
password
))
(
username
,
password
,
username
,
password
))
if
ssh_key_login_need
:
if
ssh_key_login_need
:
gen_ssh_key
(
username
,
ssh_key_pwd
)
gen_ssh_key
(
username
,
ssh_key_pwd
)
...
...
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