nuageinit: Set recommended SSH permissions
As stated in sshd(8), the recommended permissions for ~/.ssh are read/write/execute for the user, and not accessible by others; and the recommended permissions for ~/.ssh/authorized_keys are read/write for the user, and not accessible by others.
This commit is contained in:
committed by
Baptiste Daroussin
parent
7b73ecfe64
commit
07d17ca189
@@ -205,9 +205,11 @@ local function addsshkey(homedir, key)
|
||||
f:write(key .. "\n")
|
||||
f:close()
|
||||
if chownak then
|
||||
os.execute("chmod 0600 " .. ak_path)
|
||||
pu.chown(ak_path, dirattrs.uid, dirattrs.gid)
|
||||
end
|
||||
if chowndotssh then
|
||||
os.execute("chmod 0700 " .. dotssh_path)
|
||||
pu.chown(dotssh_path, dirattrs.uid, dirattrs.gid)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user