I'm trying to create a new user account using a custom skeleton directory instead of the default /etc/skel.

Reading man useradd I'm pretty sure this should work:

useradd -m -d /home/foo -k /usr/local/etc/custom-skel foo

But it seems like the -k attribute gets ignored and still the default /etc/skel is used as the files (.bash_logout, .bashrc and .profile) still get copied from there to /home/foo.

Atm my /usr/local/etc/custom-skel contains one empty file to see if it gets copied to /home/foo but it doesn't.

Am I missing something or is there a bug in useradd or Raspbian?

I have this problem on Raspberry Pi 2 with fresh image of Raspbian GNU/Linux 9.1 (stretch). Not sure if this affects the issue.

Your Answer

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

Browse other questions tagged or ask your own question.