Linux Adduser and Groupadd

Actually this tutorial is a simple tutorial that many people probably already know, but I created this tutorial is not for a Senior Linux users or Linux users who are experts, but for those users who are new to linux like me.
linux groupadd,linux adduser,linux useradd,linux add user,add user to group linux
Okay let's get started, do you already know how to add a user and group on linux? If you do not know him, let's discuss together. Before you run this command, you must be logged in as a super user. Use the command sudo su, and enter your password.
$ Sudo su
password: ****
The display of the terminal is not using $ but now use #.

Linux Groupadd
To add a new group on linux you can use the command groupadd,
# Groupadd <group_name>
Linux groupadd example
Suppose you want to create a new group with the name newgroup then run the following command:
# Groupadd newgroup
Remember all commands are Case Sensitive (Big and small letters are considered different)

Show Groups Linux
To see a group that was created along with its members can be found by typing the command:
$ Cat/etc/group

Linux Adduser
To add a user account on linux run the command
# Adduser <user_name>
Linux useradd example:
# Adduser newuser
# Passwd ****
The above command will create newuser account and are in the directory /home/newuser/

Add User to Group Linux
If we want to create a new user and then want to insert a new user into an existing group, eg mygroup then use the following command:
# Useradd-g newuser newgroup

Once you already know how to add users and groups on Linux, you'll want to know how to remove users and groups in linux? To find out how to remove it please click the following link: Linux remove user and group.

Related post :

No comments :