Skip to content

Commit

Permalink
Ubuntu's passwd command doesn't support --stdin option, use chpasswd …
Browse files Browse the repository at this point in the history
…which is also available in CentOS
  • Loading branch information
LI Yong committed Jan 7, 2016
1 parent d9b4f55 commit 73522dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions juser/user_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 %s/connect.py '%s'; echo '%s'; echo '%s' | passwd --stdin '%s'" %
(BASE_DIR, username, password, password, username))
bash("useradd -s %s/connect.py '%s'; echo '%s'; echo '%s:%s' | chpasswd " %
(BASE_DIR, username, password, username, password))
if ssh_key_login_need:
gen_ssh_key(username, ssh_key_pwd)

Expand Down

0 comments on commit 73522dc

Please sign in to comment.