Commit bc6dd4ff by Guba Sándor

store-server: Fixed permission issues

parent 7c5b5b95
...@@ -322,13 +322,9 @@ def fbuffer(f, chunk_size=4096): ...@@ -322,13 +322,9 @@ def fbuffer(f, chunk_size=4096):
# Update users .ssh/authorized_keys # Update users .ssh/authorized_keys
def updateSSHAuthorizedKeys(username, key_list): def updateSSHAuthorizedKeys(username, key_list):
user_home_ssh = '/home/'+username+'/home/.ssh'
user_uid=getpwnam(username).pw_uid user_uid=getpwnam(username).pw_uid
user_gid=getpwnam(username).pw_gid user_gid=getpwnam(username).pw_gid
if not os.path.exists(user_home_ssh): auth_file_name = "/home/"+username+"/authorized_keys"
os.mkdir(user_home_ssh, 0700)
os.chown(user_home_ssh, user_uid, user_gid)
auth_file_name = user_home_ssh+'/authorized_keys'
with open(auth_file_name, 'w') as auth_file: with open(auth_file_name, 'w') as auth_file:
for key in key_list: for key in key_list:
auth_file.write(key+'\n') auth_file.write(key+'\n')
......
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 sign in to comment