1
00:00:00,000 --> 00:00:01,080
Today I'm going to walk you through

2
00:00:01,080 --> 00:00:04,994
how to create, modify and delete groups in Linux.

3
00:00:04,994 --> 00:00:06,810
Groups allow us to grant access

4
00:00:06,810 --> 00:00:08,074
in a more efficient manner.

5
00:00:08,074 --> 00:00:09,900
Groups associate user accounts

6
00:00:09,900 --> 00:00:11,476
that have similar security requirements,

7
00:00:11,476 --> 00:00:14,233
and they also help simplify our task as administrators

8
00:00:14,233 --> 00:00:15,990
by allowing multiple users

9
00:00:15,990 --> 00:00:18,405
to be granted permissions to resources.

10
00:00:18,405 --> 00:00:21,150
So, in this example,

11
00:00:21,150 --> 00:00:23,742
we're going to imagine we have a organization

12
00:00:23,742 --> 00:00:27,030
that require us to have four different departments.

13
00:00:27,030 --> 00:00:30,150
We're going to use the graphics, sales, marketing,

14
00:00:30,150 --> 00:00:31,830
and finance departments.

15
00:00:31,830 --> 00:00:34,050
Okay, so let's go ahead and add the graphics department.

16
00:00:34,050 --> 00:00:38,230
So first, we're going to do sudo, going to do groupadd Graphic.

17
00:00:41,341 --> 00:00:43,323
It asks for my password here.

18
00:00:46,176 --> 00:00:47,790
All right.

19
00:00:47,790 --> 00:00:52,790
Now we can check the groups in the etc/group folder,

20
00:00:52,871 --> 00:00:54,153
or the group file.

21
00:00:55,440 --> 00:00:57,750
You can see graphics there at the bottom.

22
00:00:57,750 --> 00:01:00,021
Now, if we're going to go over the fields really quick,

23
00:01:00,021 --> 00:01:04,709
the group instance has four fields associated to each group.

24
00:01:04,709 --> 00:01:05,761
The group name,

25
00:01:05,761 --> 00:01:08,227
the next field is going to be the passwords,

26
00:01:08,227 --> 00:01:09,724
then the group ID,

27
00:01:09,724 --> 00:01:12,060
and the last will be a list of all the users

28
00:01:12,060 --> 00:01:13,500
that are part of that group.

29
00:01:13,500 --> 00:01:15,150
Now, currently the graphics is blank

30
00:01:15,150 --> 00:01:16,950
'cause we haven't added any users,

31
00:01:16,950 --> 00:01:18,600
but as we go throughout the example,

32
00:01:18,600 --> 00:01:20,520
we're going to come back after we added some users

33
00:01:20,520 --> 00:01:22,710
and we're going to see it populate there.

34
00:01:22,710 --> 00:01:24,870
All right. Let's clear this out.

35
00:01:24,870 --> 00:01:26,970
And we go ahead add the other departments.

36
00:01:28,260 --> 00:01:31,263
Go ahead and scroll up, use the (indistinct) first.

37
00:01:32,340 --> 00:01:34,203
We're going to do sales department,

38
00:01:36,540 --> 00:01:38,830
then do marketing department

39
00:01:45,476 --> 00:01:47,559
and then finally finance.

40
00:01:50,700 --> 00:01:51,533
Boom.

41
00:01:52,470 --> 00:01:54,570
Alright, again, we're going to go and check and make sure

42
00:01:54,570 --> 00:01:56,870
those groups were added on the etc/group file.

43
00:01:59,010 --> 00:02:01,022
All right, boom. We see 'em at the bottom there.

44
00:02:01,022 --> 00:02:03,690
Next we're going to go over modifying the group.

45
00:02:03,690 --> 00:02:06,840
Now, if you see I've named all the other departments,

46
00:02:06,840 --> 00:02:09,539
sales department, marketing department, finance department.

47
00:02:09,539 --> 00:02:10,740
But graphics just doesn't match.

48
00:02:10,740 --> 00:02:13,380
So to keep the scheme the same

49
00:02:13,380 --> 00:02:14,883
we're going to modify this group.

50
00:02:16,560 --> 00:02:21,240
Sudo group, mod,

51
00:02:21,240 --> 00:02:22,893
use the N option,

52
00:02:23,760 --> 00:02:26,870
and we're going to change the name first

53
00:02:26,870 --> 00:02:30,153
to the graphics department.

54
00:02:32,550 --> 00:02:34,860
And then we're going to point to the actual group

55
00:02:34,860 --> 00:02:36,260
that we're trying to change.

56
00:02:40,290 --> 00:02:41,322
All right.

57
00:02:41,322 --> 00:02:42,705
So we see we've changed the graphics department.

58
00:02:42,705 --> 00:02:44,940
We see that at the bottom there.

59
00:02:44,940 --> 00:02:45,773
Next, what we're going to do

60
00:02:45,773 --> 00:02:48,540
is we're going to add users to the groups.

61
00:02:48,540 --> 00:02:49,825
Now for this example,

62
00:02:49,825 --> 00:02:54,660
and to add users, we're going use the user mod command.

63
00:02:54,660 --> 00:02:59,093
We're going to use sudo, user mod,

64
00:02:59,093 --> 00:03:02,866
and for the option, we're going to do append group.

65
00:03:02,866 --> 00:03:06,960
And so we're going to use myself,

66
00:03:06,960 --> 00:03:10,323
and we're going to add me to the graphics department.

67
00:03:15,990 --> 00:03:18,570
All right, let's see if that went through there.

68
00:03:18,570 --> 00:03:20,280
Now you see at the bottom, J Kelly,

69
00:03:20,280 --> 00:03:22,110
is part of now the graphics department.

70
00:03:22,110 --> 00:03:24,558
So we're going to use the other users again

71
00:03:24,558 --> 00:03:27,453
to see which users we have from the password file.

72
00:03:28,770 --> 00:03:33,390
And so we're going to add Anderson, Mason, and Riley.

73
00:03:33,390 --> 00:03:34,980
We're going to add them to different groups,

74
00:03:34,980 --> 00:03:36,230
just for little practice.

75
00:03:40,622 --> 00:03:42,330
I don't want to type them all the way out.

76
00:03:42,330 --> 00:03:45,643
So we're going to do C. Mason there.

77
00:03:55,170 --> 00:03:56,003
Marketing.

78
00:04:03,000 --> 00:04:04,517
We're going to do (indistinct).

79
00:04:10,290 --> 00:04:11,123
A. Riley.

80
00:04:12,180 --> 00:04:13,477
All right.

81
00:04:13,477 --> 00:04:15,928
I was going to verify that we have everything taken care of.

82
00:04:15,928 --> 00:04:18,990
All right, simple as that.

83
00:04:18,990 --> 00:04:21,690
We see we added C. Mason to the sales department,

84
00:04:21,690 --> 00:04:23,484
M. Anderson to the marketing department,

85
00:04:23,484 --> 00:04:25,590
A. Riley to the finance department,

86
00:04:25,590 --> 00:04:28,833
And again, I, Jamario Kelly, am in the graphics department.

87
00:04:28,833 --> 00:04:31,620
And similar to modifying user accounts,

88
00:04:31,620 --> 00:04:33,360
we can delete groups.

89
00:04:33,360 --> 00:04:34,920
Simply to delete a group,

90
00:04:34,920 --> 00:04:36,770
we're going to use the sales department.

91
00:04:38,070 --> 00:04:41,160
And again, it's kind of like user mod or user delete

92
00:04:41,160 --> 00:04:43,506
but instead it's going to be group delete.

93
00:04:43,506 --> 00:04:44,460
We're going to use sales department.

94
00:04:44,460 --> 00:04:48,900
Now, deleting the group does not delete the members

95
00:04:48,900 --> 00:04:49,917
that are in the group.

96
00:04:49,917 --> 00:04:54,917
And we can verify this by going back to the etc.

97
00:04:55,440 --> 00:04:56,313
So let's see.

98
00:05:04,080 --> 00:05:05,253
Etc/group.

99
00:05:08,070 --> 00:05:09,870
We see the sales department is gone.

100
00:05:12,330 --> 00:05:15,000
And I believe we had C. Mason in the group

101
00:05:15,000 --> 00:05:16,050
for the sales department.

102
00:05:16,050 --> 00:05:19,140
So let's check and see if C. Mason's still out there.

103
00:05:19,140 --> 00:05:23,553
So we go to etc file, go to cat/etc. Password.

104
00:05:27,420 --> 00:05:30,810
And we see C. Mason is still an active user.

105
00:05:30,810 --> 00:05:33,150
So deleting the group did not delete the users

106
00:05:33,150 --> 00:05:34,740
that was associated to the group.

107
00:05:34,740 --> 00:05:35,846
So that's good to go there.

108
00:05:35,846 --> 00:05:37,890
All right, that was quick and easy.

109
00:05:37,890 --> 00:05:42,537
We went over how to create, modify and delete groups.

110
00:05:42,537 --> 00:05:45,063
And I'll see you again in the next lesson.

