Why useradd -m doesn't fill created home dir with some defaults?Empty /home/user folder for NEW usersHow to...

What is the "books received" section in journals?

How much web presence should I have?

What is Gilligan's full Name?

Make Gimbap cutter

What's the difference between DHCP and NAT? Are they mutually exclusive?

Why is my power MOSFET heating up when on?

How to represent jealousy in a cute way?

When to use и or а as “and”?

C++ logging library

Entered UK using my now-lost UK passport; can I go to Spain using my US passport?

In The Incredibles 2, why does Screenslaver's name use a pun on something that doesn't exist in the 1950s pastiche?

How do I avoid typing "git" at the begining of every Git command?

How do I type a hyphen in iOS 12?

What would the consequences be of a high number of solar systems being within close proximity to one another?

If absolute velocity does not exist, how can we say a rocket accelerates in empty space?

Why do the TIE Fighter pilot helmets have similar ridges as the rebels?

Course development: can I pay someone to make slides for the course?

DateTime.addMonths skips a month (from feb to mar)

Prove that the infinite series equals 1

How can I list the different hex characters between two files?

If the pressure inside and outside a balloon balance, then why does air leave when it pops?

What plausible reason could I give for my FTL drive only working in space

Quasar Redshifts

Is it true that "only photographers care about noise"?



Why useradd -m doesn't fill created home dir with some defaults?


Empty /home/user folder for NEW usersHow to properly setup user/groups/permissions for a web server?why useradd havent created the standard files?Create a user who cannot explore system directoriesWhy is the home directory not created when I create a new user?How to get rsync to complain if user not foundWhy is /etc/shadow shortening the password that I've set with the command: useradd -p?useradd on CentOS with home directory and sudo privilegesHow to automatically create an empty directory when new user is created?Why login with user created with useradd command in Debian has no enviroment set?unix, adding users to existing directory in centos






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







3















My motives:



I want to create deployment script which prepare all system with just 1 click, and although learn Linux this way. So I don't want to use interactive utils like adduser (all interaction info I put in some settings.txt).



My system:



Debian 8.2 (jessie)



I want:



Create user account with home directory and default folders inside. Like adduser do but with useradd.



My problem:



There is paragraph in man userradd:




   -m, --create-home
Create the user's home directory if it does not exist. The files and directories contained in the
skeleton directory (which can be defined with the -k option) will be copied to the home directory.



I looked in /etc/adduser.conf to find the value of SKEL variable for adduser. And it is /etc/skel.



But after I run some useradd -m myuser -k /etc/skel, I've got empty /home/myuser directory.



Update 1



After I created some additional file, it alsought copied to the new user home directory (with 3 hidden files). So it means that /etc/skel doesn't impact on such folders as: Desktop, Downloads, etc. But in this case what does?










share|improve this question




















  • 2





    The directories you are referring to are part of the xdg-user-dirs I think, and are specific to "desktop" environments: IIRC they are created by the system when the user first instantiates an appropriate Xsession, based on the templates in /etc/xdg/user-dirs.defaults

    – steeldriver
    Oct 11 '15 at 13:54


















3















My motives:



I want to create deployment script which prepare all system with just 1 click, and although learn Linux this way. So I don't want to use interactive utils like adduser (all interaction info I put in some settings.txt).



My system:



Debian 8.2 (jessie)



I want:



Create user account with home directory and default folders inside. Like adduser do but with useradd.



My problem:



There is paragraph in man userradd:




   -m, --create-home
Create the user's home directory if it does not exist. The files and directories contained in the
skeleton directory (which can be defined with the -k option) will be copied to the home directory.



I looked in /etc/adduser.conf to find the value of SKEL variable for adduser. And it is /etc/skel.



But after I run some useradd -m myuser -k /etc/skel, I've got empty /home/myuser directory.



Update 1



After I created some additional file, it alsought copied to the new user home directory (with 3 hidden files). So it means that /etc/skel doesn't impact on such folders as: Desktop, Downloads, etc. But in this case what does?










share|improve this question




















  • 2





    The directories you are referring to are part of the xdg-user-dirs I think, and are specific to "desktop" environments: IIRC they are created by the system when the user first instantiates an appropriate Xsession, based on the templates in /etc/xdg/user-dirs.defaults

    – steeldriver
    Oct 11 '15 at 13:54














3












3








3


1






My motives:



I want to create deployment script which prepare all system with just 1 click, and although learn Linux this way. So I don't want to use interactive utils like adduser (all interaction info I put in some settings.txt).



My system:



Debian 8.2 (jessie)



I want:



Create user account with home directory and default folders inside. Like adduser do but with useradd.



My problem:



There is paragraph in man userradd:




   -m, --create-home
Create the user's home directory if it does not exist. The files and directories contained in the
skeleton directory (which can be defined with the -k option) will be copied to the home directory.



I looked in /etc/adduser.conf to find the value of SKEL variable for adduser. And it is /etc/skel.



But after I run some useradd -m myuser -k /etc/skel, I've got empty /home/myuser directory.



Update 1



After I created some additional file, it alsought copied to the new user home directory (with 3 hidden files). So it means that /etc/skel doesn't impact on such folders as: Desktop, Downloads, etc. But in this case what does?










share|improve this question
















My motives:



I want to create deployment script which prepare all system with just 1 click, and although learn Linux this way. So I don't want to use interactive utils like adduser (all interaction info I put in some settings.txt).



My system:



Debian 8.2 (jessie)



I want:



Create user account with home directory and default folders inside. Like adduser do but with useradd.



My problem:



There is paragraph in man userradd:




   -m, --create-home
Create the user's home directory if it does not exist. The files and directories contained in the
skeleton directory (which can be defined with the -k option) will be copied to the home directory.



I looked in /etc/adduser.conf to find the value of SKEL variable for adduser. And it is /etc/skel.



But after I run some useradd -m myuser -k /etc/skel, I've got empty /home/myuser directory.



Update 1



After I created some additional file, it alsought copied to the new user home directory (with 3 hidden files). So it means that /etc/skel doesn't impact on such folders as: Desktop, Downloads, etc. But in this case what does?







users useradd






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 11 '15 at 20:39









Braiam

24.1k2079145




24.1k2079145










asked Oct 11 '15 at 10:27









Alex SilkovskyAlex Silkovsky

1689




1689








  • 2





    The directories you are referring to are part of the xdg-user-dirs I think, and are specific to "desktop" environments: IIRC they are created by the system when the user first instantiates an appropriate Xsession, based on the templates in /etc/xdg/user-dirs.defaults

    – steeldriver
    Oct 11 '15 at 13:54














  • 2





    The directories you are referring to are part of the xdg-user-dirs I think, and are specific to "desktop" environments: IIRC they are created by the system when the user first instantiates an appropriate Xsession, based on the templates in /etc/xdg/user-dirs.defaults

    – steeldriver
    Oct 11 '15 at 13:54








2




2





The directories you are referring to are part of the xdg-user-dirs I think, and are specific to "desktop" environments: IIRC they are created by the system when the user first instantiates an appropriate Xsession, based on the templates in /etc/xdg/user-dirs.defaults

– steeldriver
Oct 11 '15 at 13:54





The directories you are referring to are part of the xdg-user-dirs I think, and are specific to "desktop" environments: IIRC they are created by the system when the user first instantiates an appropriate Xsession, based on the templates in /etc/xdg/user-dirs.defaults

– steeldriver
Oct 11 '15 at 13:54










2 Answers
2






active

oldest

votes


















1














For me , by default, the /etc/skel contains just 3 hidden files, .bash_logout , .bashrc and .profile, which can be displayed with ls -a.

Your command should work, have you checked the content of your /etc/skel directory ?






share|improve this answer
























  • I although found 3 hidden files inside /etc/skel. (post updated)

    – Alex Silkovsky
    Oct 11 '15 at 11:19











  • You have to create the folders/files in /etc/skel . For example, I created /etc/skel/Desktop/test.sh and for the new user, the folder /home/myuser/Desktop was created containing the test.sh file .

    – mazs
    Oct 11 '15 at 11:33





















0














When a new home directory is created by adduser or useradd, the home directory is populated with the contents of /etc/skel (the "skeletal home directory", see man adduser and/or man useradd). This directory contains the initial dot-files, like .bashrc etc., that all users get. The Desktop etc. directories are usually not part of the contents of she skeletal home directory since a user may not even want to run a desktop environment (or one that uses those directories).



These directories are created when the user logs in and starts a graphical desktop environment.



Would you want these extra directories (or any other file or directory) to be part of the skeletal home directory, then create them in /etc/skel, assuming the user's graphical desktop environment does not have issues with these directories already existing (I don't use Linux-like desktops, so I don't know).






share|improve this answer


























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f235373%2fwhy-useradd-m-doesnt-fill-created-home-dir-with-some-defaults%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    For me , by default, the /etc/skel contains just 3 hidden files, .bash_logout , .bashrc and .profile, which can be displayed with ls -a.

    Your command should work, have you checked the content of your /etc/skel directory ?






    share|improve this answer
























    • I although found 3 hidden files inside /etc/skel. (post updated)

      – Alex Silkovsky
      Oct 11 '15 at 11:19











    • You have to create the folders/files in /etc/skel . For example, I created /etc/skel/Desktop/test.sh and for the new user, the folder /home/myuser/Desktop was created containing the test.sh file .

      – mazs
      Oct 11 '15 at 11:33


















    1














    For me , by default, the /etc/skel contains just 3 hidden files, .bash_logout , .bashrc and .profile, which can be displayed with ls -a.

    Your command should work, have you checked the content of your /etc/skel directory ?






    share|improve this answer
























    • I although found 3 hidden files inside /etc/skel. (post updated)

      – Alex Silkovsky
      Oct 11 '15 at 11:19











    • You have to create the folders/files in /etc/skel . For example, I created /etc/skel/Desktop/test.sh and for the new user, the folder /home/myuser/Desktop was created containing the test.sh file .

      – mazs
      Oct 11 '15 at 11:33
















    1












    1








    1







    For me , by default, the /etc/skel contains just 3 hidden files, .bash_logout , .bashrc and .profile, which can be displayed with ls -a.

    Your command should work, have you checked the content of your /etc/skel directory ?






    share|improve this answer













    For me , by default, the /etc/skel contains just 3 hidden files, .bash_logout , .bashrc and .profile, which can be displayed with ls -a.

    Your command should work, have you checked the content of your /etc/skel directory ?







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Oct 11 '15 at 10:51









    mazsmazs

    2,6191623




    2,6191623













    • I although found 3 hidden files inside /etc/skel. (post updated)

      – Alex Silkovsky
      Oct 11 '15 at 11:19











    • You have to create the folders/files in /etc/skel . For example, I created /etc/skel/Desktop/test.sh and for the new user, the folder /home/myuser/Desktop was created containing the test.sh file .

      – mazs
      Oct 11 '15 at 11:33





















    • I although found 3 hidden files inside /etc/skel. (post updated)

      – Alex Silkovsky
      Oct 11 '15 at 11:19











    • You have to create the folders/files in /etc/skel . For example, I created /etc/skel/Desktop/test.sh and for the new user, the folder /home/myuser/Desktop was created containing the test.sh file .

      – mazs
      Oct 11 '15 at 11:33



















    I although found 3 hidden files inside /etc/skel. (post updated)

    – Alex Silkovsky
    Oct 11 '15 at 11:19





    I although found 3 hidden files inside /etc/skel. (post updated)

    – Alex Silkovsky
    Oct 11 '15 at 11:19













    You have to create the folders/files in /etc/skel . For example, I created /etc/skel/Desktop/test.sh and for the new user, the folder /home/myuser/Desktop was created containing the test.sh file .

    – mazs
    Oct 11 '15 at 11:33







    You have to create the folders/files in /etc/skel . For example, I created /etc/skel/Desktop/test.sh and for the new user, the folder /home/myuser/Desktop was created containing the test.sh file .

    – mazs
    Oct 11 '15 at 11:33















    0














    When a new home directory is created by adduser or useradd, the home directory is populated with the contents of /etc/skel (the "skeletal home directory", see man adduser and/or man useradd). This directory contains the initial dot-files, like .bashrc etc., that all users get. The Desktop etc. directories are usually not part of the contents of she skeletal home directory since a user may not even want to run a desktop environment (or one that uses those directories).



    These directories are created when the user logs in and starts a graphical desktop environment.



    Would you want these extra directories (or any other file or directory) to be part of the skeletal home directory, then create them in /etc/skel, assuming the user's graphical desktop environment does not have issues with these directories already existing (I don't use Linux-like desktops, so I don't know).






    share|improve this answer






























      0














      When a new home directory is created by adduser or useradd, the home directory is populated with the contents of /etc/skel (the "skeletal home directory", see man adduser and/or man useradd). This directory contains the initial dot-files, like .bashrc etc., that all users get. The Desktop etc. directories are usually not part of the contents of she skeletal home directory since a user may not even want to run a desktop environment (or one that uses those directories).



      These directories are created when the user logs in and starts a graphical desktop environment.



      Would you want these extra directories (or any other file or directory) to be part of the skeletal home directory, then create them in /etc/skel, assuming the user's graphical desktop environment does not have issues with these directories already existing (I don't use Linux-like desktops, so I don't know).






      share|improve this answer




























        0












        0








        0







        When a new home directory is created by adduser or useradd, the home directory is populated with the contents of /etc/skel (the "skeletal home directory", see man adduser and/or man useradd). This directory contains the initial dot-files, like .bashrc etc., that all users get. The Desktop etc. directories are usually not part of the contents of she skeletal home directory since a user may not even want to run a desktop environment (or one that uses those directories).



        These directories are created when the user logs in and starts a graphical desktop environment.



        Would you want these extra directories (or any other file or directory) to be part of the skeletal home directory, then create them in /etc/skel, assuming the user's graphical desktop environment does not have issues with these directories already existing (I don't use Linux-like desktops, so I don't know).






        share|improve this answer















        When a new home directory is created by adduser or useradd, the home directory is populated with the contents of /etc/skel (the "skeletal home directory", see man adduser and/or man useradd). This directory contains the initial dot-files, like .bashrc etc., that all users get. The Desktop etc. directories are usually not part of the contents of she skeletal home directory since a user may not even want to run a desktop environment (or one that uses those directories).



        These directories are created when the user logs in and starts a graphical desktop environment.



        Would you want these extra directories (or any other file or directory) to be part of the skeletal home directory, then create them in /etc/skel, assuming the user's graphical desktop environment does not have issues with these directories already existing (I don't use Linux-like desktops, so I don't know).







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 16 mins ago

























        answered 23 mins ago









        KusalanandaKusalananda

        150k18288474




        150k18288474






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f235373%2fwhy-useradd-m-doesnt-fill-created-home-dir-with-some-defaults%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

            Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

            Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...