Add new user in Ubuntu Linux using Terminal Command


If you want to add a new user in Ubuntu Linux, you can make use of the adduser command followed by the new user name,

Example:

root@ubuntu:/# adduser newuser

Adding user `newuser' ...

Adding new group `newuser' (1001) ...

Adding new user `newuser' (1001) with group `newuser' ...

Creating home directory `/home/newuser' ...

Copying files from `/etc/skel' ...

New password: 

Retype new password: 

passwd: password updated successfully

Changing the user information for newuser

Enter the new value, or press ENTER for the default
	Full Name []: John
	Room Number []: 2022
	Work Phone []: 000
	Home Phone []: 000
	Other []: 

Is the information correct? [Y/n] Y

To move to the newly created user simply do su newuser


Make sure you are either using a root user or sudo along with this command or else you will get an error - adduser: Only root may add a user or group to the system.

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap