Properly quote root's key in the sshd hook
authorMichael Brown <michael@netdirect.ca>
Tue, 11 Feb 2014 17:12:59 +0000 (12:12 -0500)
committerMichael Brown <michael@netdirect.ca>
Tue, 11 Feb 2014 17:12:59 +0000 (12:12 -0500)
templates/sshd.template.yml

index 79831f5f78b0738e573843308109422b86a575c5..ac48523584fccaf9ef0f9a7700778e2c5810bcf9 100644 (file)
@@ -22,4 +22,5 @@ run:
       cmd:
         - mkdir -p /var/run/sshd
         - mkdir -p /root/.ssh
-        - echo $ssh_key >> /root/.ssh/authorized_keys
+        - echo "$ssh_key" >> /root/.ssh/authorized_keys
+        - chmod 640 /root/.ssh/authorized_keys