stages/users: set authorized_keys file permissions to 600

Otherwise user may be unable to login. More information:
https://stackoverflow.com/questions/6377009/adding-public-key-to-ssh-authorized-keys-does-not-log-me-in-automatically
This commit is contained in:
Ondřej Budai 2019-10-17 13:46:21 +02:00 committed by Tom Gundersen
parent dff8d6591b
commit d0a3f99342

View file

@ -68,6 +68,7 @@ def add_ssh_key(root, user, key):
f.write(f"{key}\n")
os.chown(authorized_keys, int(uid), int(gid))
os.chmod(authorized_keys, 0o600)
def main(tree, options):