DEV Community

Cover image for How to add a new user in Linux?
MELVIN GEORGE
MELVIN GEORGE

Posted on • Originally published at melvingeorge.me

How to add a new user in Linux?

Originally posted here!

To add a new user in Linux, you can use the adduser command followed by a space and your name for the user in Linux.

For example, let's say you want to create a new user called john, you can use the adduser command like this,

# Add a new user
sudo adduser john
Enter fullscreen mode Exit fullscreen mode
  • Sometimes you may need to use the sudo command before the adduser command to obtain the correct privileges to execute the command.

After executing the adduser command, you may need to add a password for the user you just created, to do that see How to create a password for a user in Linux?.

Try executing the above command in this online terminal to see the result.

Feel free to share if you found this useful 😃.


Top comments (0)