Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Shell Scripting
  • Kali Linux
  • Ubuntu
  • Red Hat
  • CentOS
  • Docker in Linux
  • Kubernetes in Linux
  • Linux interview question
  • Python
  • R
  • Java
  • C
  • C++
  • JavaScript
  • DSA
Open In App
Next Article:
addgroup command in Linux with Examples
Next article icon

adduser command in Linux with Examples

Last Updated : 19 Jul, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

adduser

command in Linux is used to add a new user to your current Linux machine. This command allows you to modify the configurations of the user which is to be created. It is similar to the

useradd

command in Linux. The adduser command is much interactive as compared to useradd command.

Installing adduser command

To install

adduser

tool use the following commands as per your Linux distribution.

In case of Debian/Ubuntu

$sudo apt-get install adduser

In case of CentOS/RedHat

$sudo yum install adduser

In case of Fedora OS

$sudo dnf install adduser

Working with adduser command

1.

To add a new user

adduser username

To-add-a-new-user

This command will add a new user to your Linux system. It will ask for some details and after entering those details a new user account would be created.

2.

To add a user with a different shell.

sudo adduser username --shell /bin/sh

To-add-a-user-with-a-different-shell

This command will change the default shell for the new user to /bin/sh.

3.

To add a new user with a different configuration file.

adduser username --conf custom_config.conf

To-add-a-new-user-with-a-different-configuration-file

This command will take the configurations from the custom_config file and will create the new as per custom_config filename configurations.

4.

To add a user with different home directory.

adduser username --home /home/manav/

To-add-a-user-with-different-home-directory

This command will add the new user with /home/manav as the default directory.

5.

To get the version of the adduser command.

adduser --version

To-get-the-version-of-the-adduser-command

This command will print the version details of the adduser command.

6.

To display the help section of the adduser command

adduser -h

To-display-the-help-section-of-the-adduser-command

This command will display the help section of the adduser command.



Next Article
addgroup command in Linux with Examples
author
manav014
Improve
Article Tags :
  • Linux-Unix
  • Technical Scripter
  • linux-command

Similar Reads

  • as command in linux with examples
    as command is the portable GNU assembler in Linux. Using as command, we can read and assemble a source file. The main purpose of 'as' is to assemble the output of the GNU compiler of the C language.as command reads and assembles the .s File. Also, whenever you do not specify the file, it normally re
    3 min read
  • ar command in Linux with examples
    The 'ar' command in Linux is a versatile tool used for creating, modifying, and extracting files from archives. An archive is essentially a collection of files bundled together in a specific structure, making it easy to manage multiple files as a single entity. Each file within the archive is referr
    5 min read
  • case command in Linux with examples
    The case command in Linux is an essential tool for simplifying script logic, especially when multiple if/elif conditions need to be evaluated for a single variable. It offers a more readable and efficient way to execute commands based on pattern matching, making your shell scripts easier to maintain
    2 min read
  • addgroup command in Linux with Examples
    The add group command in Linux adds a new group to your current machine and allows you to modify its configuration. It is similar to the groupadd command, but it is more interactive and user-friendly. Syntaxsudo addgroup [ options ] groupnameInstalling the addgroup CommandIf the addgroup tool is not
    3 min read
  • aspell command in Linux with examples
    aspell command is used as a spell checker in Linux. Generally, it will scan the given files or anything from standard input then it check for misspellings. Finally, it allows the user to correct the words interactively. Spell checking is crucial when working with large documents, coding, or writing
    3 min read
  • amixer command in Linux with Examples
    amixer is a command-line mixer for ALSA(Advanced Linux Sound Architecture) sound-card driver . amixer can support multiple soundcards. amixer with no arguments will display the current mixer settings for the default soundcard as well as the device. This is a good way to see a list of the simple mixe
    2 min read
  • banner command in Linux with examples
    The 'banner' command in Linux is a simple yet powerful utility used to display text in large ASCII characters on the terminal. This command can be particularly useful for creating prominent messages or headings within scripts and outputs. Syntax of the 'banner' Commandbanner textbanner 'Command' Exa
    3 min read
  • addr2line command in Linux with Examples
    'addr2line' command in Linux is used to convert addresses into file names and line numbers. When the executable files/object files are run with the 'objdump' command, the file is de-assembled and the machine code is displayed. These machine instructions for the executable are displayed along with th
    4 min read
  • apt command in linux with examples
    apt provides a high-level Command Line Interface (CLI) for the APT package management system, offering a user-friendly interface intended for interactive use. It simplifies common tasks like installation, upgrades, and removal, with better defaults than more specialized tools like apt-get and apt-ca
    5 min read
  • aptitude command in Linux with examples
    The aptitude command in Linux provides a user-friendly interface to interact with the machine's package manager. It functions similarly to a control panel, like in Windows, allowing you to install, upgrade, and remove packages. The command can be used in either a visual interface or directly via the
    5 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences