diff --git a/init.sh b/init.sh new file mode 100755 index 000000000..f51e2f7d9 --- /dev/null +++ b/init.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# + +trap '' SIGINT +base_dir=$(dirname $0) + +export LANG='zh_CN.UTF-8' +python $base_dir/connect.py + +exit diff --git a/install/zzjumpserver.sh b/install/zzjumpserver.sh deleted file mode 100644 index 516b0466e..000000000 --- a/install/zzjumpserver.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -export LANG='zh_CN.UTF-8' - -if [ "$USER" != "admin" ] && [ "$USER" != "root" ];then - python /opt/jumpserver/connect.py - if [ $USER == 'guanghongwei' ];then - echo - else - exit 3 - echo - fi -fi diff --git a/juser/user_api.py b/juser/user_api.py index a6fc7648a..305a877fd 100644 --- a/juser/user_api.py +++ b/juser/user_api.py @@ -151,8 +151,8 @@ def server_add_user(username, password, ssh_key_pwd='', ssh_key_login_need=True) add a system user in jumpserver 在jumpserver服务器上添加一个用户 """ - bash("useradd '%s'; echo '%s'; echo '%s:%s' | chpasswd " % - (username, password, username, password)) + bash("useradd -s '%s' '%s'; echo '%s'; echo '%s:%s' | chpasswd " % + (os.path.join(BASE_DIR, 'init.sh'), username, password, username, password)) if ssh_key_login_need: gen_ssh_key(username, ssh_key_pwd)