Specifically, what commands do I run from the terminal?
Asked
Active
Viewed 7.8k times
68

Konrad Borowski
- 11,584
- 3
- 57
- 71

quackingduck
- 5,845
- 5
- 29
- 22
-
Aside from the fact that it seems to be a badge grab, why is this getting voted down so hard? – jfm3 Sep 17 '08 at 20:29
-
Probably because it is a really simple question. A quick search in google would give the answer. – givanse Sep 22 '08 at 02:42
-
1Google is your friend. Also, this belongs on ServerFault. – Matt Fichman Sep 22 '09 at 20:46
-
3Feel free to add it there. The question predates ServerFault. – quackingduck Sep 23 '09 at 11:17
-
1I don't have anything against this question, I'm just moving it to the more appropriate SE. – Andrew Grimm Mar 07 '11 at 04:32
3 Answers
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