The Complete Guide to “useradd” Command in Linux – 15 Practical Examples

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.95/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Ravi Saive

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

76 Responses

  1. Andrea says:

    The result does not match search criteria right?

    [[email protected] ~]# cat /etc/passwd | grep tecmint

    • Ravi Saive says:


      Yes, search criteria for user ‘tecmint’ was wrong, but thanks for pointing out, we’ve corrected in the writeup..

  2. Sree says:

    I am adding a user “sudo useradd test” in RHEL. I am getting “configuration error – unknown item ‘TMOUT=600;’ (notify administrator)”. But user is getting created. However when I try to login I am unable to login ad test. Any idea why so?

  3. Manuel Malagon says:

    I tried using ‘useradd,’ and no home folder was created, also, when trying to switch from ‘root’ to the new user created, I got the message “No directory, logging in with HOME=/.”

    It worked fine until I used ‘adduser’ instead of ‘useradd’. This way the /home/user1 folder was created, and I was able to switch from ‘root’ to ‘user1’ using ‘su – user1’ command.

    After all, ‘useradd’ and ‘adduser’ are not as similar as one would think.

    • Nitrofx says:

      Excellent suggestion. I had the exact same issue. This article needs to be modified to reflect this issue. The commands are not the same and they perform different functions.

  4. faiqkhan says:

    Very helping article sir please continuous to upload some information about permission on file

  5. Daniel says:

    Is it possible to have an account that has no shell, not a root account and it has sftp access by using winscp? I’m setting up a linux box with Litespeed so I would like to have a locked down account that only used for uploading and running the server service.

  6. James Tobin says:

    @Ravi Saive: I suggest you add the command to remove user

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *