How do I add a user in Ubuntu?

LinuxUbuntuSysadminUser Management

Linux Problem Overview


Specifically, what commands do I run from the terminal?

Linux Solutions


Solution 1 - Linux

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

Solution 2 - Linux

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

useradd -d /home/kevin -s /bin/bash -m kevin

Solution 3 - Linux

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionquackingduckView Question on Stackoverflow
Solution 1 - LinuxquackingduckView Answer on Stackoverflow
Solution 2 - LinuxLibertyView Answer on Stackoverflow
Solution 3 - LinuxskinpView Answer on Stackoverflow