luci-mod-system: sshkeys.js: create authorized_keys as 0600
authorJo-Philipp Wich <jo@mein.io>
Mon, 21 Oct 2019 06:43:07 +0000 (08:43 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 21 Oct 2019 06:43:07 +0000 (08:43 +0200)
Fixes: #3226
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js

index 84a1d64878cf8b74e380bf6948314b166d79faf9..05d41b0dde49d1ae3ec4bbd5341c75170edad861 100644 (file)
@@ -117,7 +117,7 @@ function renderKeys(keys) {
 }
 
 function saveKeys(keys) {
-       return fs.write('/etc/dropbear/authorized_keys', keys.join('\n') + '\n')
+       return fs.write('/etc/dropbear/authorized_keys', keys.join('\n') + '\n', 384 /* 0600 */)
                .then(renderKeys.bind(this, keys))
                .catch(function(e) { L.ui.addNotification(null, E('p', e.message)) })
                .finally(L.ui.hideModal);