Commit 7435d602 authored by ibuler's avatar ibuler

修改添加用户bug

parent 2b6c2cd6
......@@ -191,7 +191,7 @@ def gen_ssh_key(username, password=None, length=2048):
with open(public_key_file, 'w') as pub_f:
pub_f.write(pub_key.exportKey('OpenSSH'))
os.chmod(public_key_file, 0600)
os.chown(public_key_file, username, username)
bash('chown %s:%s %s' % (username, username, public_key_file))
def server_add_user(username, password, ssh_key_pwd1):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment