Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In order to automatically create domains/subdomains I need to add the user. ex.

useradd -gpsacln -p$1$salt1234$bTARrDtiFtJF9wDZzDFx00 -M demodelete

The user is added without problem. BUT the home directory is still being created. I won't use the home/directory for any of the site files so I prefer they are not generated automatically.

What am I doing wrong?

share|improve this question

migrated from stackoverflow.com Nov 6 '11 at 9:12

This question came from our site for professional and enthusiast programmers.

    
Try it without the -M, according to the man page -m tells useradd to create the home directory, and there is no option for -M. Which distro are you running? –  d34dh0r53 Nov 6 '11 at 9:23

1 Answer 1

I suspect it's because you didn't quote the password field, so part of that is being interpreted as shell variables (i.e. $1, $s, $b), which are introducing spaces and breaking your command line.

Try quoting the value of the -p option:

useradd -gpsacln -p'$1$salt1234$bTARrDtiFtJF9wDZzDFx00' -M demodelete

Be sure to use single quotes, not double quotes, since shell variables are still interpolated within double quotes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.