luci-mod-system: sshkeys.js: create authorized_keys as 0600

Fixes: #3226
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2019-10-21 08:43:07 +02:00
parent 77a89299f4
commit dffa9c57fe

View 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);