LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   urgent (https://www.linuxquestions.org/questions/linux-newbie-8/urgent-828982/)

hillolnayak 08-28-2010 05:56 AM

urgent
 
Hi!

how to create the user without creating home directory?

Hillol Nayak

EricTRA 08-28-2010 06:03 AM

Hello and Welcome to LinuxQuestions,

Please don't use words like 'urgent' in your thread title or in your text. We're all volunteers here on LQ and it's only urgent to you. Change your thread title into something more descriptive so that we instantly know what it's about.

In regards to your question, AFAIK the command useradd doesn't create a home directory if you don't provide the parameter -d or --home. So you just use the command without that parameter and the user will be created without a home directory.

For more detail you can always read the man page:
Code:

man useradd
Kind regards,

Eric

druuna 08-28-2010 06:05 AM

Hi,

In addition to EricTRA's reply: useradd will not create the home dir by default. Do not use the -m option either.

Regards.

tronayne 08-28-2010 06:09 AM

See man useradd, the -M option in particular (but do read the entire man page!).

druuna 08-28-2010 06:14 AM

@tronayne: That should be -m, not -M ;) (This depends on the useradd version that is available on your machine, see post #6)

EricTRA 08-28-2010 06:26 AM

Hi druuna,

Don't want to go against you but I think there might be some differences in the versions of useradd used. In the man page of useradd I have on my Slackware 13.1 is also mentioning of the -M
Code:

-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, no home directories are created.

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

Kind regards,

Eric

druuna 08-28-2010 06:49 AM

@EricTRA / tronayne:

I did look at the manpage and it does not mention the -M option. As stated by you: Other versions do seem to mention it.

So: check the manpage to make sure.

Kenny_Strawn 08-28-2010 05:29 PM

To the OP: http://www.linuxquestions.org/questi....php?p=4080801


All times are GMT -5. The time now is 02:38 PM.