Specifically, what commands do I run from the terminal?
Asked
Active
Viewed 7.6k times
61
-
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
-
2Feel 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
133
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
- 29,586
- 38
- 176
- 304
quackingduck
- 5,597
- 5
- 27
- 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
31
Here's the command I almost always use (adding user kevin):
useradd -d /home/kevin -s /bin/bash -m kevin
Dave Jarvis
- 29,586
- 38
- 176
- 304
Liberty
- 311
- 1
- 4
- 2
15
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
- 3,897
- 4
- 25
- 20