68

Specifically, what commands do I run from the terminal?

Konrad Borowski
  • 11,584
  • 3
  • 57
  • 71
quackingduck
  • 5,845
  • 5
  • 29
  • 22

3 Answers3

140

Without a home directory

sudo useradd myuser

With home directory

sudo useradd -m myuser

Then set the password

sudo passwd myuser

Then set the shell

sudo usermod -s /bin/bash myuser
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
quackingduck
  • 5,845
  • 5
  • 29
  • 22
  • unfortunately, I indeed follow this to add a user, and then get the error 'Access denied' when I try to sign in with it. What's wrong with it? – Brady Zhu Sep 17 '13 at 06:03
34

Here's the command I almost always use (adding user kevin):

useradd -d /home/kevin -s /bin/bash -m kevin
Dave Jarvis
  • 30,436
  • 41
  • 178
  • 315
Liberty
  • 341
  • 1
  • 4
  • 2
17

There's basicly 2 commands to do this...

  • useradd
  • adduser (which is a frendlier front end to useradd)

You have to run them has root. Just read their manuals to find out how to use them.

skinp
  • 4,157
  • 4
  • 27
  • 20