修改添加用户bug

pull/6/head
ibuler 10 years ago
parent 2b6c2cd6fc
commit 7435d602dd

@ -191,7 +191,7 @@ def gen_ssh_key(username, password=None, length=2048):
with open(public_key_file, 'w') as pub_f: with open(public_key_file, 'w') as pub_f:
pub_f.write(pub_key.exportKey('OpenSSH')) pub_f.write(pub_key.exportKey('OpenSSH'))
os.chmod(public_key_file, 0600) 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): def server_add_user(username, password, ssh_key_pwd1):

Loading…
Cancel
Save