2

I want to add a few directories to the skeleton directory. When I add new user I want to add my own directories to the new home directories.

1
  • 1
    mkdir /etc/skel/blahblah – thrig May 26 '16 at 16:18
5

As thrig pointed out, all that's needed is to create the directory structure that you want under /etc/skel.

Quoting from the useradd man page

-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 specified.

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

... and the default SKEL variable in /etc/default/useradd is /etc/skel.

0

According to useradd -D

 GROUP=100
 HOME=/home
 INACTIVE=-1
 EXPIRE=
 SHELL=/bin/bash
 SKEL=/etc/skel
 GROUPS=video,dialout
 CREATE_MAIL_SPOOL=no

SKEL= [path] is your skeleton directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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