mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
set authorized_keys file to 0600 when it is made with Salt
This commit is contained in:
parent
7dfe4b4312
commit
e42561b5cf
@ -239,6 +239,7 @@ def set_auth_key(
|
|||||||
if not os.path.isfile(fconfig):
|
if not os.path.isfile(fconfig):
|
||||||
open(fconfig, 'a+').write('\n{0}'.format(auth_line))
|
open(fconfig, 'a+').write('\n{0}'.format(auth_line))
|
||||||
os.chown(fconfig, uinfo['uid'], uinfo['gid'])
|
os.chown(fconfig, uinfo['uid'], uinfo['gid'])
|
||||||
|
os.chmod(fconfig, 384)
|
||||||
else:
|
else:
|
||||||
open(fconfig, 'a+').write('\n{0}'.format(auth_line))
|
open(fconfig, 'a+').write('\n{0}'.format(auth_line))
|
||||||
return 'new'
|
return 'new'
|
||||||
|
Loading…
Reference in New Issue
Block a user