From e42561b5cf76cb72c01c950dd79e9081f085d935 Mon Sep 17 00:00:00 2001 From: Thomas S Hatch Date: Fri, 27 Jan 2012 20:47:08 -0700 Subject: [PATCH] set authorized_keys file to 0600 when it is made with Salt --- salt/modules/ssh.py | 1 + 1 file changed, 1 insertion(+) diff --git a/salt/modules/ssh.py b/salt/modules/ssh.py index 2cd56f2041..ce62f29e24 100644 --- a/salt/modules/ssh.py +++ b/salt/modules/ssh.py @@ -239,6 +239,7 @@ def set_auth_key( if not os.path.isfile(fconfig): open(fconfig, 'a+').write('\n{0}'.format(auth_line)) os.chown(fconfig, uinfo['uid'], uinfo['gid']) + os.chmod(fconfig, 384) else: open(fconfig, 'a+').write('\n{0}'.format(auth_line)) return 'new'