Commit 3902482e authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

SSH personality keys ownership fix

also send mode/owner/group for each user's authorized_keys
parent def41d6d
...@@ -328,8 +328,8 @@ ...@@ -328,8 +328,8 @@
if (username != 'root') { if (username != 'root') {
prepend = '/home' prepend = '/home'
} }
return '{1}/{0}/.ssh/authorized_keys'.format(username, return {'user': username, 'path': '{1}/{0}/.ssh/authorized_keys'.format(username,
prepend); prepend)};
}); });
}, },
...@@ -351,7 +351,7 @@ ...@@ -351,7 +351,7 @@
}, },
personality_data_for_keys: function(keys) { personality_data_for_keys: function(keys) {
return _.map(this.ssh_keys_paths(), function(path) { return _.map(this.ssh_keys_paths(), function(pathinfo) {
var contents = ''; var contents = '';
_.each(keys, function(key){ _.each(keys, function(key){
contents = contents + key.get("content") + "\n" contents = contents + key.get("content") + "\n"
...@@ -359,8 +359,11 @@ ...@@ -359,8 +359,11 @@
contents = $.base64.encode(contents); contents = $.base64.encode(contents);
return { return {
path: path, path: pathinfo.path,
contents: contents contents: contents,
mode: 0600,
owner: pathinfo.user,
group: pathinfo.user
} }
}); });
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment