1 00:00:00,550 --> 00:00:03,830 All right, now it's time to talk about user and group management. 2 00:00:03,850 --> 00:00:07,140 So actually for that, we will use this comment. 3 00:00:07,480 --> 00:00:12,390 So we have the ad user comment and we have that user add comment. 4 00:00:12,580 --> 00:00:14,810 But by the way, I prefer ad user. 5 00:00:14,990 --> 00:00:15,850 Now, what is that? 6 00:00:15,850 --> 00:00:17,770 Actually, they are the same under the hood. 7 00:00:17,770 --> 00:00:23,920 Ad User Command used the end user comment because this user comment is something within the system. 8 00:00:23,950 --> 00:00:25,870 By the way, you can read more about them. 9 00:00:25,900 --> 00:00:26,670 What is the difference? 10 00:00:26,680 --> 00:00:33,100 But for now, let's just add user, because it is much faster and easier because ad user, I will add 11 00:00:33,100 --> 00:00:37,530 that user, for example, so you can see only the old can do that. 12 00:00:37,540 --> 00:00:41,290 So it do shift one, shift one like that. 13 00:00:41,500 --> 00:00:41,950 And yeah. 14 00:00:41,950 --> 00:00:42,700 What is the password. 15 00:00:42,700 --> 00:00:43,810 One, two, three, one, two, three. 16 00:00:44,050 --> 00:00:44,530 I think. 17 00:00:44,530 --> 00:00:45,670 One, two, three, one, two, three. 18 00:00:45,700 --> 00:00:49,690 By the way, for name no other as this, correct. 19 00:00:49,690 --> 00:00:50,110 Yes. 20 00:00:50,470 --> 00:00:51,210 Or Bressington. 21 00:00:51,220 --> 00:00:54,600 Because you can see that the way is capital, which means this is the default behavior. 22 00:00:55,030 --> 00:00:55,590 So yeah. 23 00:00:56,020 --> 00:01:00,560 So now I have that user test now using user mode. 24 00:01:00,610 --> 00:01:07,510 It is the same by the way, but you will not provide the home directory, as you can see at user create 25 00:01:07,530 --> 00:01:10,810 home director for you and actually add user. 26 00:01:11,110 --> 00:01:17,290 By the way, you can add this user to another group using the same command, just typing the same command, 27 00:01:17,290 --> 00:01:23,820 which is to the add user and name of the group, which is in my case, I will put it inside the SUDO 28 00:01:24,040 --> 00:01:31,450 group so it can enable Orkan so it can execute route commands as a route privilege. 29 00:01:31,700 --> 00:01:35,040 But for now I would not put it until I show you this something. 30 00:01:35,380 --> 00:01:38,740 So I will use the Soudas to test. 31 00:01:38,770 --> 00:01:41,700 OK, and we already saw that, by the way. 32 00:01:42,010 --> 00:01:45,220 So here we go inside the suit test again. 33 00:01:45,220 --> 00:01:52,130 Let's use the Desh option, by the way, or the DECIR, so you can see that here we are inside the test 34 00:01:52,180 --> 00:01:54,720 user this time, as you can see this time it is just here. 35 00:01:55,000 --> 00:01:56,560 So if I typed Sudo as. 36 00:01:57,670 --> 00:02:04,420 It would ask me for it for sure, but if I that you can see this is not in the suit was filed, this 37 00:02:04,420 --> 00:02:05,770 incident would be reported. 38 00:02:05,800 --> 00:02:13,330 OK, so how to do such a thing because that the user is not inside the suit or the suit brought, by 39 00:02:13,330 --> 00:02:13,610 the way. 40 00:02:13,810 --> 00:02:16,660 So if I type I can see the groups is only. 41 00:02:18,090 --> 00:02:25,490 This or if I type the groups of command, which is this only, so I will control these or exit to look 42 00:02:25,500 --> 00:02:28,620 out or exit from the shill for their biggest user. 43 00:02:28,950 --> 00:02:33,540 And then if you get the ATC group. 44 00:02:34,950 --> 00:02:41,310 This is where all of the groups in the system, you can see that we have the root and the jihadi, which 45 00:02:41,310 --> 00:02:46,630 is the group identifier, is zero, which means anything with this zero, which means it has the root 46 00:02:46,650 --> 00:02:47,090 privilege. 47 00:02:47,370 --> 00:02:50,640 So if you can edit the group, by the way, it is readable. 48 00:02:50,680 --> 00:02:56,610 It is readable only for everyone, but no one can modify it, only the root. 49 00:02:56,970 --> 00:03:03,000 So if you modify the idea for you, if I scroll down, so for example, list that list, it has this 50 00:03:03,000 --> 00:03:04,220 idea or did. 51 00:03:04,660 --> 00:03:06,170 OK, this is for the group. 52 00:03:06,630 --> 00:03:12,250 So if I modify this, it will as a zero, it will give me as root privilege. 53 00:03:12,270 --> 00:03:14,420 But this is not the best practice to do that. 54 00:03:15,000 --> 00:03:21,780 So if I hear something else or find another file, which is something called the HTC Basswood, and 55 00:03:21,780 --> 00:03:24,210 here inside it you can see that, yeah, we have it here. 56 00:03:24,450 --> 00:03:28,940 So you can see that it has a lot of information, the name of the user X.. 57 00:03:29,280 --> 00:03:30,090 Now, what is this? 58 00:03:30,330 --> 00:03:36,530 Which means that we have the password for this user inside another file called XY Shadow. 59 00:03:36,540 --> 00:03:37,680 We will see right away. 60 00:03:38,340 --> 00:03:42,220 Don't worry, this is there you ID the user identifier. 61 00:03:42,540 --> 00:03:48,720 This is the idea that the group identifier and by the way, we already saw that in their groups. 62 00:03:49,020 --> 00:03:52,590 And here are some of the information values you want to convert. 63 00:03:53,040 --> 00:03:55,920 And here is the home directory for the user. 64 00:03:56,130 --> 00:03:59,560 And here is the Basche or the default product, which has been Besch. 65 00:03:59,580 --> 00:04:06,480 OK, so sometimes we can put Binford's or PIN or use a bit Isbin again, as you can see, sometimes 66 00:04:06,480 --> 00:04:12,570 if we don't need to be for that user to be to have additions like, for example, this here or they've 67 00:04:12,570 --> 00:04:20,310 been here because, you know, locations right now find it is have another log on or a log on the shadow 68 00:04:20,580 --> 00:04:20,970 file. 69 00:04:21,090 --> 00:04:27,760 But you can see permission denied because this shadow, why it has that hashed password for all the 70 00:04:27,870 --> 00:04:28,350 users. 71 00:04:28,500 --> 00:04:35,080 So it's means that the password for the user is hashed and stored inside their shadow. 72 00:04:35,340 --> 00:04:43,050 So if I open it, yeah, you can see that the test user, which is this one, it has this password or 73 00:04:43,050 --> 00:04:44,000 this hash password. 74 00:04:44,200 --> 00:04:46,920 OK, and you can see that it has a lot of information. 75 00:04:46,920 --> 00:04:47,940 A lot of that is whatever. 76 00:04:48,150 --> 00:04:51,530 OK, so actually this is the hash for one, two, three, one, two, three. 77 00:04:51,540 --> 00:04:53,920 You already saw the password, something very simple. 78 00:04:54,030 --> 00:05:00,990 By the way, if I go again to the best with file here like this, you can see if I edit this one or 79 00:05:00,990 --> 00:05:07,260 this one to zero, OK, or the two of them to zero, which means that this is the root user. 80 00:05:07,560 --> 00:05:09,300 Let's scroll up a little bit. 81 00:05:09,540 --> 00:05:10,320 Yeah, here it is. 82 00:05:10,810 --> 00:05:16,980 So you can see that this is the root user and it has a password and it is hash there and zero zero, 83 00:05:16,980 --> 00:05:20,700 which means this user ID and the idea zero, this is the root user. 84 00:05:21,450 --> 00:05:24,380 So the user is not just about user one. 85 00:05:24,390 --> 00:05:29,960 It is a very balkwill and root action because it is called root by the way, because it has the zero 86 00:05:30,040 --> 00:05:31,270 uid and did. 87 00:05:31,500 --> 00:05:31,950 Right. 88 00:05:32,830 --> 00:05:38,130 Look, you know that no, I want for that this to be added to another thing, OK? 89 00:05:39,050 --> 00:05:46,010 So if you click or clack ethnic groups, by the way, OK, you can see that for the open to use. 90 00:05:46,130 --> 00:05:49,850 Here it is for the user sorry, the group group. 91 00:05:50,570 --> 00:05:56,150 But if I screw up a little bit, you can see that we will have the pseudo where it is. 92 00:05:56,330 --> 00:05:57,140 Yeah, here it is. 93 00:05:57,140 --> 00:06:02,600 You can see that this is the through the group and it has inside the Ubuntu user and Mavor user. 94 00:06:02,990 --> 00:06:12,410 Now we want to add actually that this user inside that pseudo user, the soda group, I mean this user 95 00:06:12,410 --> 00:06:20,050 inside the pseudo group to perform a pseudo commands using this to do was find that we already learned. 96 00:06:20,360 --> 00:06:22,190 So add user as simple as that. 97 00:06:22,190 --> 00:06:29,080 You can see that because using the add user is very simple and it will get rid of a lot burden actually. 98 00:06:29,240 --> 00:06:33,000 So add user the name of the user that already existed. 99 00:06:33,230 --> 00:06:34,700 Now put it to sudo. 100 00:06:35,670 --> 00:06:42,450 A symbol, of course, it will ask for permission so you can see that you're adding user to group tudo 101 00:06:42,810 --> 00:06:45,680 adding user to this to group sort of done. 102 00:06:45,960 --> 00:06:50,760 So if I type if I go the to that protest. 103 00:06:52,090 --> 00:07:00,460 You can see that this time it give me this information, but anyway, but what the ID now we have that 104 00:07:00,700 --> 00:07:07,120 the groups that this watch and the pseudo and if I type groups here as well, it has that this pseudo 105 00:07:07,330 --> 00:07:15,040 if I'm the ethnic group again, you can see inside it, if I scroll up for the pseudo group, we have 106 00:07:15,170 --> 00:07:17,080 a window MABA and test. 107 00:07:17,230 --> 00:07:17,730 All right. 108 00:07:17,950 --> 00:07:24,640 And by the way, that test user is the same is here, OK, because by default in Linux, every user 109 00:07:24,640 --> 00:07:31,060 you create, it will come with a group, it will create a group will be created automatically with the 110 00:07:31,060 --> 00:07:31,520 same name. 111 00:07:32,050 --> 00:07:34,590 So yeah, it has a user and group. 112 00:07:34,600 --> 00:07:38,470 I have this user MABA, it has this group matter as well. 113 00:07:39,460 --> 00:07:44,110 Now by the way, they're using their user ad actually. 114 00:07:44,290 --> 00:07:44,610 Yeah. 115 00:07:44,620 --> 00:07:47,500 I'm not saying it's bad or something actually. 116 00:07:47,500 --> 00:07:55,250 By the way, under the hood ad user is using m combine combination of commands which is user ad and 117 00:07:55,300 --> 00:07:56,470 something called user mode. 118 00:07:56,650 --> 00:08:04,520 OK, so after you user ad you create user mode, you put options to create directories or a home director 119 00:08:04,540 --> 00:08:05,030 or something. 120 00:08:05,080 --> 00:08:08,560 OK, ok, so that's why I recommend you to use add user. 121 00:08:08,560 --> 00:08:15,330 Actually it's much simpler and it's not about what they are the same nor security reasons or the performance 122 00:08:15,340 --> 00:08:17,080 and, and whatever. 123 00:08:17,350 --> 00:08:20,110 OK, they are the same but the user is very simple. 124 00:08:20,110 --> 00:08:24,250 Just add user the name of the user and then add user group. 125 00:08:24,250 --> 00:08:26,370 You want to add it to whatever you want. 126 00:08:26,650 --> 00:08:31,690 By the way, if I type add user and for example, let's add this one, just one is not existed. 127 00:08:31,690 --> 00:08:36,200 And what do this will not work even if I type suitable privilege. 128 00:08:36,310 --> 00:08:36,760 I mean. 129 00:08:39,000 --> 00:08:39,860 Now, why is that? 130 00:08:40,170 --> 00:08:46,190 Now here you can see Sudo ad user, this one pseudo does, as you can see, that this one does not exist. 131 00:08:46,200 --> 00:08:49,230 So I need to add it first like this. 132 00:08:50,900 --> 00:08:52,790 And with whatever options I want. 133 00:08:54,510 --> 00:08:59,680 Or whatever, a password, and here then I can add it here. 134 00:08:59,730 --> 00:09:04,560 By the way, if I add it again, it will not work because see that the user is already existed. 135 00:09:05,060 --> 00:09:08,520 But if I added sudo with the group, I mean, yeah, it would work fine. 136 00:09:08,730 --> 00:09:13,230 And if I add again, by the way, it will not work because that this one is already a member of the 137 00:09:13,230 --> 00:09:14,940 pseudo no add user here. 138 00:09:14,970 --> 00:09:16,630 Actually it worked like that. 139 00:09:16,650 --> 00:09:18,730 Actually it's not like workaround or something. 140 00:09:18,750 --> 00:09:25,140 Now the command itself provides such a thing which is creating users and adding users to groups. 141 00:09:25,200 --> 00:09:26,350 OK, all right. 142 00:09:26,640 --> 00:09:27,400 So far, so good. 143 00:09:27,540 --> 00:09:32,250 And if you want or if you are curious how to use the user, add, you can read more about it. 144 00:09:32,400 --> 00:09:34,410 Actually, it's not the third, by the way. 145 00:09:34,860 --> 00:09:42,510 You can use the two commands user add and with that user mode as well to add a user to specific groups. 146 00:09:42,750 --> 00:09:44,300 But anyway, I'm not using it. 147 00:09:44,310 --> 00:09:46,700 I'm using the user now how to delete the user. 148 00:09:47,130 --> 00:09:48,900 It is again, it is the same source. 149 00:09:48,900 --> 00:09:53,180 And so if I type man or the ideal user, this is the command we will use. 150 00:09:53,460 --> 00:09:54,950 So you can see this is to delete. 151 00:09:55,110 --> 00:09:57,600 We can't we have delete user delete group. 152 00:09:58,020 --> 00:09:59,640 This is to remove a user or group. 153 00:09:59,670 --> 00:10:02,130 OK, so if I thought delete user. 154 00:10:03,120 --> 00:10:06,510 And I tried to provide or provide the name of it, which is this. 155 00:10:07,980 --> 00:10:13,210 And yeah, of course, I forgot that then you can see that that this Tuzer is now removed. 156 00:10:13,230 --> 00:10:16,110 OK, and again, let's remove that. 157 00:10:16,110 --> 00:10:18,310 Just one, by the way, is the same. 158 00:10:18,780 --> 00:10:23,300 Now, I checked ATC to see if it is there or not. 159 00:10:23,550 --> 00:10:25,050 You can see that it is not here. 160 00:10:25,440 --> 00:10:28,450 If I can see Beswick to see if the user is there. 161 00:10:28,830 --> 00:10:29,910 No, it is not there. 162 00:10:30,400 --> 00:10:37,920 OK, so if I checked with pseudo permission that ATC shadow, just in case you can see that as well, 163 00:10:37,920 --> 00:10:38,670 it is not there. 164 00:10:38,730 --> 00:10:39,140 All right. 165 00:10:39,360 --> 00:10:41,840 So it is clear the screen and I want to show you something. 166 00:10:42,090 --> 00:10:47,280 So if I go to the home directory, actually, you can see that even though the user is removed and its 167 00:10:47,280 --> 00:10:49,510 group is removed and it is removed. 168 00:10:49,530 --> 00:10:50,920 By the way, if I screw grown up here. 169 00:10:51,300 --> 00:10:52,320 So if you. 170 00:10:52,770 --> 00:10:56,180 Yeah, let's get the ATC group again. 171 00:10:56,220 --> 00:10:58,650 So as you can see, catechesis group. 172 00:10:58,650 --> 00:11:03,710 And if you scroll up to until you reach the pseudo so you can see that it is removed from the study 173 00:11:03,720 --> 00:11:04,310 group as well. 174 00:11:04,350 --> 00:11:10,800 So it is it has been deleted immediately or completely from the system, but while it is still on the 175 00:11:10,800 --> 00:11:11,520 home directory. 176 00:11:11,760 --> 00:11:16,320 Now, this is something that you may you may say this something bad or wrong. 177 00:11:16,320 --> 00:11:16,810 This is wrong. 178 00:11:16,830 --> 00:11:21,330 No, actually, this is the best practice, by the way, because, for example, you have a specific 179 00:11:21,330 --> 00:11:26,810 user and he or she done specific commands in the past. 180 00:11:26,860 --> 00:11:31,130 OK, and you would you want to this they was not remove it completely. 181 00:11:31,410 --> 00:11:36,480 So that's why that's the command gift, its home directory. 182 00:11:36,630 --> 00:11:43,350 So which means every file, each commands in the history or each thing will be there so we can access 183 00:11:43,350 --> 00:11:43,560 it. 184 00:11:43,590 --> 00:11:50,790 So imagine if I am a road user so I will not put that currently emerald user and I can go inside whatever 185 00:11:51,420 --> 00:11:52,020 I want. 186 00:11:52,050 --> 00:11:58,140 So here you can see that I am opening everything inside is the best history, the best look out because 187 00:11:58,140 --> 00:12:00,570 you provide anything here I can find it. 188 00:12:00,720 --> 00:12:03,290 And the is or autist one, by the way. 189 00:12:04,050 --> 00:12:08,100 Nobody actually that will use up option here. 190 00:12:08,370 --> 00:12:13,050 You can see that we have option which is delete the home directly so I can then use it again. 191 00:12:13,470 --> 00:12:15,090 You can see that we have it here. 192 00:12:15,100 --> 00:12:16,860 Let's search about it. 193 00:12:16,860 --> 00:12:21,780 I would give you as you can see, we have this option, which is remove home, as you can see. 194 00:12:22,180 --> 00:12:24,930 So this is to remove the home directory of a user. 195 00:12:24,980 --> 00:12:32,880 It's a wall of backup that after having the form so that it does remove home, it will remove the home 196 00:12:32,880 --> 00:12:34,310 directory for the current user. 197 00:12:34,770 --> 00:12:36,900 Let's have a real quick test. 198 00:12:36,990 --> 00:12:37,560 Don't worry. 199 00:12:38,350 --> 00:12:42,420 So if I didn't use just again and with pseudo permission. 200 00:12:44,710 --> 00:12:46,840 You can see that the that does not exist. 201 00:12:46,870 --> 00:12:47,320 All right. 202 00:12:48,240 --> 00:12:53,970 So if I type it again, but this time with that, it does remove Dash home, which is the option we 203 00:12:53,970 --> 00:12:54,240 saw. 204 00:12:54,690 --> 00:12:57,810 All right, now if I type unless you can see that it is still here. 205 00:12:57,820 --> 00:12:58,130 Why? 206 00:12:58,150 --> 00:12:59,760 Because, yeah, we have it. 207 00:13:00,000 --> 00:13:04,230 So let's add look at user test this time. 208 00:13:05,320 --> 00:13:09,880 As you can see, the data already existed, so one, two, three, one, three, one, two, three. 209 00:13:09,880 --> 00:13:10,420 One, two, three. 210 00:13:12,260 --> 00:13:13,080 Whatever things. 211 00:13:13,940 --> 00:13:14,400 OK. 212 00:13:14,690 --> 00:13:20,910 So if I type A. Yeah, it is here and this is here, so I want to delete user with studio permission. 213 00:13:21,020 --> 00:13:21,730 The user. 214 00:13:22,070 --> 00:13:23,480 Yes that's Desh. 215 00:13:23,660 --> 00:13:24,710 Remove Deshwal. 216 00:13:26,160 --> 00:13:32,870 All right, if I type at this time, OK, so the test has been deleted that this user as well as that 217 00:13:32,880 --> 00:13:37,170 is the group, as well as the test directory, home directory for the test user. 218 00:13:37,980 --> 00:13:40,320 So everything is working as expected. 219 00:13:40,560 --> 00:13:43,520 Or I can just remove it immediately like this. 220 00:13:43,530 --> 00:13:47,280 So if I have pseudo or under-sheriff that just one. 221 00:13:48,160 --> 00:13:55,300 And untreated, you can see that I already did the list one directory or thanks for watching.