Use /etc/skel when creating a new user
Attached is a patch to use /etc/skel when creating a new shell user. This is useful for example sharing the same SSH key for hg authentication on a dev server.
It's a suboptimal way to do this (the proper way would be to use the -k option of useradd, but that's not possible since the same routine isn't creating the directory), but at least it works :)
Index: server/plugins-available/shelluser_base_plugin.inc.php
--- server/plugins-available/shelluser_base_plugin.inc.php (revision 2470) +++ server/plugins-available/shelluser_base_plugin.inc.php (working copy) @@ -88,7 +88,11 @@ exec($command); $app->log("Executed command: ".$command,LOGLEVEL_DEBUG); $app->log("Added shelluser: ".$data['new']['username'],LOGLEVEL_DEBUG);
-
$command = 'cp -R -n /etc/skel/. ' . escapeshellcmd($data['new']['dir']);
-
exec($command);
-
$app->log("Executed command: ".$command,LOGLEVEL_DEBUG);
-
// call the ssh-rsa update function $app->uses("getconf"); $this->data = $data;