I'm using ubuntu server 14.04. I want to add some files and folders by default in each user's home directory, whenever a user account is created.

marked as duplicate by Gilles, G-Man, Satō Katsura, phk, Kusalananda Jun 2 '17 at 9:10

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You can add the files you want to /etc/skel directory.

$ sudo touch /etc/skel/test.txt
$ sudo useradd -m test
$ ls /home/test

From man useradd:

-k, --skel SKEL_DIR
           The skeleton directory, which contains files and directories to 
           be copied in the user's home directory, when the home
           directory is created by useradd.

           This option is only valid if the -m (or --create-home) option is 

           If this option is not set, the skeleton directory is defined by 
           the SKEL variable in /etc/default/useradd or, by
           default, /etc/skel.

           If possible, the ACLs and extended attributes are copied.

Not the answer you're looking for? Browse other questions tagged or ask your own question.