1 00:00:00,000 --> 00:00:04,500 [Intro Music] 2 00:00:04,560 --> 00:00:06,420 Alright, now let me demonstrate to you 3 00:00:06,420 --> 00:00:08,430 how you could create a new user; 4 00:00:08,550 --> 00:00:11,070 and I will do that as a root user 5 00:00:11,100 --> 00:00:13,680 in Ubuntu Docker container. Please 6 00:00:13,680 --> 00:00:15,540 notice that if you want to create 7 00:00:15,570 --> 00:00:17,910 new users, you need to have root 8 00:00:17,940 --> 00:00:20,190 access to the system. And if you 9 00:00:20,190 --> 00:00:21,840 are a root user, you are good to go 10 00:00:21,840 --> 00:00:23,430 and you are able to create any 11 00:00:23,460 --> 00:00:25,890 other users. If you are logged 12 00:00:25,920 --> 00:00:28,260 in as a regular user, you need to 13 00:00:28,260 --> 00:00:29,910 prepend the commands that we will 14 00:00:29,910 --> 00:00:31,620 use here in this lecture and next 15 00:00:31,620 --> 00:00:34,530 lectures with sudo. And when you 16 00:00:34,530 --> 00:00:37,230 enter any command with sudo prefix, 17 00:00:37,260 --> 00:00:39,150 you will be asked for root 18 00:00:39,150 --> 00:00:41,280 password. And if you don't have 19 00:00:41,280 --> 00:00:42,960 access to root password, of course, 20 00:00:42,990 --> 00:00:44,970 you won't be able to perform such 21 00:00:44,970 --> 00:00:47,400 actions as creation of new users. 22 00:00:47,940 --> 00:00:49,890 All right, you are able to create 23 00:00:49,920 --> 00:00:51,900 new users using two different 24 00:00:51,900 --> 00:00:55,936 commands, either 'useradd' or 'adduser'. 25 00:00:55,936 --> 00:00:57,870 And first, let's have a quick 26 00:00:57,870 --> 00:00:59,850 look at help for those both 27 00:00:59,850 --> 00:01:02,760 commands. 'useradd --help'. 28 00:01:03,690 --> 00:01:05,310 And here you see different options 29 00:01:05,310 --> 00:01:07,260 that could be used along with this 30 00:01:07,260 --> 00:01:09,180 command. And you see that this 31 00:01:09,180 --> 00:01:11,070 command is used for creation of the 32 00:01:11,070 --> 00:01:13,470 new user. And here in place of 33 00:01:13,500 --> 00:01:16,110 LOGIN, you need to enter new user 34 00:01:16,110 --> 00:01:18,180 name for the user you want to add. 35 00:01:19,170 --> 00:01:21,000 Let's have a look at 'adduser' 36 00:01:21,000 --> 00:01:23,790 command. Clear terminal. 'adduser 37 00:01:23,820 --> 00:01:27,210 --help'. And here is a help page 38 00:01:27,240 --> 00:01:29,550 for 'adduser' command. And for 39 00:01:29,550 --> 00:01:32,740 example, with such option as '--home', 40 00:01:32,740 --> 00:01:34,200 you are able to set 41 00:01:34,230 --> 00:01:36,480 custom home directory for a 42 00:01:36,480 --> 00:01:38,850 specific new user. And here as 43 00:01:38,850 --> 00:01:41,310 USER, you should enter any user 44 00:01:41,310 --> 00:01:43,260 name that will be used for creation 45 00:01:43,260 --> 00:01:46,050 of the new user. Alright, I'll show 46 00:01:46,050 --> 00:01:48,180 you both commands in action. And 47 00:01:48,180 --> 00:01:50,700 let me start with 'useradd' command. 48 00:01:51,000 --> 00:01:52,800 Let me clear terminal; and enter 49 00:01:52,860 --> 00:01:56,100 'useradd'; and next, let me enter my 50 00:01:56,100 --> 00:01:58,230 name as username; 'useradd 51 00:01:58,290 --> 00:02:00,540 bogdan'. And you see that actually 52 00:02:00,540 --> 00:02:03,240 nothing happened. I saw no prompts. 53 00:02:03,270 --> 00:02:06,000 And it seems that new user was 54 00:02:06,000 --> 00:02:09,240 created. Let me now try to login as 55 00:02:09,240 --> 00:02:11,669 'bogdan' user. And you are able to 56 00:02:11,669 --> 00:02:13,889 log in as other user if you are 57 00:02:13,889 --> 00:02:15,930 already logged in as for example 58 00:02:15,930 --> 00:02:17,730 root user. And for that, you could 59 00:02:17,730 --> 00:02:21,180 use command 'su', this one. And next 60 00:02:21,210 --> 00:02:23,040 you could type simply username 61 00:02:23,070 --> 00:02:26,679 you want to log in with. 'su bogdan'. 62 00:02:26,679 --> 00:02:29,340 And notice that I was logged 63 00:02:29,400 --> 00:02:32,130 into other shell. And actually 64 00:02:32,130 --> 00:02:35,790 now you see 'sh' shell. As a root 65 00:02:35,790 --> 00:02:37,890 user, I was logged in into the bash 66 00:02:37,890 --> 00:02:40,440 shell. And from that bash shell, I 67 00:02:40,440 --> 00:02:43,500 was logged into 'sh' shell for 'bogdan' 68 00:02:43,500 --> 00:02:46,876 user. And if I enter here, 'whoami', 69 00:02:46,876 --> 00:02:49,830 I see 'bogdan'. And that 70 00:02:49,830 --> 00:02:51,870 means that now I'm logged in as 71 00:02:51,870 --> 00:02:53,940 'bogdan' user. But let's have a 72 00:02:53,940 --> 00:02:55,740 look at the contents of the folder 73 00:02:55,770 --> 00:02:59,250 I'm currently in 'ls'; and here I see 74 00:02:59,280 --> 00:03:02,400 error, 'Permission denied'. If I enter 75 00:03:02,400 --> 00:03:05,580 'pwd', I see that I'm still in the 76 00:03:05,610 --> 00:03:08,550 '/root' folder. But you could 77 00:03:08,550 --> 00:03:10,230 remember that this folder is 78 00:03:10,230 --> 00:03:12,390 actually home directory for root 79 00:03:12,390 --> 00:03:15,120 user. And this folder has read, 80 00:03:15,150 --> 00:03:17,400 write and execute permissions only 81 00:03:17,400 --> 00:03:20,340 for root user. And if I enter 'ls 82 00:03:20,370 --> 00:03:22,710 -la', and here type '/', 83 00:03:22,980 --> 00:03:24,780 you'll see this information here on 84 00:03:24,780 --> 00:03:27,480 this line. A root folder can be 85 00:03:27,480 --> 00:03:30,420 accessed only by root user. That's 86 00:03:30,420 --> 00:03:32,670 why if I try to access it here as 87 00:03:32,670 --> 00:03:34,620 'bogdan' user, I will get permission 88 00:03:34,650 --> 00:03:36,300 error. And that's fully correct. 89 00:03:36,570 --> 00:03:39,090 All right. That's how I was able to 90 00:03:39,090 --> 00:03:41,790 log into the 'sh' shell using 91 00:03:41,820 --> 00:03:44,730 different user. But let's try to 92 00:03:44,730 --> 00:03:46,080 list the contents of the home 93 00:03:46,080 --> 00:03:47,730 directory. I have told you that 94 00:03:48,180 --> 00:03:49,830 each user should have home 95 00:03:49,860 --> 00:03:52,906 directory, let's enter 'ls /home', 96 00:03:52,906 --> 00:03:55,860 and here I see actually no 97 00:03:55,890 --> 00:03:58,830 other subfolders. And that means 98 00:03:58,860 --> 00:04:01,980 that no home directory was created 99 00:04:02,010 --> 00:04:05,580 for this new user, 'bogdan'. And 100 00:04:05,580 --> 00:04:07,260 if you want to create a new home 101 00:04:07,260 --> 00:04:08,700 directory, you need to perform 102 00:04:08,730 --> 00:04:11,400 additional action. Also, this user 103 00:04:11,430 --> 00:04:14,550 doesn't have any password set. And 104 00:04:14,550 --> 00:04:16,709 if you will try to access this 105 00:04:16,740 --> 00:04:18,870 computer remotely and login as 106 00:04:18,870 --> 00:04:20,910 'bogdan' user, you will not be able 107 00:04:20,910 --> 00:04:22,529 to do so because there was no 108 00:04:22,529 --> 00:04:25,410 password for this user. Now let's 109 00:04:25,410 --> 00:04:27,899 go back to root user. And if you 110 00:04:27,899 --> 00:04:30,060 want to exit from current session 111 00:04:30,060 --> 00:04:31,710 for 'bogdan' user, you need to 112 00:04:31,710 --> 00:04:34,530 enter simply 'exit', and now I am back 113 00:04:34,560 --> 00:04:37,380 to bash shell for root user. 114 00:04:38,040 --> 00:04:40,170 Alright, next command that you need 115 00:04:40,170 --> 00:04:42,120 to use if you want to set up a 116 00:04:42,120 --> 00:04:46,479 password for specific user is 'passwd', 117 00:04:46,479 --> 00:04:48,989 and next comes username 'bogdan'. 118 00:04:48,989 --> 00:04:51,030 and here I could set a new 119 00:04:51,030 --> 00:04:52,860 password for a specific user. 120 00:04:53,070 --> 00:04:55,560 Let me set something random '123'. 121 00:04:55,710 --> 00:04:58,980 Here I'll retype '123'; and password 122 00:04:59,010 --> 00:05:00,660 was updated second successfully. 123 00:05:01,080 --> 00:05:04,170 And now I will be able to log in as 124 00:05:04,260 --> 00:05:06,450 regular 'bogdan' user using this 125 00:05:06,450 --> 00:05:08,370 password that I have just configured. 126 00:05:08,910 --> 00:05:10,950 Let's now again try to log in as 127 00:05:10,980 --> 00:05:13,170 'bogdan' user by typing 'su 128 00:05:13,230 --> 00:05:16,170 bogdan'. And you see that I wasn't 129 00:05:16,230 --> 00:05:18,300 asked for any password. And the 130 00:05:18,300 --> 00:05:20,250 reason for that is that I'm already 131 00:05:20,280 --> 00:05:22,050 logged into the system as a 132 00:05:22,050 --> 00:05:23,970 root user, and that's why there was 133 00:05:24,000 --> 00:05:26,340 no need to ask for password for 134 00:05:26,340 --> 00:05:29,070 other user. All right, that's 135 00:05:29,070 --> 00:05:30,930 how we were able to set password 136 00:05:30,960 --> 00:05:33,540 for a specific new user. But there 137 00:05:33,540 --> 00:05:35,670 was still no home directory for 138 00:05:35,670 --> 00:05:38,160 this user. Let me show you how you 139 00:05:38,160 --> 00:05:41,040 could create a new user with home 140 00:05:41,040 --> 00:05:43,260 directory. And first, let's simply 141 00:05:43,290 --> 00:05:45,510 remove this user that we have just 142 00:05:45,510 --> 00:05:47,550 created. And for that use following 143 00:05:47,550 --> 00:05:50,610 command, 'userdel', and next comes 144 00:05:50,640 --> 00:05:54,540 username, user was removed. And 145 00:05:54,540 --> 00:05:56,700 now let's create the same user back 146 00:05:56,700 --> 00:05:59,280 again, but with another option that 147 00:05:59,280 --> 00:06:01,230 will automatically create new 148 00:06:01,260 --> 00:06:03,780 home directory for this user. Let's 149 00:06:03,780 --> 00:06:07,290 type 'useradd --help'; and 150 00:06:07,290 --> 00:06:09,390 let's look for options that will 151 00:06:09,390 --> 00:06:11,430 create the home directory. And 152 00:06:11,430 --> 00:06:13,860 actually, I'm able to filter this 153 00:06:13,890 --> 00:06:16,290 output using pipe operator, '|', and here 154 00:06:16,290 --> 00:06:17,910 will be 'grep' command, we have 155 00:06:17,910 --> 00:06:19,140 already discussed this command 156 00:06:19,140 --> 00:06:21,900 before. And here type 'home' like so. 157 00:06:22,320 --> 00:06:24,780 And you see that with '-d' 158 00:06:24,780 --> 00:06:26,700 option, you are able to set 159 00:06:26,730 --> 00:06:30,060 specific home directory, or you are 160 00:06:30,060 --> 00:06:32,820 able to use '-m' option that will 161 00:06:32,820 --> 00:06:34,200 create a home directory 162 00:06:34,260 --> 00:06:36,510 automatically in the '/home' 163 00:06:36,540 --> 00:06:39,390 directory. Let's use '-m' option. 164 00:06:39,660 --> 00:06:42,600 Let's clear terminal, 'useradd 165 00:06:42,870 --> 00:06:45,510 -m'; and next comes username, 166 00:06:45,750 --> 00:06:47,880 'bogdan' again. And now let's 167 00:06:47,880 --> 00:06:50,130 list contents of the '/home' folder. 168 00:06:50,190 --> 00:06:52,620 And now you see new subfolder 169 00:06:52,680 --> 00:06:53,850 that was created here 170 00:06:53,880 --> 00:06:56,400 automatically; and name matches 171 00:06:56,520 --> 00:06:58,380 username for this user that we 172 00:06:58,380 --> 00:07:01,200 have just created. Let's list 173 00:07:01,200 --> 00:07:03,420 contents of this 'bogdan' folder; 174 00:07:03,600 --> 00:07:07,080 and let's add here options '-la' 175 00:07:07,230 --> 00:07:08,910 in order to see hidden files and 176 00:07:08,910 --> 00:07:11,730 see results in table format. And 177 00:07:11,730 --> 00:07:13,410 now I see that there are three 178 00:07:13,440 --> 00:07:17,025 hidden files, '.bash_logout', '.bashrc', 179 00:07:17,025 --> 00:07:19,560 and '.profile'; and those files 180 00:07:19,590 --> 00:07:21,900 were created automatically for this 181 00:07:21,930 --> 00:07:24,630 particular user. But now question, 182 00:07:24,840 --> 00:07:27,750 how Linux system decides which 183 00:07:27,780 --> 00:07:30,570 shell specific user should use by 184 00:07:30,570 --> 00:07:35,100 default. Let me show you 'ls /etc/ 185 00:07:35,310 --> 00:07:39,030 default/useradd', there is such 186 00:07:39,030 --> 00:07:41,370 file located in '/etc/default' 187 00:07:41,370 --> 00:07:43,230 directory, let's have a look 188 00:07:43,230 --> 00:07:45,630 actually at this file using 'cat' 189 00:07:45,630 --> 00:07:48,240 command, and you'll see a set of 190 00:07:48,270 --> 00:07:50,760 default options that are used for 191 00:07:50,760 --> 00:07:53,580 creation of the new user when you 192 00:07:53,580 --> 00:07:56,490 enter 'useradd' command. And if you 193 00:07:56,490 --> 00:07:58,860 scroll up a bit, you'll see such 194 00:07:58,890 --> 00:08:01,710 variable that is set to '/bin/sh'. 195 00:08:02,940 --> 00:08:05,040 And that actually indicates default 196 00:08:05,070 --> 00:08:07,500 shell that will be used for new 197 00:08:07,500 --> 00:08:10,400 users that you create using 'useradd' 198 00:08:10,400 --> 00:08:13,100 command. And you are able 199 00:08:13,140 --> 00:08:14,940 actually adjust this default 200 00:08:14,940 --> 00:08:16,950 configuration file, you're able to 201 00:08:16,950 --> 00:08:18,420 uncomment some sections, you're 202 00:08:18,420 --> 00:08:20,220 able to add additional parameters, 203 00:08:20,310 --> 00:08:22,110 you are able to modify existing 204 00:08:22,110 --> 00:08:24,270 parameters and so on. And let's 205 00:08:24,300 --> 00:08:26,610 actually try to modify this file 206 00:08:26,790 --> 00:08:30,090 and adjust shell to be '/bin/bash'; and 207 00:08:30,090 --> 00:08:31,710 afterwards, let's try to create a 208 00:08:31,740 --> 00:08:34,140 new user. But first, let's log in 209 00:08:34,169 --> 00:08:36,360 as 'bogdan' user, and ensure that we 210 00:08:36,360 --> 00:08:38,700 will be logged in into the 'sh' shell. 211 00:08:38,970 --> 00:08:41,460 Let's clear terminal, and enter 'su 212 00:08:41,760 --> 00:08:43,710 bogdan'; and you'll see here that 213 00:08:43,740 --> 00:08:46,620 I'm logged in into the 'sh' shell as 214 00:08:46,620 --> 00:08:48,809 'bogdan' user; and we are able to 215 00:08:48,809 --> 00:08:50,669 verify which shell we are currently 216 00:08:50,669 --> 00:08:53,070 using by entering command 'echo 217 00:08:53,159 --> 00:08:56,340 $0'; and here I see 'sh'. 218 00:08:57,270 --> 00:08:59,310 Alright, let's now try to create a 219 00:08:59,340 --> 00:09:02,820 new user under this session. Let's 220 00:09:02,820 --> 00:09:04,860 try to enter 'useradd'; and for 221 00:09:04,860 --> 00:09:06,600 example, let's create a new user 222 00:09:06,630 --> 00:09:09,030 called 'test'. And here I see error 223 00:09:09,060 --> 00:09:10,800 'Permission denied'. And the reason 224 00:09:10,800 --> 00:09:12,360 for that is that I am trying to 225 00:09:12,360 --> 00:09:14,730 create a new user from a regular 226 00:09:14,760 --> 00:09:17,070 user session. And I have told you 227 00:09:17,070 --> 00:09:18,510 before that if you want to create 228 00:09:18,540 --> 00:09:20,430 new users, you need to have root 229 00:09:20,430 --> 00:09:22,620 privileges. And if you try to do 230 00:09:22,620 --> 00:09:24,810 so, as a regular user, you'll get 231 00:09:24,810 --> 00:09:27,060 definitely an error. All right, 232 00:09:27,210 --> 00:09:29,130 let's exit from the session. And 233 00:09:29,130 --> 00:09:32,010 now let's modify configuration file 234 00:09:32,040 --> 00:09:34,530 for 'useradd' command. Let's use 235 00:09:34,560 --> 00:09:37,680 Nano Editor. 'nano', here type a path 236 00:09:37,680 --> 00:09:39,780 to this configuration file. It is 237 00:09:39,780 --> 00:09:42,510 located in '/etc', I'll use absolute 238 00:09:42,510 --> 00:09:45,300 path, next 'default', and here will be 239 00:09:45,330 --> 00:09:47,760 'useradd' like this. And let's 240 00:09:47,760 --> 00:09:50,370 modify this line. 'SHELL' will be 241 00:09:50,400 --> 00:09:54,150 '/bin/bash' like so. Let's save 242 00:09:54,150 --> 00:09:58,290 changes, Ctrl + X, Yes, Enter, and let's 243 00:09:58,320 --> 00:10:00,000 read the contents of this file in 244 00:10:00,000 --> 00:10:01,680 order to verify that the changes were 245 00:10:01,710 --> 00:10:04,440 saved, and let's scroll up here. 246 00:10:05,759 --> 00:10:08,099 And yes, here's this change, 'SHELL' 247 00:10:08,129 --> 00:10:10,859 is set to '/bin/bash'. Alright, let's 248 00:10:10,859 --> 00:10:12,509 now create one more user. And 249 00:10:12,509 --> 00:10:14,969 again, I'll use option '-m', that 250 00:10:14,969 --> 00:10:16,499 will automatically create a new 251 00:10:16,499 --> 00:10:18,149 home directory for this new user. 252 00:10:18,359 --> 00:10:20,399 And afterwards, we will try to log 253 00:10:20,429 --> 00:10:22,769 in as a new user. Let's enter 254 00:10:22,769 --> 00:10:25,229 'useradd'; next comes '-m' 255 00:10:25,259 --> 00:10:27,089 option; and afterwards, let's enter 256 00:10:27,089 --> 00:10:28,919 username, 'test'. We will create a 257 00:10:28,949 --> 00:10:31,469 new user with username 'test'. Let's 258 00:10:31,469 --> 00:10:34,919 press Enter. And now let's use 'su 259 00:10:35,039 --> 00:10:37,349 test'; and now you'll see that I'm 260 00:10:37,349 --> 00:10:39,269 inside of the 'bash' shell. Let's 261 00:10:39,269 --> 00:10:42,059 type 'echo $0', and you 262 00:10:42,059 --> 00:10:44,609 see 'bash'. And notice that if you 263 00:10:44,609 --> 00:10:47,549 use 'su' command without any other 264 00:10:47,549 --> 00:10:49,589 options, then current working 265 00:10:49,589 --> 00:10:51,809 directory will remain unchanged. 266 00:10:52,019 --> 00:10:54,269 Notice that here I was inside of 267 00:10:54,269 --> 00:10:56,309 the home directory for root user, 268 00:10:56,399 --> 00:10:58,559 it is '/root'; and the when I 269 00:10:58,559 --> 00:11:01,439 have changed user, I still remain 270 00:11:01,469 --> 00:11:04,319 in this folder, '/root'. And if 271 00:11:04,319 --> 00:11:06,329 you don't want such behavior, you 272 00:11:06,329 --> 00:11:08,309 need to use additional option with 273 00:11:08,339 --> 00:11:10,259 'su' command. Let me show you that. 274 00:11:10,379 --> 00:11:12,869 Let's exit from here, and type 'su 275 00:11:12,899 --> 00:11:15,479 --help'; and here you'll see 276 00:11:15,509 --> 00:11:17,939 this option on this line. You 277 00:11:17,939 --> 00:11:20,789 could either use '-', or 278 00:11:20,819 --> 00:11:23,609 '-l', or '--login'; and 279 00:11:23,609 --> 00:11:24,989 with this option, you will be 280 00:11:24,989 --> 00:11:27,749 logged into new session completely 281 00:11:27,809 --> 00:11:30,359 from scratch as a new user. Let me 282 00:11:30,359 --> 00:11:33,179 show you that. 'su -', and here 283 00:11:33,179 --> 00:11:35,879 type username 'test'; and you'll see 284 00:11:35,909 --> 00:11:38,789 that I have changed user to test. 285 00:11:38,999 --> 00:11:40,919 And now I'm inside of the home 286 00:11:40,919 --> 00:11:44,069 directory for this 'test' user. And 287 00:11:44,099 --> 00:11:47,309 if I enter 'pwd', you'll see path 288 00:11:47,369 --> 00:11:50,519 to home directory for 'test' user, it 289 00:11:50,519 --> 00:11:53,729 is '/home/test'. Same 290 00:11:53,759 --> 00:11:56,009 applies to other users. For 291 00:11:56,009 --> 00:11:58,199 example, let's exit from here and 292 00:11:58,229 --> 00:12:01,079 'su -', and here type 'bogdan' 293 00:12:01,079 --> 00:12:03,299 username; and now I'm actually in 294 00:12:03,299 --> 00:12:06,779 the 'sh' shell, but if I enter 'pwd' 295 00:12:06,839 --> 00:12:09,359 you'll see the same picture. I'm 296 00:12:09,359 --> 00:12:11,639 inside of the home directory for 297 00:12:11,669 --> 00:12:14,369 this particular user. That's what 298 00:12:14,369 --> 00:12:17,309 this option '-' or '-l' does. 299 00:12:17,999 --> 00:12:19,589 Alright, that's how you could 300 00:12:19,589 --> 00:12:22,439 create new users using 'useradd' 301 00:12:22,439 --> 00:12:24,569 command. And with such option 302 00:12:24,599 --> 00:12:26,519 as '-m', you're able to 303 00:12:26,519 --> 00:12:28,259 automatically create a new home 304 00:12:28,259 --> 00:12:30,119 directory for a specific user. 305 00:12:30,479 --> 00:12:32,459 Great. Let's exit from here; and 306 00:12:32,459 --> 00:12:35,309 let's use a 'userdel' command in 307 00:12:35,309 --> 00:12:37,409 order to remove 'bogdan' user, 308 00:12:37,739 --> 00:12:39,659 and let's verify whether home 309 00:12:39,659 --> 00:12:41,909 directory for this user is still in 310 00:12:41,909 --> 00:12:44,279 place or not. Let's list files in 311 00:12:44,279 --> 00:12:46,889 home directory. And yes, I still 312 00:12:46,889 --> 00:12:48,929 see here 'bogdan' sub folder. 313 00:12:49,379 --> 00:12:51,269 And that means that 'userdel' 314 00:12:51,269 --> 00:12:53,099 command without any additional 315 00:12:53,129 --> 00:12:55,379 options does not remove home 316 00:12:55,379 --> 00:12:57,299 directory for a specific user. 317 00:12:57,749 --> 00:12:59,069 Let's have a look at the help 318 00:12:59,099 --> 00:13:01,068 options for 'userdel' command. 319 00:13:01,068 --> 00:13:04,289 'userdel --help'; and here in 320 00:13:04,289 --> 00:13:06,179 list of those options you see 321 00:13:06,209 --> 00:13:08,099 option '-r' that will 322 00:13:08,129 --> 00:13:10,259 automatically remove home directory 323 00:13:10,289 --> 00:13:13,049 for a specific user. Let's use this 324 00:13:13,079 --> 00:13:15,029 option in order to remove 'test' 325 00:13:15,029 --> 00:13:17,429 user. Let's enter 'userdel 326 00:13:17,639 --> 00:13:20,669 -r test'. You see warning 327 00:13:20,669 --> 00:13:22,589 that the test mail spool wasn't 328 00:13:22,589 --> 00:13:25,349 found, just ignore it. Let's list 329 00:13:25,349 --> 00:13:27,089 the contents of the home directory 330 00:13:27,089 --> 00:13:29,159 now, and I don't see 'test' 331 00:13:29,189 --> 00:13:31,349 subfolder here in this home folder. 332 00:13:31,919 --> 00:13:34,619 Let's also remove manually this sub- 333 00:13:34,619 --> 00:13:38,655 folder. Let's use 'rm -r /home 334 00:13:38,655 --> 00:13:41,129 /bogdan'; Enter; let's 335 00:13:41,129 --> 00:13:43,169 list contents of the '/home' directory; 336 00:13:43,289 --> 00:13:45,659 and now it is empty. Alright, that's 337 00:13:45,659 --> 00:13:46,859 how you would create the new 338 00:13:46,859 --> 00:13:49,619 users using 'useradd' command. With 339 00:13:49,649 --> 00:13:52,199 another command 'passwd' you are 340 00:13:52,199 --> 00:13:54,389 able to set password or modify it 341 00:13:54,479 --> 00:13:55,799 if it is already set for a 342 00:13:55,799 --> 00:13:58,469 particular user. And using 'userdel' 343 00:13:58,469 --> 00:14:00,299 command you are able to remove 344 00:14:00,359 --> 00:14:03,029 created user. Let's now proceed, and 345 00:14:03,029 --> 00:14:04,709 next let me show you another 346 00:14:04,709 --> 00:14:07,319 command 'adduser'. It is slightly 347 00:14:07,319 --> 00:14:08,849 different from 'useradd' command, 348 00:14:08,879 --> 00:14:10,889 but just with single command you're 349 00:14:10,889 --> 00:14:12,749 able to set the home directory, 350 00:14:12,749 --> 00:14:14,609 passwords, and other options if you 351 00:14:14,609 --> 00:14:16,529 want to do so. Let's talk about it 352 00:14:16,589 --> 00:14:17,879 in the next lecture. Bye-Be. 353 00:14:17,879 --> 00:14:20,010 [no audio]