1
00:00:00,480 --> 00:00:02,100
In this demonstration, we're going to go over how

2
00:00:02,100 --> 00:00:04,920
to modify file and directory ownership.

3
00:00:04,920 --> 00:00:05,753
Now, first

4
00:00:05,753 --> 00:00:07,590
for a little review we're just going to view

5
00:00:07,590 --> 00:00:10,410
the permissions

6
00:00:10,410 --> 00:00:14,103
and ownership of a file that's commonly used.

7
00:00:16,680 --> 00:00:17,913
Log Cron file.

8
00:00:19,009 --> 00:00:21,660
We can see this is owned by the root.

9
00:00:21,660 --> 00:00:22,860
The group is also root.

10
00:00:22,860 --> 00:00:25,173
That's the default way of creating files.

11
00:00:26,730 --> 00:00:28,503
Now let's look at another user.

12
00:00:29,700 --> 00:00:30,720
Look at the contents

13
00:00:30,720 --> 00:00:32,980
of a testuser's file

14
00:00:34,110 --> 00:00:35,223
that created earlier.

15
00:00:37,290 --> 00:00:39,313
Now we use sudo since that's not

16
00:00:41,475 --> 00:00:43,710
wait (indistinct)

17
00:00:43,710 --> 00:00:46,230
So now we can see that testuser owns

18
00:00:46,230 --> 00:00:48,780
and it's the group of these files.

19
00:00:48,780 --> 00:00:52,140
Now we're going to make a shared directory.

20
00:00:52,140 --> 00:00:54,540
We're put it in the root folder,

21
00:00:54,540 --> 00:00:56,073
make directory here.

22
00:00:56,910 --> 00:00:59,370
Use an example over our Legal department.

23
00:00:59,370 --> 00:01:01,203
We'll change to that directory.

24
00:01:06,750 --> 00:01:08,433
Create a test file.

25
00:01:17,742 --> 00:01:19,260
Oh!

26
00:01:19,260 --> 00:01:20,570
sudo

27
00:01:20,570 --> 00:01:21,403
here.

28
00:01:22,290 --> 00:01:23,340
And now we see the files.

29
00:01:23,340 --> 00:01:24,273
So are created.

30
00:01:30,690 --> 00:01:32,610
Just remember whenever there's an issue

31
00:01:32,610 --> 00:01:36,000
with permissions and you enter the sudo password

32
00:01:36,000 --> 00:01:38,520
just do sudo exclamation point, exclamation point

33
00:01:38,520 --> 00:01:41,429
and it's going to execute the last command.

34
00:01:41,429 --> 00:01:42,262
All right.

35
00:01:42,262 --> 00:01:44,880
So we see we created a legal directory

36
00:01:44,880 --> 00:01:46,740
and we added three files to it.

37
00:01:46,740 --> 00:01:49,350
Now you see we use the sudo command

38
00:01:49,350 --> 00:01:51,630
in creative file, the owner's going to be the root

39
00:01:51,630 --> 00:01:53,880
and the group is also going to be the root.

40
00:01:53,880 --> 00:01:56,280
next we're going to change the owner

41
00:01:56,280 --> 00:01:57,930
of the hard directory

42
00:01:57,930 --> 00:02:00,993
and do sudo change mod,

43
00:02:03,480 --> 00:02:07,050
All right! here change the permissions.

44
00:02:07,050 --> 00:02:08,550
So the dash R means recursively.

45
00:02:08,550 --> 00:02:10,919
So that means we're going to do all the contents

46
00:02:10,919 --> 00:02:13,150
of this particular directory

47
00:02:14,310 --> 00:02:15,143
do

48
00:02:16,740 --> 00:02:17,573
here

49
00:02:20,550 --> 00:02:21,903
And now if we list this up we'll see

50
00:02:21,903 --> 00:02:24,600
that the permissions have changed.

51
00:02:24,600 --> 00:02:28,200
The asterisk mean the current director that you are in,

52
00:02:28,200 --> 00:02:31,470
it will recursively execute that command on every file

53
00:02:31,470 --> 00:02:34,173
or directory in the current present working directory.

54
00:02:36,780 --> 00:02:38,290
We're going to add a group here

55
00:02:41,460 --> 00:02:42,610
include as a lead group

56
00:02:44,700 --> 00:02:45,993
with Legal department.

57
00:02:47,460 --> 00:02:49,650
we're going to associate the legals department ownership

58
00:02:49,650 --> 00:02:51,150
to this folder.

59
00:02:51,150 --> 00:02:51,990
There's two ways to do

60
00:02:51,990 --> 00:02:55,607
this You can do the sudo change own cursor,

61
00:02:57,450 --> 00:03:00,750
Recursive we want to do an entire directory.

62
00:03:00,750 --> 00:03:03,753
Now when you put the colon first,

63
00:03:04,860 --> 00:03:05,693
that just means

64
00:03:05,693 --> 00:03:08,700
that we're only going to change the ownership of the group.

65
00:03:08,700 --> 00:03:11,430
Now, if you have a username before the colon

66
00:03:11,430 --> 00:03:13,650
that's going to change the ownership.

67
00:03:13,650 --> 00:03:15,180
That's what we're going to give the permissions

68
00:03:15,180 --> 00:03:16,860
of the Legal department.

69
00:03:16,860 --> 00:03:17,850
And since I'm currently

70
00:03:17,850 --> 00:03:19,080
in this folder we're just going to do

71
00:03:19,080 --> 00:03:22,350
to list ld option.

72
00:03:22,350 --> 00:03:24,540
which lets you view the permissions

73
00:03:24,540 --> 00:03:26,340
of the current folder that you're in

74
00:03:27,530 --> 00:03:29,850
and we see that we changed the group own

75
00:03:29,850 --> 00:03:32,290
to the Legal department when prior it was root

76
00:03:33,270 --> 00:03:34,730
and we do the same thing here.

77
00:03:34,730 --> 00:03:37,060
We change the owner through testuser

78
00:03:42,060 --> 00:03:44,280
and here we want to do recursively

79
00:03:44,280 --> 00:03:45,963
since it is a directory.

80
00:03:49,620 --> 00:03:51,710
Change it to Legal department.

81
00:03:56,310 --> 00:03:57,143
Do it again.

82
00:03:57,143 --> 00:04:00,060
Now we see the testuser now owns the permissions

83
00:04:00,060 --> 00:04:01,350
of this directory,

84
00:04:01,350 --> 00:04:04,980
meaning that the testuser can modify any privileges

85
00:04:04,980 --> 00:04:07,950
to the files and the contents of that directory.

86
00:04:07,950 --> 00:04:09,210
Now there's another command we can use

87
00:04:09,210 --> 00:04:12,510
to change the group simply changed group.

88
00:04:12,510 --> 00:04:14,370
Since we're the root folder we're have

89
00:04:14,370 --> 00:04:15,510
to add a sudo command.

90
00:04:15,510 --> 00:04:17,459
So we're going to change the group here

91
00:04:17,459 --> 00:04:18,880
to the Graphics department

92
00:04:23,250 --> 00:04:24,083
Legal.

93
00:04:26,790 --> 00:04:28,143
If we list this up,

94
00:04:30,990 --> 00:04:33,180
we will see that the group has changed

95
00:04:33,180 --> 00:04:34,533
to the graphics department.

96
00:04:37,350 --> 00:04:38,520
Finish out this demonstration.

97
00:04:38,520 --> 00:04:40,560
We're going to change one

98
00:04:40,560 --> 00:04:45,184
of the files ownership to testuser.

99
00:04:45,184 --> 00:04:50,184
So we'll see, test one, it's all owned by testuser already.

100
00:04:50,760 --> 00:04:51,840
So I totally changed someone else.

101
00:04:51,840 --> 00:04:53,700
Change it back to me.

102
00:04:53,700 --> 00:04:57,210
So we'll change over changed sudo.

103
00:04:57,210 --> 00:05:01,990
Since I'm not the current owner going change the ownership

104
00:05:03,180 --> 00:05:04,073
to jkelly

105
00:05:05,691 --> 00:05:06,524
Test first

106
00:05:07,710 --> 00:05:08,543
file.

107
00:05:10,277 --> 00:05:11,697
let's see example

108
00:05:11,697 --> 00:05:14,730
and see that the ownership has changed

109
00:05:14,730 --> 00:05:16,290
in that reps of this demonstration.

110
00:05:16,290 --> 00:05:17,940
We went over how to change the ownership

111
00:05:17,940 --> 00:05:19,440
of files and directories.

112
00:05:19,440 --> 00:05:20,890
And I'll see you in the next.

