Code Monkey home page Code Monkey logo

Comments (2)

dshoreman avatar dshoreman commented on May 7, 2024

Relevant flags from the man page:

   -b, --base-dir BASE_DIR
       The default base directory for the system if -d HOME_DIR is not specified.  
		BASE_DIR is concatenated with the account name to define the home directory.  
		If the -m option is not used, BASE_DIR must exist.

   -d, --home-dir HOME_DIR
       The new user will be created using HOME_DIR as the value for the user's login  
		directory. The default is to append the LOGIN name to BASE_DIR and use that  
		as the login directory name. The directory HOME_DIR does not have to exist  
		but will not be created if it is missing.

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

       By default, if this option is not specified and CREATE_HOME
        is not enabled, no home directories are created.

   -M, --no-create-home
       Do no create the user's home directory, even if the system wide  
		setting from /etc/login.defs (CREATE_HOME) is set to yes.

   -U, --user-group
       Create a group with the same name as the user, and add the user to this group.

       The default behavior (if the -g, -N, and -U options are not specified)
        is defined by the USERGROUPS_ENAB variable in /etc/login.defs.

   -N, --no-user-group
       Do not create a group with the same name as the user, but add  
		the user to the group specified by the -g option or by the  
		GROUP variable in /etc/default/useradd.

       The default behavior (if the -g, -N, and -U options are not specified)  
		is defined by the USERGROUPS_ENAB variable in /etc/login.defs.

from servidor.

dshoreman avatar dshoreman commented on May 7, 2024

The above flags are specific to useradd. For usermod, only the following flags apply:

   -d, --home HOME_DIR
       The user's new login directory.

       If the -m option is given, the contents of the current home directory
        will be moved to the new home directory, which is created if it does
        not already exist.

   -m, --move-home
       Move the content of the user's home directory to the new location.

       This option is only valid in combination with the -d (or --home) option.

       usermod will try to adapt the ownership of the files and to copy the modes,
        ACL and extended attributes, but manual changes might be needed afterwards.

from servidor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.