Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

This is a quick one that I cant figure out. Does usermod actually create a new user if the user specified doesn't already exist?

Here is an example: usermod -s /bin/false $1

If user "tom" doesn't exist already, will he be created, or would I need a command like "adduser" first?

share|improve this question
up vote 1 down vote accepted

Short answer:

# usermod -s /bin/false xyz
usermod: user 'xyz' does not exist

man usermod tells you that this is to modify user accounts, hence you'll need an existing one.

       usermod - modify a user account

If you like to create a user with some specific shell in one shot use -s switch with useradd:

# useradd -s /bin/false _username_
share|improve this answer
Thank you for the reply. Is there a way to combine adding a new user and setting them to shell bin/false in a single command? – James Willson Sep 30 '12 at 21:11
@JamesWillson: Try man useradd, note how similar it is to man usermod. :) – Tom Wijsman Sep 30 '12 at 21:12
Should I be doing this? "useradd -s /bin/false tom" – James Willson Sep 30 '12 at 21:13
@JamesWillson: That should work. – Tom Wijsman Sep 30 '12 at 21:13
Superb, thank you. I have to wait 8 mins to accept the answer. – James Willson Sep 30 '12 at 21:13

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.