1 00:00:01,170 --> 00:00:06,960 Hello and welcome back to the official start cop series we're onto. 2 00:00:07,260 --> 00:00:13,800 And figuring Callie Lennox and we're going to be covering some Kelly Lennox essentials in this module. 3 00:00:19,500 --> 00:00:24,690 So we've got some Khalilah Central topics and also some other important concepts to help you manage 4 00:00:24,690 --> 00:00:27,540 your Daily Limits installation more effectively. 5 00:00:30,910 --> 00:00:32,470 So this is our table of contents. 6 00:00:32,860 --> 00:00:36,580 We're going to talk about the network manager, how to configure interfaces. 7 00:00:36,580 --> 00:00:40,390 We'll talk about the system, the network daemon. 8 00:00:40,390 --> 00:00:47,200 We'll look at managing users and groups, creating new accounts, modifying or disabling accounts. 9 00:00:47,560 --> 00:00:56,050 And we'll also look at configuring specific services for programs like databases, Apache Web servers, 10 00:00:56,740 --> 00:00:59,040 PostgreSQL minus Kuo. 11 00:00:59,470 --> 00:01:02,350 We'll look at SSA for remote logins. 12 00:01:04,770 --> 00:01:05,400 As well. 13 00:01:06,510 --> 00:01:07,860 So this is our chapter flow. 14 00:01:08,010 --> 00:01:10,110 So we'll talk about the network first. 15 00:01:10,110 --> 00:01:16,290 We'll move into managing users and groups, configuring services, and then managing the services. 16 00:01:21,440 --> 00:01:25,700 So we're going to talk about the typical desktop installation of Kelly Linux. 17 00:01:25,700 --> 00:01:32,270 You usually have the network manager program already installed and it can be configured and controlled 18 00:01:32,270 --> 00:01:36,410 through an arms control center and also through the top right menu. 19 00:01:40,840 --> 00:01:42,040 You will go ahead and log in. 20 00:01:43,720 --> 00:01:46,780 With our default username and password. 21 00:01:49,430 --> 00:01:52,730 I built this from the Kelly Linux virtual appliance. 22 00:01:56,380 --> 00:01:57,730 So it's the latest version. 23 00:01:58,060 --> 00:02:02,100 And you'll notice in the top right hand corner, you have this little network icon. 24 00:02:04,310 --> 00:02:08,900 Right now it says Ethernet network connection or wired connection one active. 25 00:02:08,900 --> 00:02:15,230 So you also see other things like VPN connections and you can disconnect, reconnect, you can right 26 00:02:15,230 --> 00:02:17,570 click on it and you can edit different connections. 27 00:02:19,280 --> 00:02:27,920 You can add new connections, both wireless VPN connections, IP SAC Layer two, tunneling protocol, 28 00:02:27,920 --> 00:02:30,860 anything you might need, even Bluetooth connections. 29 00:02:31,390 --> 00:02:32,630 So we're not going to do that right now. 30 00:02:33,140 --> 00:02:34,190 When I close this out. 31 00:02:36,560 --> 00:02:42,010 You can also get to the same resource from the settings menu. 32 00:02:42,750 --> 00:02:43,660 Instead of calling. 33 00:02:47,320 --> 00:02:50,440 There's all your different system options are here. 34 00:02:53,800 --> 00:03:00,010 We can go into the settings manager and control different things that you might want to see, different 35 00:03:00,010 --> 00:03:01,420 tweaks that you might want to make. 36 00:03:02,890 --> 00:03:05,380 Keep in mind from before the previous models. 37 00:03:05,380 --> 00:03:10,810 If you want to get out of your virtual environment, you can click the right control or you can press 38 00:03:10,810 --> 00:03:13,210 the right control key on your keyboard. 39 00:03:13,660 --> 00:03:19,090 You can actually modify that inside of VirtualBox if needed, if you're running it virtually. 40 00:03:26,060 --> 00:03:33,020 So the default in our configuration will typically rely on the HDP, the dynamic host config protocol 41 00:03:33,560 --> 00:03:38,840 network manager gets preinstalled and configured through Vietnam during default desktop installation, 42 00:03:41,150 --> 00:03:49,730 but configuring it by default depends on the DHCP server to get to the DNS domain name, server, gateway 43 00:03:49,730 --> 00:03:50,810 and IP address. 44 00:03:51,260 --> 00:03:56,960 So there's other kinds of add ons that can be managed through a network manager. 45 00:03:59,750 --> 00:04:01,540 You can create multiple profiles. 46 00:04:01,540 --> 00:04:05,050 Even so, you can easily switch between different networks. 47 00:04:05,620 --> 00:04:12,610 As far as wireless networks go, they are automatically tied to their service set identifier or SS ID. 48 00:04:15,860 --> 00:04:25,610 And if you're working with a virtual machine or virtual box, it may not recognize your system onboard 49 00:04:25,970 --> 00:04:27,800 wireless network interface card. 50 00:04:29,920 --> 00:04:30,820 It must be aware of that. 51 00:04:30,820 --> 00:04:37,150 You may have to use an external network adapter, which we may reference in another video. 52 00:04:37,930 --> 00:04:47,140 The network manager provides integration with many types of VPNs like SSA, Open VPN, Cisco's VPN as 53 00:04:47,140 --> 00:04:47,530 well. 54 00:04:51,130 --> 00:04:55,480 Now let's look at some of the different things you can do with checking to see what your local network 55 00:04:55,480 --> 00:04:56,170 IP is. 56 00:04:56,740 --> 00:05:02,440 If you go back, we go back into our virtual environment, our colleague Linux distro. 57 00:05:04,680 --> 00:05:06,000 Then we open up a terminal. 58 00:05:09,190 --> 00:05:11,380 We can go ahead and use the command line from here. 59 00:05:11,650 --> 00:05:17,560 And notice we're at the county at caller interface and there's a dollar sign because it's a regular 60 00:05:17,560 --> 00:05:20,110 user account, not as a route. 61 00:05:21,160 --> 00:05:23,080 So we can do I have config. 62 00:05:27,770 --> 00:05:30,380 And notice that it's in this particular desktop environment. 63 00:05:30,680 --> 00:05:36,560 It's not there by default, depending on which desktop you install. 64 00:05:36,800 --> 00:05:42,080 You may have to change your setup to get all the same commands. 65 00:05:43,640 --> 00:05:45,650 So in our case, it's not that it was not there. 66 00:05:46,070 --> 00:05:49,340 It's not as we have the pseudo due route. 67 00:06:00,660 --> 00:06:05,330 An exit back out to a regular use urban use cleared a clearance rate with Cally. 68 00:06:06,170 --> 00:06:12,650 We're going to pseudo as you and we've already typed in the password so we got a different prompter 69 00:06:12,650 --> 00:06:12,890 notice. 70 00:06:12,890 --> 00:06:18,800 We have the town signs and now we are as root and I have config command works as per usual. 71 00:06:19,370 --> 00:06:24,590 And here we can see some different things like our local IP version for address. 72 00:06:25,760 --> 00:06:36,290 As well as our IP address, we can see different how many received and transmitted packets in frames 73 00:06:36,290 --> 00:06:36,980 that were sent. 74 00:06:37,400 --> 00:06:39,890 There's also this l0 this is the loopback address. 75 00:06:39,890 --> 00:06:44,120 This is essentially the same thing as pinging your network card. 76 00:06:44,120 --> 00:06:45,740 This is the in windows. 77 00:06:45,740 --> 00:06:50,060 This would be called the local host or the local loopback. 78 00:06:53,530 --> 00:06:59,950 Notice you can also check your local Mac address with I have config and there are basically three different 79 00:06:59,950 --> 00:07:02,230 ways to configure networking in Linux. 80 00:07:02,560 --> 00:07:08,050 You can use the graphical interface, you can use the interface up or down commands. 81 00:07:10,260 --> 00:07:11,790 And the system commands. 82 00:07:12,210 --> 00:07:15,090 So first of all, look at the graphical interface. 83 00:07:17,090 --> 00:07:18,500 Switch back over to Kelly. 84 00:07:18,950 --> 00:07:25,160 We can click on this button here and we can click Disconnect and we can see now we're disconnected from 85 00:07:25,160 --> 00:07:28,280 the network and we have a wired connection. 86 00:07:29,370 --> 00:07:32,130 And we'll go ahead and reconnect. 87 00:07:35,760 --> 00:07:40,440 And one of the things that you can do if you've typed a command before, you can press the up arrow 88 00:07:40,770 --> 00:07:44,670 and you will get back the last typed command. 89 00:07:44,730 --> 00:07:46,800 And in this case, I have config. 90 00:07:50,640 --> 00:08:00,630 And we've got our IP address, our network mask, and our broadcast broadcast is essentially the address 91 00:08:00,630 --> 00:08:04,980 you would communicate to on this network if you wanted to send traffic to everyone. 92 00:08:11,040 --> 00:08:15,340 If we want to go ahead and go into the interface file. 93 00:08:16,770 --> 00:08:18,150 We can go into the. 94 00:08:23,180 --> 00:08:25,670 The ETSI network interfaces file. 95 00:08:34,800 --> 00:08:40,590 So this is essentially all the interfaces that the system knows about initially. 96 00:08:41,160 --> 00:08:42,000 So it has the. 97 00:08:44,340 --> 00:08:47,430 Pulls the information from the interfaces data file. 98 00:08:48,120 --> 00:08:53,250 If we wanted to add additional interfaces to start at any time, we could do that. 99 00:09:03,590 --> 00:09:07,730 And you can also do it from the command line as well. 100 00:09:17,120 --> 00:09:23,980 And these are this is actually the main page or the manual page for the interfaces command. 101 00:09:23,990 --> 00:09:32,540 So if you wanted to set up different network interfaces with DHP versus Automatic, you could set up 102 00:09:32,540 --> 00:09:34,010 static IP addresses. 103 00:09:34,370 --> 00:09:39,170 If you see a pound sign and this file, essentially that means that it's an end of line. 104 00:09:39,170 --> 00:09:39,830 Comments. 105 00:09:41,670 --> 00:09:44,430 Or I should say it's just a comment and the one comments are not supported. 106 00:09:44,430 --> 00:09:46,880 So the comment has to be on its own line. 107 00:09:48,200 --> 00:09:54,740 And so it gives you some more amplified information if you want to learn in more detail what your different 108 00:09:54,740 --> 00:09:55,460 options are. 109 00:10:01,700 --> 00:10:07,820 And there are some also some different scripts that are in this folder as well, which are beyond the 110 00:10:07,820 --> 00:10:09,080 scope of this course. 111 00:10:11,520 --> 00:10:18,630 You could change things like the empty use size or the maximum transmission unit, how much data you 112 00:10:18,630 --> 00:10:20,010 want to pass over each packet. 113 00:10:20,310 --> 00:10:21,990 You can change the time to live. 114 00:10:22,440 --> 00:10:25,350 You can change lots of different things. 115 00:10:25,710 --> 00:10:29,070 You can set up tunnels with this command structure. 116 00:10:36,180 --> 00:10:42,800 This is the System D file, which is essentially the service and service manager for Linux. 117 00:10:42,810 --> 00:10:49,110 So whenever a it runs as the first process en route, so it essentially brings up all the other services. 118 00:10:49,740 --> 00:10:54,030 Anything else from other users get started separately? 119 00:10:54,300 --> 00:10:58,770 It's not normally invoked directly by the user, but it is started at boot time. 120 00:10:59,700 --> 00:11:06,440 You probably more likely interact with these the services that are managed by system this. 121 00:11:28,380 --> 00:11:34,410 System B also has some limitations as far as a lack of integrated support for wireless networks. 122 00:11:34,800 --> 00:11:38,100 So you may have to rely on other configurations for wireless support. 123 00:11:39,440 --> 00:11:42,710 Now let's talk about managing users and groups. 124 00:11:45,430 --> 00:11:51,310 So though Kelly is most often run while authenticated as a root user, you may often need to create 125 00:11:51,310 --> 00:11:53,350 non-covered accounts for various reasons. 126 00:11:53,680 --> 00:11:56,470 Especially if you're using Callie as a primary operating system. 127 00:11:57,410 --> 00:12:02,600 Additionally, the newer versions of calling have removed the root account and they've added any user 128 00:12:02,600 --> 00:12:04,520 accounts you can't sudo to root. 129 00:12:05,030 --> 00:12:09,080 That account is kiwi for the username and kiwi for the password. 130 00:12:10,570 --> 00:12:17,290 So Kelly Linux stores the list of users in the Etsy password file. 131 00:12:17,290 --> 00:12:21,520 That's Swg, which is a list of users. 132 00:12:21,790 --> 00:12:27,310 It stores the encrypted password of those users and the Etsy shadow file. 133 00:12:27,730 --> 00:12:30,340 So let's go ahead and take a look at what that means. 134 00:12:32,090 --> 00:12:33,470 We're going to use the cat command. 135 00:12:36,810 --> 00:12:45,510 And there is the Cali user and its corresponding hash password that is the other accounts might be system 136 00:12:45,510 --> 00:12:49,680 accounts or for certain services that do not have passwords. 137 00:12:51,330 --> 00:12:59,150 If we want to be able to add an account, we have to use the ADD user command. 138 00:13:07,910 --> 00:13:12,350 So the ad user command takes a pretty straightforward list of command. 139 00:13:12,350 --> 00:13:14,780 So let's go ahead and add a user briefly. 140 00:13:22,210 --> 00:13:28,750 Once they add user user one, and then it's going to add the group and it's going to add that user one 141 00:13:28,750 --> 00:13:30,340 into that user one group. 142 00:13:30,640 --> 00:13:35,920 It's also going to create a home directory and copy some files over to the Etsy scale directory. 143 00:13:36,340 --> 00:13:39,280 Now let's go ahead and give it a password. 144 00:13:45,300 --> 00:13:49,150 Her strong passwords will be for another another day. 145 00:13:49,170 --> 00:13:50,970 You can type in some other information here. 146 00:13:52,410 --> 00:13:55,350 Like their name, room number. 147 00:13:56,950 --> 00:13:58,360 You can put their work phone in. 148 00:14:03,330 --> 00:14:04,440 But their home plan. 149 00:14:07,120 --> 00:14:08,530 And then any other information. 150 00:14:09,640 --> 00:14:14,740 You want them to have, you know, say yes to confirm the information is correct. 151 00:14:15,160 --> 00:14:17,140 And now let's go ahead and clear the strangest. 152 00:14:17,140 --> 00:14:19,420 So we clean up our workspace here. 153 00:14:19,720 --> 00:14:24,790 Let's go and cat out the Etsy password file, which shows the list of users. 154 00:14:25,570 --> 00:14:29,110 Notice we have our newly created user account here. 155 00:14:30,020 --> 00:14:37,330 If user one John, his name is phone number and there's this shell and we still have the caller ID account 156 00:14:37,330 --> 00:14:40,420 which comes with our built in cally links. 157 00:14:44,430 --> 00:14:50,190 Let's go ahead and cashed out of the Etsy shadow file again and we'll see that we now have the user 158 00:14:50,190 --> 00:14:53,670 one account and its hash password. 159 00:14:54,090 --> 00:15:00,060 Now, for those that have not taken cybersecurity course for hashed, passwords are essentially how 160 00:15:00,060 --> 00:15:01,200 passwords are stored. 161 00:15:01,500 --> 00:15:08,250 It's just taking the plaintext of what I'm typing in when I'm creating the user account and I'm running 162 00:15:08,250 --> 00:15:11,040 it through a mathematical function, a one way function. 163 00:15:11,340 --> 00:15:17,190 The idea is that it's hard to undo this hash version of the password. 164 00:15:17,490 --> 00:15:20,670 It's not easily digestible or easy to break. 165 00:15:21,030 --> 00:15:23,760 The what they call the ciphertext version. 166 00:15:24,000 --> 00:15:29,040 So this is essentially just a scrambled version of the plaintext, and it's been run through something 167 00:15:29,040 --> 00:15:33,590 like MD5 or SHA wan, which we maybe shot. 168 00:15:33,600 --> 00:15:36,540 We learned about SHA256 when we were doing file integrity. 169 00:15:36,900 --> 00:15:43,590 Depending on the security of the system, it may hash the password more securely. 170 00:15:43,590 --> 00:15:52,230 So a longer hash is the more number of bits that you output, the more secure it is. 171 00:15:52,530 --> 00:15:58,620 So essentially a hash password is no matter what you put in as the plaintext, it's depending on the 172 00:15:58,620 --> 00:15:59,340 algorithm. 173 00:15:59,580 --> 00:16:04,380 It's always going to have the same amount of hash value, same amount of characters. 174 00:16:05,690 --> 00:16:07,440 It's so. 175 00:16:12,430 --> 00:16:16,020 We have, we talked about the wizard to be able to add users. 176 00:16:16,030 --> 00:16:19,300 We looked at the hash passwords and it's fairly straightforward. 177 00:16:23,590 --> 00:16:24,070 And let's. 178 00:16:25,570 --> 00:16:28,240 Also look at the Etsy group folder. 179 00:16:31,520 --> 00:16:32,810 And go and clear the screen. 180 00:16:35,550 --> 00:16:39,660 And then it's these are all the different groups that are some of these come by default. 181 00:16:40,020 --> 00:16:41,270 There's the Carlyle Group. 182 00:16:41,280 --> 00:16:45,540 There's the user group that was created when I created the account. 183 00:16:46,230 --> 00:16:49,590 You can actually add groups manually yourself as well. 184 00:16:50,640 --> 00:16:52,200 Let's go ahead and look at the. 185 00:16:56,570 --> 00:17:00,110 The Group Shadow file, which is essentially the. 186 00:17:01,760 --> 00:17:02,900 Password for any of the groups. 187 00:17:02,910 --> 00:17:09,500 We don't have any because you see this exclamation point, that means there's no password set for that 188 00:17:09,500 --> 00:17:10,280 particular group. 189 00:17:11,120 --> 00:17:14,060 So if you wanted to set a password, you could do that. 190 00:17:21,160 --> 00:17:28,870 So now let's look at managing different users and groups so we can modify existing accounts with several 191 00:17:28,870 --> 00:17:29,800 different commands. 192 00:17:32,800 --> 00:17:38,920 If you're logged in as a regular user, you can change your password, which will in turn update the 193 00:17:38,920 --> 00:17:40,090 Etsy shadow file. 194 00:17:40,600 --> 00:17:42,370 So let's go ahead and look at this real quick. 195 00:17:43,150 --> 00:17:50,710 Let's look at the shadow file from the perspective of our user one accounts and notice that the hash 196 00:17:50,710 --> 00:17:54,440 ends in a1ab you want. 197 00:17:54,460 --> 00:17:56,740 So let's, let's keep track of that VI. 198 00:17:57,040 --> 00:17:59,170 And what we're going to do is we're going to go ahead and password. 199 00:17:59,860 --> 00:18:01,240 We're going to change the password. 200 00:18:02,300 --> 00:18:04,370 That user to something else. 201 00:18:06,240 --> 00:18:09,270 And when we do that, it should also change. 202 00:18:10,390 --> 00:18:13,420 That hashtag, you know, we got the prompter. 203 00:18:13,420 --> 00:18:15,370 The password was updated successfully. 204 00:18:15,790 --> 00:18:20,950 Let's go ahead and cat out the shadow file of the new password. 205 00:18:23,850 --> 00:18:27,300 And then as we got a different value this time. 206 00:18:38,110 --> 00:18:42,220 So you're always going to in the case of the. 207 00:18:44,130 --> 00:18:49,380 You want to make sure that your password is long enough so that it is not easily accessible, but also 208 00:18:49,380 --> 00:18:55,400 that it's long enough that there's less chance of there being another user that uses the same password. 209 00:18:55,590 --> 00:19:00,510 Sometimes users may use the same password, and that's just going to happen because the natural order 210 00:19:00,510 --> 00:19:01,050 of things. 211 00:19:01,560 --> 00:19:04,110 So that's how an individual user changes their password. 212 00:19:05,400 --> 00:19:12,750 What if you want to change the full name of something, for example, or the finger information? 213 00:19:12,750 --> 00:19:17,190 So there's the finger command, which is the data that's stored in the ETSI password file. 214 00:19:17,880 --> 00:19:18,390 So. 215 00:19:20,340 --> 00:19:21,450 If we wanted to. 216 00:19:22,990 --> 00:19:24,570 Finger a particular user. 217 00:19:26,630 --> 00:19:29,360 And it would return back that user's information. 218 00:19:34,500 --> 00:19:42,870 Only the root can run this CHF and command or change full name or real username and information. 219 00:19:42,870 --> 00:19:47,370 So this could be the full name, the office number, the route, the phone number, all the stuff that 220 00:19:47,370 --> 00:19:52,620 we put in with the default account or when we created the account and. 221 00:19:53,700 --> 00:19:58,020 Essentially the default configuration is to keep users from changing their name. 222 00:19:58,050 --> 00:19:59,280 Of course, Root can do it. 223 00:20:02,530 --> 00:20:05,820 And there's different flags with CHF. 224 00:20:05,860 --> 00:20:07,480 And so if you wanted to change. 225 00:20:10,290 --> 00:20:11,160 The full name. 226 00:20:16,230 --> 00:20:17,730 You could change the room number. 227 00:20:18,060 --> 00:20:20,130 Maybe you just want to change the work number. 228 00:20:20,670 --> 00:20:25,080 And of course, there's always if you forget how to use a command, there's. 229 00:20:26,830 --> 00:20:29,380 Usually you can type dash help. 230 00:20:29,770 --> 00:20:32,590 Now some commands won't have the dash help. 231 00:20:33,620 --> 00:20:34,960 In this case, we have the dash. 232 00:20:34,960 --> 00:20:40,240 Oh, it's a little bit of a shorter abbreviation of the command van. 233 00:20:42,020 --> 00:20:44,240 Using the main page or the manual page. 234 00:20:48,770 --> 00:20:55,970 So let's go ahead and change the name of either one. 235 00:21:01,900 --> 00:21:05,710 Now let's say let's maybe we want to change the the room. 236 00:21:13,470 --> 00:21:18,570 Now let's go ahead and look at the change age command or the C h age command, depending on how you 237 00:21:18,570 --> 00:21:19,260 want to pronounce it. 238 00:21:20,190 --> 00:21:20,790 So. 239 00:21:22,740 --> 00:21:27,960 The Change Age Command allows the administrator to change the password expiration settings, bypassing 240 00:21:27,960 --> 00:21:29,220 the username as an argument. 241 00:21:35,680 --> 00:21:37,180 So we'll look at the main page. 242 00:21:44,050 --> 00:21:46,060 So you give it the options and the long end. 243 00:21:46,060 --> 00:21:49,060 You can actually say what the last day. 244 00:21:51,640 --> 00:21:54,610 More of their password was changed. 245 00:21:55,030 --> 00:21:56,680 You could set an expiration date. 246 00:21:58,630 --> 00:22:02,200 You can set a certain number of days before it's locked. 247 00:22:06,730 --> 00:22:08,770 So there's the information on user one. 248 00:22:09,580 --> 00:22:10,730 It doesn't expire. 249 00:22:10,750 --> 00:22:11,770 It's inactive. 250 00:22:12,220 --> 00:22:12,840 Never. 251 00:22:13,240 --> 00:22:15,850 And the maximum and minimum number of days. 252 00:22:21,440 --> 00:22:26,450 So if you wanted to change the age of the password, you could set a minimum password. 253 00:22:26,450 --> 00:22:26,840 Age. 254 00:22:32,810 --> 00:22:35,960 And we could set a maximum pass range we could set it to. 255 00:22:41,670 --> 00:22:49,110 The last password change and we have password expiration warning, we'll leave it the defaults and when 256 00:22:49,110 --> 00:22:56,520 it goes inactive and we can just view the information now and see that all of our changes were just 257 00:22:56,520 --> 00:22:56,850 made. 258 00:22:57,780 --> 00:22:59,580 So you can do that with any accounts. 259 00:23:01,780 --> 00:23:02,680 You can also. 260 00:23:04,180 --> 00:23:07,660 Require a users account to expire, for example. 261 00:23:08,140 --> 00:23:13,630 So the system administrator, you might have to enforce password changing policies for a period of time. 262 00:23:16,340 --> 00:23:19,550 So no other unauthorized users can view this information. 263 00:23:20,150 --> 00:23:22,880 Only the root user or somebody that can sudo to root. 264 00:23:23,570 --> 00:23:26,420 So let's go ahead and do a password 265 00:23:29,420 --> 00:23:36,440 dashi and then we'll put in the user account user one and we've just now set that account to expire. 266 00:23:36,920 --> 00:23:43,340 So when that user tries to log in the next time, they should have to enter a new password. 267 00:23:45,100 --> 00:23:48,700 Those are useful tools for managing individual user accounts. 268 00:23:53,830 --> 00:23:56,230 Now let's look at managing users and groups. 269 00:23:56,230 --> 00:24:01,510 So maybe you might want to disable or enable a user's accounts. 270 00:24:01,900 --> 00:24:07,780 From a system administrator perspective, you might want to lock an account for somebody that's temporarily 271 00:24:07,780 --> 00:24:13,090 leaving or maybe somebody is moving to a new project and they don't need that particular account anymore. 272 00:24:17,200 --> 00:24:20,770 Because you don't want them to build a modified delete or add files. 273 00:24:21,460 --> 00:24:27,130 There's also so the dash you flag under the password command allows you to unlock. 274 00:24:27,490 --> 00:24:31,480 So you lock it with the dash l command and unlock it with the dash you use. 275 00:24:31,510 --> 00:24:33,100 Let's go back to our virtual environment. 276 00:24:34,000 --> 00:24:35,560 Let's go ahead and password. 277 00:24:35,680 --> 00:24:38,200 Dash l user one. 278 00:24:39,370 --> 00:24:41,020 And we've now walked out of. 279 00:24:42,130 --> 00:24:43,540 Let's do password. 280 00:24:44,950 --> 00:24:47,170 You use your alarm. 281 00:24:48,670 --> 00:24:49,420 And so. 282 00:24:55,020 --> 00:24:55,830 From time to time. 283 00:24:55,830 --> 00:25:02,250 Let's go ahead and add another user account just because we can add user to 284 00:25:05,700 --> 00:25:06,540 password here. 285 00:25:14,140 --> 00:25:15,400 Give it some information 286 00:25:23,470 --> 00:25:24,200 and that's it. 287 00:25:24,220 --> 00:25:25,660 Yes, the information is correct. 288 00:25:26,080 --> 00:25:26,710 So let's go ahead. 289 00:25:26,710 --> 00:25:29,800 And do you want to lock that nucleus created? 290 00:25:35,530 --> 00:25:36,370 And there we go. 291 00:25:41,770 --> 00:25:43,690 So that user tries to log in. 292 00:25:47,530 --> 00:25:53,050 So we can still switch on the active session, but that won't take effect until the next time that they 293 00:25:53,050 --> 00:25:53,530 log in. 294 00:25:55,900 --> 00:25:59,080 So these are important things to know when you're managing users. 295 00:25:59,320 --> 00:26:00,640 Now, what about groups? 296 00:26:00,730 --> 00:26:05,620 Let's talk about managing groups so each user could be a member of many different groups. 297 00:26:05,620 --> 00:26:10,480 You might have a group for one particular department or another. 298 00:26:11,840 --> 00:26:21,650 And you have the need to switch around users amongst different departments as necessary so you can change 299 00:26:22,010 --> 00:26:22,490 the. 300 00:26:24,010 --> 00:26:29,080 User ID command or the user ID variable and also the group ID variable. 301 00:26:29,720 --> 00:26:33,220 Let's go ahead and look at a user and see what the ID command does for us. 302 00:26:33,820 --> 00:26:37,060 So we have, first of all, look at the main page. 303 00:26:37,430 --> 00:26:41,040 So this will print out the real and effective user and group IDs. 304 00:26:41,770 --> 00:26:45,370 So let's do ID user one. 305 00:26:45,370 --> 00:26:50,590 We can see that it's 1001 as the user ID or UID variable. 306 00:26:50,590 --> 00:26:52,780 It's 1001 for the group ID. 307 00:26:54,800 --> 00:26:56,390 And the groups that it's a member of. 308 00:27:03,690 --> 00:27:07,440 Now, let's say maybe we want to add a group. 309 00:27:10,630 --> 00:27:11,290 To the system. 310 00:27:11,290 --> 00:27:12,640 So let's use the ad group. 311 00:27:16,230 --> 00:27:17,810 First of all, look at the man page 312 00:27:22,910 --> 00:27:29,630 on some like Cicero's group, ad or ad group in this case, ad group or ad user. 313 00:27:29,660 --> 00:27:31,250 They're all part of the same command family. 314 00:27:31,580 --> 00:27:32,090 So we can. 315 00:27:33,380 --> 00:27:37,880 Modify these commands inside of the add user dot config final. 316 00:27:38,600 --> 00:27:45,110 But essentially if you don't give it any other options, it'll just set up each user group as a default. 317 00:27:45,530 --> 00:27:46,700 So let's go ahead and do 318 00:27:50,750 --> 00:27:50,900 so. 319 00:27:50,900 --> 00:27:54,080 We've added a new user group and notice it created a new group ID 320 00:27:57,590 --> 00:27:58,850 and we can use the. 321 00:28:03,230 --> 00:28:07,160 So let's say maybe we want to delete that group. 322 00:28:11,630 --> 00:28:17,420 So we use the little group user group command, and now that group is gone. 323 00:28:23,760 --> 00:28:29,370 So this is we can also look at if you put the ID command and don't put any parameters after it. 324 00:28:29,580 --> 00:28:33,450 In addition, return the ID for the user that it's actually logged in as. 325 00:28:35,400 --> 00:28:38,490 So notice that now user one is required to change the password. 326 00:28:39,540 --> 00:28:41,190 So we're going to change it to 327 00:28:44,010 --> 00:28:44,850 something else. 328 00:28:51,220 --> 00:28:56,290 First we have to enter our most current password and then we're going to change it to a new one. 329 00:29:00,790 --> 00:29:06,370 So it must use a longer password to note that it does require password complexity requirements. 330 00:29:08,220 --> 00:29:09,100 So we're going to do 331 00:29:17,620 --> 00:29:19,270 notes that accepted the password. 332 00:29:22,070 --> 00:29:26,980 We can cat out the ETSI password, e-verify or I'm sorry, the etsi shadow. 333 00:29:27,760 --> 00:29:29,140 There's the etsi password file. 334 00:29:29,150 --> 00:29:33,130 You can see the new user that was created. 335 00:29:35,790 --> 00:29:38,050 Let's go in cat off the shadow file. 336 00:29:38,350 --> 00:29:40,270 Notice we can't cat it out because we're not. 337 00:29:40,300 --> 00:29:42,700 Root So we're going to have this pseudo. 338 00:29:43,860 --> 00:29:44,430 The root, 339 00:29:48,400 --> 00:29:51,180 and that is that user one is not in that file. 340 00:29:51,180 --> 00:29:52,950 So we'll come to that back to that in a minute. 341 00:29:53,550 --> 00:29:55,320 Let's go and switch back over to Root. 342 00:30:06,670 --> 00:30:13,460 But we have to do it with the Callaway command or the Callaway user because that users in the zero file 343 00:30:14,400 --> 00:30:14,850 so. 344 00:30:16,350 --> 00:30:17,560 So we can add groups. 345 00:30:17,580 --> 00:30:20,610 Let's go ahead and add another group. 346 00:30:26,570 --> 00:30:29,990 Well, call this group, H.R.. 347 00:30:33,050 --> 00:30:38,950 Well, I had a group for sales and maybe we'll use those in a future lecture. 348 00:30:38,950 --> 00:30:44,380 So add a group and delete group if we want to modify the group once we've created it. 349 00:30:44,380 --> 00:30:55,990 That's the group mod command so we can modify the group I.D. We can modify the name, we can change 350 00:30:55,990 --> 00:30:56,890 the password. 351 00:30:59,760 --> 00:31:01,410 And different other things. 352 00:31:01,420 --> 00:31:05,490 So the group information as we know is in the AC DC shadow file. 353 00:31:16,350 --> 00:31:19,380 So we didn't give it any chance to actually make the change. 354 00:31:19,890 --> 00:31:28,650 If you do group mod, if you mistyped the command or you type it in the wrong case, you won't get the 355 00:31:28,650 --> 00:31:32,370 actual any response back. 356 00:31:32,880 --> 00:31:34,710 So let's go ahead and change the name. 357 00:31:50,690 --> 00:31:53,300 Oh, add that syntax backwards. 358 00:31:54,620 --> 00:31:59,240 So when you're changing the name of your modifying, you have to put the what you want to change it 359 00:31:59,240 --> 00:32:00,980 to first, then the actual group 360 00:32:04,400 --> 00:32:05,150 and now. 361 00:32:10,320 --> 00:32:11,420 We should be able to. 362 00:32:14,350 --> 00:32:21,250 Return that information and we'll see the actual ruthlessness there. 363 00:32:32,660 --> 00:32:38,450 So if we want to do a add a user to a particular group, we can do that. 364 00:32:39,230 --> 00:32:42,740 We just have to use a different command called the User Mod Command. 365 00:32:43,190 --> 00:32:46,340 So let's go ahead and add a user to a particular group. 366 00:32:49,390 --> 00:32:55,120 And the to the screen, there's the user mod command. 367 00:32:55,120 --> 00:32:57,430 So it tells us we can modify the user account. 368 00:32:57,880 --> 00:33:03,880 So if we want to append that user to a group, we use that with the dash g option for the group name. 369 00:33:04,900 --> 00:33:05,650 You can. 370 00:33:07,360 --> 00:33:08,470 Change the comments. 371 00:33:08,770 --> 00:33:15,250 You can do different things with the user account, make it interactive, you can change the password, 372 00:33:15,940 --> 00:33:17,270 you could change the user shell. 373 00:33:17,290 --> 00:33:20,710 There's a lot of things you can do with this command, but right now we're going to focus just on the 374 00:33:20,710 --> 00:33:21,040 group. 375 00:33:21,550 --> 00:33:26,440 We're going to do user mod, dash a, dash g, and we're going to put in. 376 00:33:28,040 --> 00:33:29,900 The actual group that we want to change do. 377 00:33:36,790 --> 00:33:44,170 Which is going to be the user group and we're going to add user one to that user group. 378 00:33:45,880 --> 00:33:47,620 And so we don't have that user. 379 00:33:47,650 --> 00:33:47,980 All right. 380 00:33:47,980 --> 00:33:50,530 We changed the we changed the name, didn't we? 381 00:33:51,190 --> 00:33:53,250 So we got to make it new user group. 382 00:33:54,550 --> 00:33:59,680 And now that user account has been added to that group. 383 00:34:03,110 --> 00:34:07,730 So let's add the other user account we created to a different group. 384 00:34:08,090 --> 00:34:13,280 User might dash a dash g or add the user to to the group. 385 00:34:14,740 --> 00:34:15,610 And there we go. 386 00:34:19,010 --> 00:34:25,370 And with the group's demand, we can see what users are and which groups. 387 00:34:26,090 --> 00:34:33,230 So let's go ahead and do groups and with the user one and we'll see that user one is part of new user 388 00:34:33,230 --> 00:34:33,620 group. 389 00:34:34,160 --> 00:34:39,920 We'll do the group's demand for user two and we'll see that they're part of the group. 390 00:34:40,340 --> 00:34:43,910 So our commanders are accessible and that's what we wanted to happen. 391 00:34:44,600 --> 00:34:50,170 Now let's talk about configuring services inside of our Kellie Linux distributions. 392 00:34:50,180 --> 00:34:55,280 That's important because at some point we may want to look at different services that are running. 393 00:34:56,480 --> 00:35:03,950 If we do the Command D package with a uppercase L and a package name, it will list us all the files 394 00:35:03,950 --> 00:35:05,900 that are included in that particular package. 395 00:35:06,710 --> 00:35:14,840 So make sure the screen you package dash l just one dash, not multiple. 396 00:35:16,370 --> 00:35:21,950 And because Linux is case sensitive, I want to make sure that we're following the convention and there's 397 00:35:21,950 --> 00:35:25,490 all the different packages that are part of the TCP command. 398 00:35:26,150 --> 00:35:29,180 Let's say maybe I wanted to find out what all the packages are. 399 00:35:29,600 --> 00:35:31,730 As part of Wireshark, I can do that. 400 00:35:32,840 --> 00:35:34,730 So that's the Dash l command. 401 00:35:35,570 --> 00:35:38,240 See if I can zoom in a little bit to make this. 402 00:35:39,920 --> 00:35:42,500 A bit bigger for you guys. 403 00:35:48,280 --> 00:35:54,730 So we have the D package dash s command, which will show us any metadata that also comes with that 404 00:35:54,730 --> 00:35:57,100 package or any requirements. 405 00:35:57,190 --> 00:36:05,470 So for example, if the installs Okay or 30 things that it might need to be able to function. 406 00:36:06,220 --> 00:36:11,440 And that tells you a little bit about the package itself and what the package actually does. 407 00:36:12,040 --> 00:36:14,020 Let's go and look at the main page. 408 00:36:15,520 --> 00:36:20,340 Z packages an important program to understand. 409 00:36:20,350 --> 00:36:24,550 It is a package manager for Debian or debian based Linux. 410 00:36:25,750 --> 00:36:26,970 Obviously if you want to. 411 00:36:29,230 --> 00:36:30,520 Be able to understand. 412 00:36:33,170 --> 00:36:35,480 The descriptions are not going to be useful. 413 00:36:35,480 --> 00:36:38,300 So I always consult the software developers. 414 00:36:39,730 --> 00:36:46,050 Documentation, but you have the main pages and you also have the RD package command. 415 00:36:46,590 --> 00:36:52,530 So you can see if there are any packages that have been held for installation. 416 00:36:52,890 --> 00:36:56,820 You can actually force commands to packages to install. 417 00:36:56,820 --> 00:37:00,990 You can remove packages install even with DX package. 418 00:37:04,600 --> 00:37:06,070 And many, many other things. 419 00:37:12,810 --> 00:37:14,340 So let's talk about services. 420 00:37:14,640 --> 00:37:16,770 So we want to be able to work with services. 421 00:37:17,880 --> 00:37:23,160 That's changed a little bit in Lennox of some of the newer versions, but it's important to understand 422 00:37:23,160 --> 00:37:24,810 both ways to. 423 00:37:25,820 --> 00:37:26,960 How to run services. 424 00:37:27,080 --> 00:37:33,950 Services run as from configuration files in the case of as a sage or secure shell. 425 00:37:34,430 --> 00:37:39,710 Sage allows you to remotely log in to a machine transfer files and run commands. 426 00:37:40,040 --> 00:37:44,180 So the tool is sage or sometimes called open access. 427 00:37:44,180 --> 00:37:52,040 H, but it runs a service called the SS H Damon and open SS age is installed by default, but the SS 428 00:37:52,040 --> 00:37:53,450 H service is disabled. 429 00:37:54,020 --> 00:37:58,280 So let's go ahead and get that service started. 430 00:37:58,700 --> 00:38:02,840 We're going to use the system ctrl command start ss h. 431 00:38:04,580 --> 00:38:08,930 And we should system CTL status. 432 00:38:10,700 --> 00:38:17,390 SSA should see that in fact, running services server is running by vendor. 433 00:38:17,390 --> 00:38:18,890 It's supposed to be disabled. 434 00:38:20,650 --> 00:38:28,690 We can also set it if we want it to run en route by using the system ctrl command enable as h. 435 00:38:29,440 --> 00:38:32,920 So notice it's going to write that information or that script. 436 00:38:33,400 --> 00:38:34,120 So when. 437 00:38:35,940 --> 00:38:41,550 Kelly Lennox, boots up, sage will automatically be available, which is particularly useful, especially 438 00:38:41,550 --> 00:38:47,730 if you're going to be moving in and out of command shells and doing other things with your Linux distribution 439 00:38:49,080 --> 00:38:51,120 to clear the screen. 440 00:39:00,480 --> 00:39:08,220 So these same results can be gotten by using the service as a sage status command or essentially service, 441 00:39:09,240 --> 00:39:14,650 and then the name of the service and then status. 442 00:39:14,670 --> 00:39:16,920 So any command can be pretty much gone. 443 00:39:17,040 --> 00:39:23,280 You can also do service status all in older distributions. 444 00:39:28,410 --> 00:39:32,310 So in some cases, some versions of Linux will have different commands. 445 00:39:32,640 --> 00:39:39,060 So if you type the service, the staff status, all, it'll return all the services. 446 00:39:40,800 --> 00:39:42,600 It are running and it has a plus sign. 447 00:39:42,930 --> 00:39:44,760 I mean, it's actually running. 448 00:39:45,870 --> 00:39:48,710 So in here there's a plus sign next to SSA. 449 00:39:48,730 --> 00:39:52,560 So it's currently running, but any one of these other services can be called. 450 00:39:54,070 --> 00:39:55,690 So we will come back to this command. 451 00:39:56,020 --> 00:40:01,630 But I definitely want you to understand how to stop and start services, because from a security perspective, 452 00:40:01,630 --> 00:40:07,240 services can help you or they can also give you a way if you're doing a particular type of. 453 00:40:08,470 --> 00:40:09,080 Pen test. 454 00:40:11,080 --> 00:40:14,200 So as the stage runs the stage. 455 00:40:14,230 --> 00:40:18,160 Damon And then we can configure different things. 456 00:40:18,340 --> 00:40:29,020 Many servers will have SSD keys stored in the tell the slash dot SSA directory stage listens by default 457 00:40:29,020 --> 00:40:29,920 on port 22. 458 00:40:29,920 --> 00:40:32,140 But we can we can change that. 459 00:40:34,860 --> 00:40:42,120 But if you change the Sage Zaman egg file, you have to reload the service or restart the service. 460 00:40:42,900 --> 00:40:44,550 So let's go ahead and clear the screen. 461 00:40:45,670 --> 00:40:46,570 And we're going to go ahead. 462 00:40:46,570 --> 00:40:51,640 And what we're going to do is we're going to go ahead and generate some SSD guys with the SSD Key Gen 463 00:40:52,420 --> 00:40:53,050 Command. 464 00:40:54,340 --> 00:40:55,390 And what that will do. 465 00:40:55,390 --> 00:40:57,370 We can actually specify parameters. 466 00:40:58,030 --> 00:41:03,370 We don't have to, but it just makes it a little more complicated. 467 00:41:03,880 --> 00:41:06,280 But there's no there's no requirement to do so. 468 00:41:09,090 --> 00:41:16,830 If we press enter, it's going to generate a public private RSA key player RSA as the encryption algorithm 469 00:41:17,670 --> 00:41:20,880 named after the people who created it, Shamir and Adelman. 470 00:41:21,240 --> 00:41:25,190 And it's going to ask you, what final do you want to see the key in? 471 00:41:25,200 --> 00:41:32,070 So it's going to give you the root Slashdot Sage directory and then the name of the key. 472 00:41:32,640 --> 00:41:36,270 So you can just leave it default, hit, enter and it created that directory. 473 00:41:36,780 --> 00:41:40,140 And if you want a passphrase to add some extra randomness, that's fine. 474 00:41:40,530 --> 00:41:42,000 If not, we're not going to worry about it. 475 00:41:42,000 --> 00:41:47,910 So notice it tells you where your ID is saved at your public key. 476 00:41:48,570 --> 00:41:55,020 And then it also does a SHA256 hash of that key and some random ASCII art that goes to it. 477 00:41:55,410 --> 00:41:59,280 But if we got out to the screen 478 00:42:01,860 --> 00:42:03,780 in the SS directory 479 00:42:07,740 --> 00:42:11,520 that put a tilde in there, there's our open SSL private key. 480 00:42:12,180 --> 00:42:14,370 So we actually just created that ourselves. 481 00:42:14,370 --> 00:42:18,630 This is not one we've obtained from a server, but it's very common. 482 00:42:18,630 --> 00:42:24,990 You might need to create an SS key to be able to log in securely to a virtual machine or to a web server 483 00:42:24,990 --> 00:42:26,040 or something like that. 484 00:42:28,340 --> 00:42:35,930 If we change to that directory next to the screen and we'll do the last command will notice, there's 485 00:42:35,930 --> 00:42:37,730 your public key and your private key. 486 00:42:38,090 --> 00:42:39,230 So the private key 487 00:42:43,010 --> 00:42:44,060 is much shorter. 488 00:42:44,690 --> 00:42:48,710 And it also gives the I'm sorry, the public key is much shorter. 489 00:42:48,710 --> 00:42:53,180 So when you log into a server, you might see other users public. 490 00:42:53,180 --> 00:42:55,970 He's in this particular folder. 491 00:42:56,480 --> 00:43:00,560 So this is very, very common and it's an important concept to understand. 492 00:43:04,560 --> 00:43:06,930 So let's go look at the SSA config file. 493 00:43:15,720 --> 00:43:21,120 So we're going to look in the Etsy Association directory so we can see the Essence HD on our store config 494 00:43:21,120 --> 00:43:21,480 file. 495 00:43:22,050 --> 00:43:28,650 And we're going to edit that with a text editor in this case, Vim. 496 00:43:32,360 --> 00:43:39,460 And we can see it's pointed to a particular path of where it wants to look. 497 00:43:39,540 --> 00:43:41,390 So this is the system wide file. 498 00:43:42,080 --> 00:43:46,580 In this case, we can notice everything that's in blue. 499 00:43:46,580 --> 00:43:48,050 These are all commented out. 500 00:43:48,300 --> 00:43:52,430 If there's no hash tag in front of it, that means that it's enabled. 501 00:43:52,880 --> 00:43:58,240 So you can make some changes here, such as the default port that you wanted to run on. 502 00:43:58,250 --> 00:44:03,200 So you can uncomment this line by pressing the answer key. 503 00:44:03,650 --> 00:44:05,420 And we could actually change the port. 504 00:44:06,920 --> 00:44:09,890 And notice the syntax also highlighted with it as well. 505 00:44:10,370 --> 00:44:14,600 So maybe you wanted to change it to a higher level port number, for example. 506 00:44:32,130 --> 00:44:35,800 So maybe we want it to be 49,102 or something like that. 507 00:44:36,310 --> 00:44:39,760 So we make our change, we hit the escape, we write it to the file. 508 00:44:40,300 --> 00:44:43,720 And then we're going to have to do we're going to have to change. 509 00:44:49,020 --> 00:44:50,640 We're going to have to reload the config. 510 00:44:58,410 --> 00:44:58,740 But 511 00:45:02,460 --> 00:45:03,150 and there we go. 512 00:45:03,210 --> 00:45:07,440 See, it's active and it's running and it will be talking on. 513 00:45:09,840 --> 00:45:10,920 A different port. 514 00:45:13,590 --> 00:45:15,000 So let's go ahead and exit out. 515 00:45:16,320 --> 00:45:19,050 Now we're going to talk about some of the. 516 00:45:21,400 --> 00:45:23,470 Databases that you might see on telly. 517 00:45:23,470 --> 00:45:28,450 One x PostgreSQL is a database server, it's relational database. 518 00:45:28,450 --> 00:45:34,790 Some services will access the database over the network and might need authentication from the database. 519 00:45:34,800 --> 00:45:43,720 So if we want to start the database, we'll have to go into our command line and we can query that service 520 00:45:44,440 --> 00:45:45,190 just like we can. 521 00:45:45,190 --> 00:45:45,820 Anything else? 522 00:45:45,820 --> 00:45:47,770 I'm going to change back to the home directory. 523 00:45:52,110 --> 00:45:57,420 And we're going to use the service Oscar sequel status. 524 00:45:58,530 --> 00:46:01,140 We can see that it's loaded, but it's not currently running. 525 00:46:01,650 --> 00:46:04,490 You can do the same thing with the system Ctrl command. 526 00:46:07,290 --> 00:46:15,810 So if we want to start, we can start the Postscript Sequel Service and it'll take a moment and then 527 00:46:15,810 --> 00:46:18,720 that database will be open by default. 528 00:46:19,260 --> 00:46:28,950 Postscript Sequel Lessons on TCP Port 5432 and on that particular socket in the VAR Ron Postscript sequel 529 00:46:28,950 --> 00:46:29,580 directory. 530 00:46:41,160 --> 00:46:44,160 Let's throw a change to the wrong directory. 531 00:46:47,640 --> 00:46:51,150 And there's the PostgreSQL directory 532 00:46:54,240 --> 00:46:56,080 and we can see some different things in here. 533 00:46:56,130 --> 00:47:03,990 Notice it has a lock on the file and it's calling because we don't want to have mistakes made or unauthorized 534 00:47:03,990 --> 00:47:04,680 changes made. 535 00:47:04,680 --> 00:47:10,800 So there is a in the AC directory as where most of the configuration is. 536 00:47:17,790 --> 00:47:19,900 So we can see in here in. 537 00:47:21,350 --> 00:47:21,690 Okay. 538 00:47:24,680 --> 00:47:26,180 This is version 12. 539 00:47:26,690 --> 00:47:30,800 And we can see here there's the different config files with Postgres. 540 00:47:30,800 --> 00:47:36,830 The Postgres sequel, not config file is kind of carried it out to the screen so you can see what it 541 00:47:36,830 --> 00:47:37,370 looks like. 542 00:47:37,970 --> 00:47:42,890 I may not have to mess with it too much unless you're doing some customized operations. 543 00:47:45,980 --> 00:47:53,270 But essentially the PGA underscore HPR dot config file will define who's allowed to connect and how 544 00:47:53,270 --> 00:47:54,170 they're authenticated. 545 00:47:57,330 --> 00:48:01,050 So you can set up if you want, customize extensions here. 546 00:48:08,010 --> 00:48:12,030 So if you want, this is kind of almost like your firewall, for example. 547 00:48:12,300 --> 00:48:14,130 Where do you want to allow connections? 548 00:48:14,570 --> 00:48:17,760 Of course you don't want to disable the rules. 549 00:48:18,630 --> 00:48:21,000 These are just the different networks from which. 550 00:48:23,760 --> 00:48:28,140 If you want to allow connections that are non-local, you have to add more hosted records. 551 00:48:38,660 --> 00:48:41,870 So let's talk about some more configuring the services. 552 00:48:41,870 --> 00:48:47,930 So services like Metasploit and others require the PostgreSQL service. 553 00:48:49,610 --> 00:48:50,060 And. 554 00:48:51,710 --> 00:48:56,870 PostgreSQL allows for multiple versions of the database to be installed and what they call clusters. 555 00:48:57,680 --> 00:49:02,810 You can actually create new users with respect to PostgreSQL. 556 00:49:07,120 --> 00:49:11,320 And new roles so we can switch over to the. 557 00:49:14,230 --> 00:49:15,610 Postscript User account. 558 00:49:18,710 --> 00:49:27,970 And we're going to say we want to go ahead and create user mindset for Metasploit framework, be that 559 00:49:27,980 --> 00:49:32,570 apps that are ready, that's going to ask for a new password. 560 00:49:37,740 --> 00:49:38,720 And there we go. 561 00:49:38,730 --> 00:49:40,560 So we've created a new user account. 562 00:49:43,850 --> 00:49:45,640 Notice I didn't type exit properly. 563 00:49:45,650 --> 00:49:49,160 I type it in all caps, so it did not work correctly. 564 00:49:49,160 --> 00:49:51,470 So if you wanted to drop that user. 565 00:49:54,700 --> 00:49:55,390 You could do that. 566 00:49:55,420 --> 00:49:56,320 There's also the. 567 00:50:02,560 --> 00:50:05,260 So we need to remove our PostgreSQL account. 568 00:50:07,140 --> 00:50:15,270 Of course, only super users and users that have the appropriate role in remove PostgreSQL accounts. 569 00:50:15,570 --> 00:50:17,490 So of course you have to be able to sudo to root. 570 00:50:18,510 --> 00:50:22,260 You can also use you can create databases. 571 00:50:26,280 --> 00:50:29,330 Let's go ahead and do that. 572 00:50:30,240 --> 00:50:34,980 So if you want to create a new Postgres database, you'd give it a connection option. 573 00:50:35,640 --> 00:50:39,140 The normal way, if you're the one creating it, you'll be the owner. 574 00:50:39,150 --> 00:50:41,010 Unless you want to specify a different. 575 00:50:42,850 --> 00:50:48,550 Database type, you can put the location, the version number, many other things. 576 00:50:48,550 --> 00:50:51,430 There's usually some different options. 577 00:50:54,190 --> 00:50:56,830 So you could set it to be on a certain court number. 578 00:50:59,080 --> 00:51:02,170 In this case, we'll go ahead and create the database and just call it demo. 579 00:51:03,040 --> 00:51:06,790 And because we don't have route, that did not work. 580 00:51:08,710 --> 00:51:13,510 So you can see that the new versions of Kelly have locked it down somewhat, but just know that this 581 00:51:13,510 --> 00:51:16,120 is basically the same process that you're going to follow. 582 00:51:19,010 --> 00:51:25,280 So if you want to create a new super user account, you also have to create connect as a super user, 583 00:51:25,280 --> 00:51:26,990 not just for the create role privilege. 584 00:51:27,320 --> 00:51:32,690 So if you're a super user, that means you can bypass all the service permission checks within the database. 585 00:51:32,690 --> 00:51:35,210 So you want to keep your super user control. 586 00:51:36,710 --> 00:51:38,900 Close hold should not be granted lightly. 587 00:51:39,710 --> 00:51:41,960 You can also use the drop user command 588 00:51:44,630 --> 00:51:54,290 to remove an account and you could do the drop DB command to remove a database entirely. 589 00:52:00,940 --> 00:52:06,700 So there's no real difference between creating databases from the command line and doing it from the 590 00:52:07,240 --> 00:52:08,890 graphical utility. 591 00:52:09,370 --> 00:52:13,870 But at least now you've seen multiple ways of doing this process. 592 00:52:15,010 --> 00:52:15,550 So. 593 00:52:19,040 --> 00:52:22,820 And there are some important tools to manage these different clusters. 594 00:52:23,150 --> 00:52:25,790 There is post breast create cluster, job cluster. 595 00:52:26,540 --> 00:52:30,920 There are if you want to list out the different clusters that are there. 596 00:52:38,700 --> 00:52:42,210 So these things may change from. 597 00:52:43,510 --> 00:52:44,620 Version two version. 598 00:52:49,080 --> 00:52:49,360 Yes. 599 00:52:49,410 --> 00:52:50,640 I made a typo there. 600 00:52:50,940 --> 00:52:55,260 So there's only one cluster right now listening on 5432. 601 00:52:55,770 --> 00:53:00,810 If I want it to create a cluster, we can do that. 602 00:53:06,450 --> 00:53:08,060 It was call it new. 603 00:53:08,300 --> 00:53:09,860 So you have to give it some options. 604 00:53:09,860 --> 00:53:10,530 Who owns it? 605 00:53:10,590 --> 00:53:11,540 The by the. 606 00:53:12,880 --> 00:53:16,960 So that's beyond the scope of this course, getting in too much into the weeds. 607 00:53:16,960 --> 00:53:18,220 But we will. 608 00:53:19,420 --> 00:53:27,310 So it's important to understand the different types of databases, especially as a hacker or Linux tester, 609 00:53:27,310 --> 00:53:32,390 because you may have to probe certain databases and different databases. 610 00:53:32,410 --> 00:53:36,460 Between my sequel and Postgres, they'll have slightly different commands. 611 00:53:38,890 --> 00:53:40,660 Which we may cover in future lectures. 612 00:53:41,260 --> 00:53:45,120 So how do we configure the web server? 613 00:53:45,130 --> 00:53:49,330 So besides having a database, we might have to have a web frontend component. 614 00:53:49,990 --> 00:53:56,550 Generally, Apache is the most common web server that's on the Internet. 615 00:53:56,570 --> 00:54:00,400 Most of the web services, I think like 60% of all web servers run Apache. 616 00:54:00,880 --> 00:54:08,740 So Apache created the PDP server project as an effort to be able to maintain an open source server for 617 00:54:08,740 --> 00:54:10,180 modern operating systems. 618 00:54:12,690 --> 00:54:15,030 And essentially the idea was that it would be modular. 619 00:54:15,300 --> 00:54:21,150 It would be very easy to work with and add new functionality. 620 00:54:26,740 --> 00:54:27,720 Let's see. 621 00:54:28,920 --> 00:54:35,700 And the newer version, the Linux, it's named Apache two by the version is one version 2.4, I believe 622 00:54:35,700 --> 00:54:40,230 was the latest version if you wanted to find out more information. 623 00:54:43,160 --> 00:54:44,180 About Apache, 624 00:54:47,330 --> 00:54:54,630 you can go to B, D as in it's named after the HDP Daemon. 625 00:54:55,310 --> 00:55:02,330 You could go to that particular resource and they will show you information about the latest and greatest 626 00:55:02,330 --> 00:55:04,610 versions, all the different modules. 627 00:55:04,910 --> 00:55:10,010 And you can see it's been the most popular server since the nineties and this year it celebrates its 628 00:55:10,010 --> 00:55:11,690 25th anniversary. 629 00:55:11,690 --> 00:55:16,910 So it's a, well, well-supported, well-documented web server, although from a security perspective 630 00:55:16,910 --> 00:55:21,860 that also makes it a big target because it's installed a lot of places. 631 00:55:22,340 --> 00:55:26,510 So let's go ahead and look at some things we can do with Apache. 632 00:55:36,340 --> 00:55:40,510 So we can see the same commands with the system, the versus the service commands. 633 00:55:40,840 --> 00:55:48,040 So let's go ahead and Service Apache two and let's go ahead and start it and we'll see that it'll take 634 00:55:48,040 --> 00:55:49,030 a moment and then. 635 00:55:50,230 --> 00:55:51,460 We can query it now. 636 00:55:51,470 --> 00:55:55,000 It's active and it's running and we can see that. 637 00:55:56,230 --> 00:56:03,820 If we go to a web browser inside of our Kali Linux distro, we will see a default web page. 638 00:56:05,850 --> 00:56:06,960 Let's go to our. 639 00:56:10,270 --> 00:56:15,610 Usual applications and we'll open up they have they've added in the newer versions they've added in 640 00:56:15,610 --> 00:56:17,980 chromium seven or Firefox. 641 00:56:18,430 --> 00:56:25,600 So we can have a web browser and we'll put in the local host IP address. 642 00:56:30,030 --> 00:56:35,130 Or the 120 7.0.0.1 address. 643 00:56:35,550 --> 00:56:38,310 And we'll see that we have the Apache default Web page. 644 00:56:38,940 --> 00:56:39,510 So this is. 645 00:56:39,690 --> 00:56:42,780 This shows the location of the Apache config file. 646 00:56:43,170 --> 00:56:45,810 Any ports that are open, what modules are enabled. 647 00:56:46,110 --> 00:56:49,020 So of course, you want to disable this from a security perspective. 648 00:56:49,620 --> 00:56:57,870 And most of the Apache website files will be located in the var slash w w directory. 649 00:57:00,020 --> 00:57:01,640 So let's go back to our slides here. 650 00:57:02,790 --> 00:57:03,230 So. 651 00:57:06,940 --> 00:57:13,380 Once we create Apache or once we enable Apache, it has different modules that we can use. 652 00:57:13,390 --> 00:57:15,220 We can enable mods with it. 653 00:57:15,220 --> 00:57:16,120 You can use the. 654 00:57:23,680 --> 00:57:25,930 You can use the A2 and Mod Command. 655 00:57:26,560 --> 00:57:31,660 So if you need to enable or disable an Apache module, you can do so. 656 00:57:32,590 --> 00:57:38,320 You can set it to quiet mode so it doesn't show informative methods or messages. 657 00:57:40,120 --> 00:57:43,240 There's other commands, like the Apache two controller. 658 00:57:44,530 --> 00:57:46,600 We're working with Apache Services. 659 00:57:52,060 --> 00:57:54,820 So this is the Apache server control interface. 660 00:57:54,820 --> 00:57:58,570 So it takes more simplified one word commands. 661 00:58:02,440 --> 00:58:09,790 So if you want to make quick changes to it or you want to start the Apache so you can do Apache two 662 00:58:09,790 --> 00:58:12,610 controller start. 663 00:58:16,710 --> 00:58:21,240 So it's going to invoke the system CTL command as well. 664 00:58:22,110 --> 00:58:23,100 So it's already running. 665 00:58:23,720 --> 00:58:25,680 So what if we change this to stop? 666 00:58:28,710 --> 00:58:34,110 So now we'll notice that the Apache server is no longer running. 667 00:58:36,720 --> 00:58:38,200 So let's go ahead and start it again. 668 00:58:39,390 --> 00:58:40,860 And we have our web server running. 669 00:58:43,610 --> 00:58:50,410 So on Apache and its config file, it can load what are known as virtual hosts. 670 00:58:50,420 --> 00:58:54,560 These are essentially extra identities for the web server. 671 00:58:54,560 --> 00:58:58,550 So you can have multiple hosts on a web server. 672 00:58:58,940 --> 00:59:07,670 The default virtual host is in the Apache two default config file and then every virtual host after 673 00:59:07,670 --> 00:59:10,940 that gets described by the site's available. 674 00:59:15,460 --> 00:59:23,500 So you can do a minimum virtual host for the website which is stored in the slash service slash every 675 00:59:23,540 --> 00:59:25,660 WW dot example dot com. 676 00:59:27,760 --> 00:59:31,210 Let's go ahead and look at the Apache config file. 677 00:59:45,200 --> 00:59:49,400 And there's the default Apache config, follow the default virtual host. 678 00:59:49,410 --> 00:59:53,480 So you can see that the document route is the route where all the websites go. 679 00:59:54,170 --> 00:59:55,460 You can see the server admin. 680 00:59:55,460 --> 00:59:59,000 This is the webmaster or the person that manages the website. 681 59:59.420 --> 1:00:01.580 So a lot of information can be obtained from this file. 682 1:00:01.580 --> 1:00:04.070 So you want to guard this file very carefully. 683 1:00:09.700 --> 1:00:14.100 So let's talk about some more things requiring authentication. 684 1:00:14.110 --> 1:00:21.160 So if you want to run additional directives outside of the normal Apache config file, one of the ways 685 1:00:21.160 --> 1:00:24.670 to do that is through something called an access file. 686 1:00:25.880 --> 1:00:30.200 This access file is essentially a distributed configuration file. 687 1:00:30.860 --> 1:00:36.950 So every time a request comes in, that HD access file will handle those requests. 688 1:00:36.950 --> 1:00:40.130 And this is done normally on a per directory basis. 689 1:00:40.820 --> 1:00:43.190 So you can rename access files. 690 1:00:45.080 --> 1:00:52.610 Something else using the access file name directive, and you could also allow one to be overridden 691 1:00:52.610 --> 1:00:53.300 or not. 692 1:00:54.380 --> 1:01:01.700 So in this case here, if you want to require authentication, you could require a valid user using 693 1:01:01.700 --> 1:01:05.570 the off named private directory and you could set the. 694 1:01:07.560 --> 1:01:14.730 Authentication user file app that etsi apache to all files slash hd password dash private. 695 1:01:17.810 --> 1:01:19.060 So some extra information. 696 1:01:19.070 --> 1:01:24.830 Typically, we've talked about the network manager, we've talked about command line tools. 697 1:01:25.280 --> 1:01:28.940 We've talked about different ways of managing users and group accounts. 698 1:01:29.840 --> 1:01:32.330 We've talked about adding users. 699 1:01:32.330 --> 1:01:33.820 We've talked about CCH. 700 1:01:34.310 --> 1:01:38.000 We looked at PostgreSQL as well as Apache. 701 1:01:39.540 --> 1:01:47.160 So in summary, we talked about configuring the network, the different ways with desktop command line 702 1:01:47.340 --> 1:01:48.080 using system. 703 1:01:48.930 --> 1:01:54.240 We looked at managing accounts, creating accounts, disabling accounts. 704 1:01:55.350 --> 1:02:01.350 We looked at different ways to configure services like Sage and the Apache game. 705 1:02:01.350 --> 1:02:09.810 And we we looked at PostgreSQL SQL Services, we looked at setting up Sage for remote log ins and how 706 1:02:09.810 --> 1:02:13.230 to generate sage keys for particular servers. 707 1:02:17.210 --> 1:02:25.190 And now you should be more familiar with working with daily Linux and particular services networks and 708 1:02:25.190 --> 1:02:26.150 user accounts.