Compare the Difference Between Similar Terms

Difference Between

Home / Technology / IT / Operating System / Difference Between Adduser and Useradd

Difference Between Adduser and Useradd

January 10, 2018 Posted by Lithmee

Key Difference – Adduser vs Useradd
 

An operating system is used to give instructions to hardware. Linux is an operating system. It is a clone of UNIX. The main advantage of  Linux is that programmers can build their own operating systems using the Kernel. Some widely used Linux distributions are Ubuntu, Fedora and Debian. The most frequently done tasks of the computer are browsing, creating, moving and deleting files. There are two methods to handle files efficiently. That is by using the Command Line Interface (CLI) or by using the Graphical User Interface (GUI). Using CLI is better in Linux because it is flexible and fast. Commands are given using the CLI and Linux contains a terminal to give commands. There is a large number of commands. The commands, adduser and useradd are for the user management. The key difference between adduser and useradd is that adduser is used to add users with setting up account’s home folder and other settings while useradd is a low-level utility command to add users. This article discusses the difference between these two commands.

CONTENTS

1. Overview and Key Difference
2. What is Adduser
3. What is Useradd
4. Similarities Between Adduser and Useradd
5. Side by Side Comparison – Adduser vs Useradd in Tabular Form
6. Summary

 What is Adduser?

Data can be changed or stolen. Therefore, it is vital to keep data secured. Security is the main concern in Linux. It is a multi-user operating system.  So there are authorisation levels in Linux. Every file in Linux or Unix has a user. There are three types of users in Linux. They are a user, group and other. ‘User’ is the owner of the file. By default, the user who creates the file becomes the user. ‘Group’ can contain multiple users. All users in the group have the same file permissions. It is possible to add many users to the group and assign group permissions. ‘Other’ doesn’t create the file, but they have access to the file.

In this way, the files are kept separately from each user. The users can read, write and execute. Read permission list the content. Write permission allows modifying the content. In Linux or Unix, it cannot run a program without the execute permission.

The adduser command is used to add users according to the command line options and configuration information. The command syntax is  $ command  – options arguments. There are some options with the adduser . The -h or –help is to print help screen. The –system is used to setup system users. The  –group is used to add a new group.

Difference Between Adduser and Useradd

Figure 01: The adduser Command

Below shows the way of creating a new user using the command adduser. The name of the user is user_1. A normal user cannot add another user. It should run the commands as a super-user to add a user. Therefore, it should use “sudo”.

Difference Between Adduser and Useradd _Figure 02

Figure 02: Adding a user called user_1 with adduser command

Difference Between Adduser and Useradd_Figure 03

Figure 03: user_1 is created.

By viewing the content in the /etc/passwd , can view the user_1 details.

What is Useradd?

The command useradd is also used to add users. It comes with some flags.  Some of them are as follows.

-D        Defaults

-m        Creates a home directory

-s         Defines the shell for the user

-e         Date on which the user account will be disabled

-b         Base directory for the home directory of the user

-u         UID

-g         Initial group number

-G        Additional groups by name

-c         Comment

Difference Between Adduser and Useradd_Figure 04

Figure 04: Default

An example of adding a user is as follows,

Key Difference Between Adduser and Useradd

Figure 05: Creating user_2 with useradd command

Adding a new user cannot be done as a normal user. Therefore, it should use “sudo” for super user. The flag -m is used to create the user folder in home directory. “-s” is used to define the shell. “-g” is for the group and “-c” is for comments. After going to the home directory, user_2 will be created.

 What are the Similarities Between Adduser and Useradd?

  • Both are Linux commands.
  • Both can be used to create users.

What is the Difference Between Adduser and Useradd?

Adduser vs Useradd

Adduser is the command to add users to the system according to the command line options and configuration information in /etc/adduser.conf. Useradd is a low-level utility for adding users.
 Features
The command adduser creates the user and sets up the account’s home folders and other settings. The command useradd just creates the user.
Directory Creation
The command adduser creates a user directory in the home (/home/user ) automatically. The command useradd does not create a user directory in the home, if not specified with -m.
 Syntax Complexity
The command syntax for adduser is not complicated like in useradd. The useradd command has some complexity.

Summary – Adduser vs Useradd

Linux is popular among large organisations as well as among regular computer users. It is also used for server environments because of the reliability and stability. The user can give commands using Command Line Interface to perform various tasks. Two major commands for user management are adduser and useradd. The difference between adduser and useradd is that adduser is used to add users with setting up account’s home folder and other settings while useradd is a low-level utility command to add users.

Download the PDF Adduser vs Useradd

You can download PDF version of this article and use it for offline purposes as per citation note. Please download PDF version here Difference Between Adduser and Useradd

Reference:

1.ProgrammingKnowledge. Linux Command Line Tutorial For Beginners 22 – useradd command (Creating Users), ProgrammingKnowledge, 28 Dec. 2016. Available here
2.guru99com. Terminal V/s GUI – Linux Tutorial 4, Guru99, 26 Dec. 2012. Available here
3.hammadshams. Linux, creating a user in Linux, 1e4, Hammadshams, 23 June 2012. Available here 
4.Linux adduser command summary with examples, FactorPad, 10 Nov. 2016. Available here

Related posts:

Difference Between Apple iOS 4.2 and Apple iOS 4.3 Beta Difference Between 32 bit and 64 bit Windows 7 Difference Between Gnome and KDE Difference Between Paging and Segmentation Difference Between VirtualBox and VMware and Parallels

Filed Under: Operating System Tagged With: Adduser, Adduser and Useradd Differences, Adduser and Useradd Similarities, Adduser Definition, Adduser Directory Creation, Adduser Features, Adduser Function, Adduser Syntax, Adduser vs Useradd, Compare Adduser and Useradd, Useradd, Useradd Definition, Useradd Directory creation, Useradd Features, Useradd Function, Useradd Syntax

About the Author: Lithmee

Lithmee Mandula is a BEng (Hons) graduate in Computer Systems Engineering. She is currently pursuing a Master’s Degree in Computer Science. Her areas of interests in writing and research include programming, data science, and computer systems.

Leave a Reply Cancel reply

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

Request Article

Featured Posts

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and SARS

Difference Between Coronavirus and SARS

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Covid 19

Difference Between Coronavirus and Covid 19

You May Like

Difference Between Cocaine and Heroin

Difference Between Cocaine and Heroin

Difference Between Electronegativity and Ionization Energy

Difference Between Electronegativity and Ionization Energy

Difference Between Encoding and Decoding

What is the Difference Between Hematoma and Morel Lavallée Lesion

What is the Difference Between Hematoma and Morel Lavallée Lesion

Difference Between Weaver and Picatinny

Latest Posts

  • What is the Difference Between Flat White and Cortado
  • What is the Difference Between Tack Coat and Prime Coat
  • What is the Difference Between Clogged Tear Duct and Pink Eye
  • What is the Difference Between Acute and Chronic Respiratory Acidosis
  • What is the Difference Between Rigidity and Spasticity
  • What is the Difference Between Pomeranian and Indian Spitz
  • Home
  • Vacancies
  • About
  • Request Article
  • Contact Us

Copyright © 2010-2018 Difference Between. All rights reserved. Terms of Use and Privacy Policy: Legal.