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

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

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

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/

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

This command will print the version details of the adduser command.
6. To display the help section of the adduser command
adduser -h

This command will display the help section of the adduser command.
Learn to code easily with our course
Coding for Everyone. This course is accessible and designed for everyone, even if you're new to coding. Start today and join millions on a journey to improve your skills!Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore.
Last Updated :
22 Jun, 2020
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...