From: Jo-Philipp Wich Date: Mon, 21 Oct 2019 06:43:07 +0000 (+0200) Subject: luci-mod-system: sshkeys.js: create authorized_keys as 0600 X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=dffa9c57fee931e4de53e3ae955d632dcd77a42d;p=project%2Fluci.git luci-mod-system: sshkeys.js: create authorized_keys as 0600 Fixes: #3226 Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js index 84a1d64878..05d41b0dde 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/sshkeys.js @@ -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);