无法在 /mnt 中创建用户主目录

无法在 /mnt 中创建用户主目录

我想创建一个用户主页/mnt但是useradd它没有创建。

useradd user -d /mnt/home/user -s /bin/shell

有什么建议么?

答案1

man useradd

       -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-directory)选项:

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

相关内容