From the course: CompTIA Linux (XK0-005) Cert Prep
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Elevate group privileges - Linux Tutorial
From the course: CompTIA Linux (XK0-005) Cert Prep
Elevate group privileges
- [Instructor] We've seen that we can switch users if we have that user's password using the su command. This isn't always ideal. A nicer solution is to change to a different primary group. By doing so, we gain the privileges of the group as opposed to the user. We can do this using the new group command. Let's create a new group by typing in sudo groupadd accounting, and hit Enter. And enter your password if prompted. Now let's add a password to our group by typing in sudo gpasswd accounting, and hit Enter. Type in the desired group password when prompted. We can verify that this worked by viewing the /etc/gshadow file. Type in sudo cat /etc/gshadow, and hit Enter. We can see that the accounting group has a password. Now as user1, let's switch primary groups by using the new group command. Type in newgrp accounting and hit Enter, and enter the accounting group's password. We can now verify our primary group by…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
User and group overview3m 47s
-
(Locked)
User account file5m 39s
-
(Locked)
User password file4m 49s
-
(Locked)
Group accounts and passwords3m 31s
-
(Locked)
Create and delete users5m 26s
-
(Locked)
Modify user accounts4m 4s
-
(Locked)
Create and delete groups4m 7s
-
(Locked)
Assign users to groups2m 33s
-
(Locked)
Become a super user5m 49s
-
(Locked)
Elevate group privileges4m
-
(Locked)
Elevate privileges using sudo3m 21s
-
(Locked)
Manage sudo users5m
-
-
-
-
-
-
-
-
-
-
-
-
-
-