Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to add new user to existing directory. The goal is to create new vsftpd account on Debian.

Here is what I try:

useradd --base-dir path/to/dir new_username

it returns

Usage: useradd [options] LOGIN

What I miss ?

share|improve this question

migrated from Sep 7 '11 at 10:01

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

BTW, when you say "add user to existing directory", do you want the user's home dir to be /path/to/dir or /path/to/dir/new_user? --base-dir will do the latter. – Shawn Chin Sep 7 '11 at 12:56

Older versions of useradd only allows the use of --basedir (-b) with the -D flag.

If you cannot updated your version of useradd, try using that flag in conjunction with -D.

useradd -D -b /some/path # first update defaults
useradd new_user # then add user


Looking at the source history for useradd.c (pkg-shadow) confirms that older versions of useradd would only allow -b with the -D option. That was reported as a bug (on passwd) and has since been fixed.

Based on the tag history and revision numbers, my guess is that fix would be in pkg-shadow >= 4.1.0. What version do you have?

share|improve this answer

sudo useradd -b /home/myuser temp works for me. Is your path/to/dir valid?

share|improve this answer
Yes, a valid... – jingo Sep 7 '11 at 8:27

Most likely, you got a space somewhere in the base directory path. Also, it must be absolute (start with a slash). Try

useradd --basedir '/path/to/my dir' new_username
share|improve this answer
I double check that. Everything looks fine. – jingo Sep 7 '11 at 8:29

Your Answer


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