Q:

Adding/updating skeleton files after user creation

Background
RedHat 7 (and 6) servers with multiple application servers (shared binaries).
We set up separate user accounts when adding applications servers with $HOME = appserver_root. The installation however demands that the target directory does not exist.
So we:

Create the user without creating the home directory
Install the server into (and creating) the home directory
Reset the permissions of the home directory

This process will not set up the skeleton files, i.e. copy /etc/skel/
Question
We can simply copy /etc/skel/.*, but is there a tooled way - command - which will do this?
I'd prefer using a standard tool instead of making a guess, or parsing /etc/default/useradd for the correct SKEL path.

A:

You could try to adjust your procedure to something like this:

Create the user normally, allowing the homedir to be created and
populated with the skeleton files in the "standard" way
Rename the homedir to something else, username.skeleton for example
Install the server into the home directory (creating a new homedir)
Reset the permissions of the home directory
Carefully merge into the homedir the config files from the username.skeleton dir (there can be conflicts if the server installation creates its own config files), or simply copy over the files already merged in previous identical installations, if available.

I'm using a similar procedure for my own homedir when installing a new OS version because my existing config files from the older OS version may negatively impact the newer app versions and the new skeleton files are missing my customisations - they need to be merged.

