Skip to content

How to add users in Linux…

… using only the console.

For the 2 years and a half (wow, time does fly…) I’ve been running Wiki4games on a dedicated server, I’ve always been a bit lazy about learning command line. Sure, I’ve been using it. Sure, I’ve written a few bash maintenance scripts. But still, I’ve mainly been using Webmin. As a matter of fact I’ve been using it whenever it was possible. But recently I rented another server, for testing, and found out that sometimes typing a few commands is actually faster than installing Webmin and then browsing around it.

And here comes today’s topic: how to create a user just with the command line:

  1. login as root, obviously (or sudo things): su
  2. create the user: useradd [name of the new user]
  3. set its password: passwd [name of the new user]
  4. create its home directory: mkdir /home/[name of the new user]
  5. give the user its home directory: chown [name of the new user] /home/[name of the new user]

Tada, you’re done already 🙂

Posted in Linux.

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

or, reply to this post via trackback.

Sorry about the CAPTCHA that requires JS. If you really don't want to enable JS and still want to comment, you can send me your comment via e-mail and I'll post it for you.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA