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:
parent
dff8d6591b
commit
d0a3f99342
1 changed files with 1 additions and 0 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue