From 7435d602dd9781b5313b2ec365dc68114a59bc06 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 13 Jan 2015 23:15:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B7=BB=E5=8A=A0=E7=94=A8?= =?UTF-8?q?=E6=88=B7bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- juser/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/juser/views.py b/juser/views.py index 4ba79c30b..a7c80bb39 100644 --- a/juser/views.py +++ b/juser/views.py @@ -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):