Transcripts
1. Complete Linux Trianing Introduction: Hello everyone. I'm so glad that you're here. Welcome to my course, complete Linux training course to get your dream IT job. Now let me put it in a very simple way. When you take this course, you will learn as so many things about Linux that you're going to be able to apply for a Linux job and you will get the job. Fair enough. My name is Enron absolute, and I've been in IT specifically in Linux field more than two decades now. I have actually work in New York City for fashion industry, for tech media firms, for financial firms, for cloud and hosting companies, you name it. I did complete my Bachelors in Computer Information Systems from Baruch College City University of New York, and my MBA from New York Institute of Technology. I teach in a very simple language. I will actually hold your hand every step of the way through out this course and I will make sure you understand everything. There are so many of my students who actually took this course and they were able to pass any of the Linux certification. And they were able to get the job of their dreams. So what are you waiting for? Let's go ahead and enroll.
2. Syllabus Overview 03172020: Hello, everyone. I really request you to please give me five minutes to go over the syllabus together because once you're going to go over this entire syllabus with me, you're gonna know that this is the perfect and best course out there. All right? I have actually broken down my entire course in the tender different modules. First module is about understanding Lennox concept. We will cover about Lennox's UNIX forces Lennox. And it noticed one thing. Every module I have I I have included quizzes for you to do homework to do after each module and handouts to read. You don't really have to read each hand out, but it's good to have those resource is in your hand going on to module to wear real color , download, install and configure Actual Lennox machines will talk about virtual machine downloading That Marshall Machine will talk about What are the different ways to install a Lennix machine that will cover the actual Center West installation? I have also included the optional Red Hat Lennox installation with lecture as well, then some somewhat on Lenox test stop management on ah, we m and then again ending with quizzes, homework and handouts moving on to Module three, which is about system access and file system. And that is about command prompts accessing clinic system downloading installed putty. You need to know some important things about Lennox. I have covered that introduction to file system. What are the different file system that available, then the basic command cdp, W. D and Ellis. That's where we're going to start our Lennox command lines moving on to a file system as you're going to see. I'm going to skip him very fast, so you'll review and go over it directly. Listing Touch copy commands. Finding files in directory wildcard Softly Carling Quizzes, homework and handouts. Then module for is about Lennox. Fundamentals Commands Index Change, Mont. This is all about permission to file permission. Also, a C l can access control, which is a detail getting into the Leeds getting help. Tab completion. Adding text of the file pipes file management commands, display command filters, command compare filed so many commands we're gonna learn in module, for that is about links fundamental and combine explaining Foz Lennox forces windows and, of course, quizzes, homework and hand out module five System Administration Getting evermore into the actual administration part, we'll talk about how we could v i a file difference between via and when they said it, which is substitution command. We'll talk budges account management pseudo account. How are you? Command your links users through active directory or through the other at third party. Ah, authentication. We'll also talk about difference between LDA Aldo idea and went by and open held up. Then they will talk about system utility commands Always maintenance command changing system hosting, finding system information Recover root password S. O s report environment Very but ah, lot more. I'm already getting out of breath and we still are. Module five moving on to module six. We'll talk about all about shell scripting. I'll show you if Transcript four loose groups do wild scripts and many script module seven networking servers and the system updates. We'll talk about networking companies bonding network ports, downloading files from the Internet as a sage. Worse is ah, 10 lead will talk about DNS host name? Ah and I P Look up. Anti peak Ronnie descend male And all these services that you see, I'm not just gonna go were real quickly. I'm actually gonna work with you to go ahead a dollar in silent configure each of these servers. Then modulate is all about disk management will talk about run levels will talk about this partitions. L V M is the biggest part of this Where we're gonna cover everything about L V m. Adding disk. Removing this. We're gonna talk about extending the existing petition swap space raid for a system check. NFS complete. Big topic of on NFS at comfort. I covered everything from scratch. Also covered the difference between all right. Had flavors. Marjolein. Okay, Now up until modulate everything is covered on the technical side. I'm not leaving you right here. I'm actually holding your hand and taking to Marjolein about how you should have your resume. We'll have a resident workshop cover letter exposure to other technologies. Homework handout, then Module 10. Just like resume. I am taking you to the next level where I'm gonna tell you how you should be prepared for your Lennox interviews. And that is something about Lennox. Um what is I t jobs that you have? I team management When you apply for links job. What do you need to expect then interview Bush of actual workshop, then certification. If you want to get into certification, you want to get a certification. And, Lennox, the end of you have 200 plus into the question that I'm gonna give it to you and, of course, handwork and handouts. And then, of course, recap. This is not part of the module is just a recap which we have learned from this course. And the final exam is about 100 questions. I really urge you to take that. So you could you couldn't you know that you where you stand of a discourse, that additional resources I have toe 20 plus additional videos and lecture that you could take if you want to. Now you decide. Now you be the judge is this course are really going to make a difference in your life. Well, I'll tell you. Yes, it will. So please go ahead and click on unrolled and you're gonna find tons of resource is in this course. Good luck
3. WELCOME TO MODULE 1:
4. Everyday Linux: Everyday examples of Linux. Here you will find out how Linux operating system is
used everywhere around you. Let's look at a few
examples like airplane. The inflight movies are on embedded Linux platforms,
Internet access, Internet, the WiFi Router probably
have embedded copy of Linux running for your web
management application, TV, Google search,
websites, smartphones. All loaded with Linux
operating system inside of these gadgets, tablets, of course, the eBooks, the Windows data recovery disks. Even they are Windows
operating system, they are still
running Linux to do the recovery on the
Windows operating system. Isn't that funny? Appliances, new appliances
that are coming in nowadays, they all have touchscreens
and operations like that, they are running Linux. And, of course, in the end,
the self driving cars, you will find they are doing
a lot of testing nowadays and all those testing all those little
operating system running in the
self drying cards, they are running Linux.
5. What is Linux: What is Lennox? So, of course, um, we are gonna learn, Lennox, but we do want to know what exactly the next is. Links is an operating system. It's just like any other offering system. For example, Microsoft has Windows. Apple has Mac Son, which is now owned by Oracle. They have Solaris running on spark hardware. So Lennox is an operating system, which sits in the middle off your hardware, and the users and the users are the one run the applications. So it's like a middleman or a bridge that takes the commands from users and translate them to hardware to look at this picture. So you see a computer, right? So if it out an operating system, this computer is considered like a dumb terminal. It doesn't do anything. So how does it work? So we have this terminal, which is, of course, a piece of brick. You open the tray off the computer, you insert your CD or DVD in that CD or DVD, has the operating system image sitting on it? Whether it's a windows are better, it's Lennox or whichever Obering system that you are installing. So you boot your computer from that operating system. So once you're booting it up, it goes through the installation process, That installation process gonna ask you a bunch of questions like, how do you want the opening system to be configured? How do you want your display petition? How do you want, how many users you want to have installed and so on. So once the installation is done, then at the end of the insulation, it's gonna ask you to rebuild. You reboot the computer, and it comes up to the welcome screen and say, Welcome to Lennox or welcome toe Windows or whichever the operating system that you're installing. So then you could attach external devices to it for examples, you could attach keyboard to it. You could Attash mouse to it. So you use thes miles and keyboards. You type a certain command certain you juice applications and type them and then you send it to your operating system. Then you operate System takes those commands and forwarded to other hardware or other system peripherals. So some of them are, for example, be a printer. So you if you are running an application, for example, you're running Microsoft Word. Your type it in with your keyboard and then you want to print that document, right? So the operating system will take the document and send it to your printer, and your printer will spit out the document that you want to print or if you are running other programs. For example, you are online. You're checking your email or you are running some online program or even games. So you are using your keyboard or your mouths. You communicating with you. Opening system in the heart operating system complete communicates with your hardware, and that's how it communicates to other devices on the network.
6. Unix vs Linux: Let's look at Gen X versus Linux. Cincy. What are the differences? But before we get into finding the differences will find out what UNIX is. UNIX was first developed for multi user and multi task purposes in mid 19 seventies in Bell Labs by A, T and T, G E and Massachusetts Institute of Technology. There was an operating system but was not allowing for multi users or multitasking. So that was one of the purpose for creating that then born lyrics in 1991. But a French student named Lynn Extra Walls Lennox is mostly free, and linen is open source. So what Lennox free means is you could install the Linux operating system in any off your computer hardware. There are a few lyrics distributions that are not free, like red Hat, where you would have to pay for support. A subscription. And the open source means that Lennox code that was DR from UNIX is actually open to the public to the community so they could go and and make changes to that code and make the operating system the way they wanted toe work in their own weight. UNIX is mostly used by Sun and the operating system is called Solaris. By the way, Son is now bought out by Oracle and also other operating systems that are UNIX is used as HP UX by HP Ai accent. Some other distributions off UNIX Lennox is used mostly by developer communities or companies like Red Hat sent OS Debian Fedora Soucy Bun, too. And they're so many of them. Even if you go out and search for Lennox distributions, you will find so many of them. UNIX is comparatively support. Very fewer file system. Now what is a file system? That is something that we will cover later. But there are fewer follows system that supported by UNIX operating system and a lot more file system that are supported and clinics flavors. Lennox can be installed on a variety off computer hardware ranging from mobile phones, tablet video games, consoles to mainframe and supercomputers is just like you cannot install Mac operating system on the Dell machine. You have to install Mac operating systems on a Mac hardware. Just like that, UNIX is Onley installed on certain hardware were as Lennox, you could install pretty much on every hardware that is out there running am Dio Intel processor. So these are the few basics about UNIX and Lennox, and I hope you will find more information if you're curious about it online.
7. WELCOME TO MODULE 2:
8. What is VirtualBox: what is Oracle Worship Box? And, of course, why do we need to know about worship box? Well, for this course, you do need to install sent OS Linux operating system on your computer, and there are two ways you could insult. One. You could remove the existing operating system that you have on your computer. Or you could install virtual box on top off your existing Windows operating system or Mac, and then you could install sent Oso you This way you won't lose anything. So basically, a virtual box is a free and open source hyper wiser for X 86 computers currently being developed by Oracle Corporation. It insults on your existing Intel array, MD based computers, whether they are running Windows Macklin excess LHarris. It extends the capabilities off your existing computer so that it can run multiple operating systems on one hardware at the same time. Let's see how it works. So you have when the hardware layer and then on top off it, you install the operating system. Of course, it could be anyone. You have that as Windows or Mac, and then you install Oracle Virtual Box. It's just a A program, a software that you installed on your machine like any other software that you would install. Once you have installed Oracle warship box, then you could install the Lennox on it as a separate small version off operating system. You could have windows on it, or you could have Mac on it, said this one. This virtual box allows you to have multiple operating system on the same hardware.
9. Download and Install VirtualBox: in this lesson, we will cover the Oracle Horschel Box download, and it's It's insulation. First of all, you would have to go to Google and type Oracle Virtual Box download and then the first link you will see here go to download. If your operating system is Windows, you'll click on Windows Host. Once you click on, it will ask you to save the file. I can't save the file, but since it takes some time, I have already saved the file previously to save some time. This is the file execute herbal file that's been saved. Run, click. Next, Leave everything default setting. Create a start menu entry You. Could you believe that? Create a shortcut on your desktop? That's fine. Create a shortcut in a quick lounge bore. I don't like that and Register File Association. You believe that networking installing the Oracle Worship box and network feature will reset your network adapter connection temporarily. That's fine. Proceed 10 and stole. Do you want to allow the following program to run since installed software years? Would you like to install this device software from Oracle? Yes, if you notice quickly. This created a quick desktop shortcut on your desktop. It is trying to install another device software That's fine. Click Install. Just going to say, Always trust anything that's coming from Oracle Corporation and just click on install. So this week it's not gonna bother me again. And there you go, Oracle be impartial. Box installation is complete. Click start Oracle of Urschel box after the insulation. Yes, you could leave the check box cook finish and is Cancel this man Dairy go! That's the first welcome page off the wardrobe box. And that's where we have actually completed the installation off the warship box from a hair on you could build, create a new wardrobe machine. And once we create a new washing machine, we will install Lennox Santo s operating system on that washing machine.
10. Creating First Virtual Machine: creating virtual machine. In this lesson, we will create our first social machine. And on victory will be installing are sent OS clinics operating system. But worker machine is basically nothing but a shell. Ah, container, which holds the information off a machine CPU memory disc and all the resource is this fortune machine is gonna be sharing. The resource is wherever it is installed. So let's say if it is installed on my laptop, it will be sharing. The resource is from a laptop, the Oracle work show box. I'm gonna open it up. Okay, so this is the window for the Oracle Horschel box. I'm gonna click on new. The name I will pick is my first Lennox, the M. And if you notice, um, the virtual box is smart enough to OPEC, the operatives, his assistant type and version for you. You probably noticed that you are going to see the 64 bit. You are probably seeing 32 big. Now, if you are seeing a 32 bit, then either your computer is 32 bit architecture or the virtualization technology is not enabled. First, let's find out if my computer is 64 or not. So let's go to start menu computer. I'm gonna click right click and go to properties. Once the property comes up, you will see here it will tell you if it's Win seven PC and right here you're gonna see or is this system type? It's a 64 bit operating system. So that's one way. That's one of the reason that when I'm building my worship machine, it is coming up 64 bed operating system. The second reason you might not gonna see it 64 is if you don't have virtual technology enabled in your bias sitting. If that's the case, I have actually pasted an article and in my in this lesson and there is a link to it, I would recommend that you could go that link and try the settings that are recommended and see if it changes the 64 setting. I'm sure it will work. If not, you will always email me back. So I'm gonna leave thes setting sugar click next Now here is gonna ask me the size off the memory I want to assign to this virtual machine. Now, by default is picking up one gig off memory now, you should also keep in mind How much memory do you have actually in your laptop? So in my laptop, I have Let's look at my computer again, Right? Click properties, and you will see here. My computer has installed memory is four gig. So it is. It is wise that I keep the memory below that digit. That number. So I have four gig, so I'm gonna give one gig up that memory to dis virtual machine. I'm click next, create a new Horschel desk. Yes. It will create a brand new Horschel disk. Next, leave the default dynamically allocated. Lee the default post. Um then this is the size of the disc. By default, it picks a gig. I wanted to pick 10 gig just to be safe. So I'm gonna just click inside this box, remove and type 10 and click create. And there you go. This is my first worship machine that is created again. Think off it as a piece of hardware that's been created for me. I'm on the assembly line. I'm putting the CPU and putting the memory and putting the hardest. I'm putting everything in that machine and I built a machine. So once the machine is built, what is the next step? Next step is to install the operating system, and in our course, we will be working with Santo s up a ring system. So I'm gonna power this on, and I'm gonna install the operating system. But of course, before I go ahead and install the offering system, I do need the software ISO image. So in the next lecture, we will cover how we're going to download the IRS. So, software, and then how you could attach that software to this Lennox of'em, and then we will boot off off that software.
11. Different Ways to Install OS: What are the different ways to install an operating system? Ah, well, there are many different ways, but the most common ways I'm gonna cover there are three most common ways, and the 1st 1 is through the CD or DVD. Now you have a CD or DVD, often operating system, whether it's Lennox Windows, our Mac, um, the insulation procedure often are starting. Opening system is the same, but the 1st 1 is you popped the tray out off your computer, but it's a server or laptop or workstation. You pop the CD drum, drive out, insert a CD in and then boot from CD. Now this is the most common way, and once the CD is installed inserted, the insulation program begins. The second way is through the ice or image you install, and are you actually download the image from the window rep side. Let's say if you're installing right hat Santo s windows, you go to redhead website or you go to Microsoft upside. You don't know the icer image. You attach that Eissa image to the worship disk off your computer. Now, how do you access the virtual disk? Every computer, um, has a consul axis, for example, Dell has Ah, I drag. HP has ill Oh, and so on. So there are many different manufacturer have their different way of accessing their council. Once you access the consul, you could attach this ISA image as a virtual disk and start the installation in our lesson . This is what we will be following. The third method is the network boot. This is also common in bigger organization where there are building hundreds off computers , installing offering systems 100 of them a day. That's when you need ah never boot. Basically, you, ah, tell you computer to go to a Pacific I p and a Pacific folder that is being shared by, uh, a shared server that could be either NFS server or samba server. That attach is that file your given i P address, and then you do the network boot. So these are the three common ways to do the operating system installation. And again, for our lesson, we will be covering the 2nd 1 which is the I S o download. We have already downloaded it and we will attach that I soto our Work chul environment and do the installation
12. Linux CentOS7 Installation (Recommeded): Hello, everyone. Let's get into the fun part where you will do the lyrics, download and installation and for the installation that I have picked is a cento us um, operating system sent to us. Offering system is just like a red hat operating system. And it's a free, um, and I will definitely commend you using sent OS for this course because a lot of companies out there that use a red hat Ah, for the corporate environment. Now, for the version part, I am using center s seven. There's also a version eight that is out there already. If you want to use words in eight, you can. That is perfectly fine, because my course fall about seven and eight. But my recommendation is that you stick with seven because a lot of companies I would say 95 to 99% of them are still using older version like 56 and seven. So, um, it will take them at least 34 years to get onto eight. So if you're in the job marker, you want to get into job market of recommend you that you stick to seven. Now for those who wants to go with the red Red Hat eight or Centralize eight. Perfectly fine. You could skip this lecture and go to the very next lecture which has sent OAS eight instructions for download installation art without for the deal. Let me get into the download part so far for the download. What you have to do, you have to go into your browser. Whichever browses. Shall I go to Google or any search engine and type sento sento s download IRS. So now by default will give you the first page which will have the link to send to us eight . We don't want aid again. We want seven. So let's go back and I want you to type specifically Cento a seven. Download eyes so and go to the second language stays index off Santo s seven. Click on that now click on X 86 Underscore 64 bit Now again, every image. If you click on it, you probably gonna get different links off the murders. You could pick anyone that gives you that Santo s, um seven. It doesn't really matter. I'll go to the 2nd 1 and click on the 64 bit Your architecture has to be 64 bed If it's 30 to search for 32 bit, then click on any murdered that you like and it will start the download. So you go into this eso cento as seven x 86 1908 Doesn't matter of which version or which build it has. Maybe you have a little later one Maybe you have older one It doesn't really matter what matters it's it's cento a seven. So go ahead and click on ice so and save I able not save it because I have already saved it earlier To save time, save your time and save my time So I'm gonna go ahead and cancel. So anyway, for in your case, once she once click, you click on OK, it will start downloading and it will show a pair of feuding Firefox once it's downloaded completed. Then you need to go to your oracle, William Virtual box. Now if you do not have virtual box, that is Ah the latest version. This one the one I have a six Dato. If you do not have six Adul, I recommend that you upgraded to the newer version. So now I will go ahead and create a new washing machine. I'll click on you. And the name that l pick is my first Lennox VM. That's just the name off this virtual machine on the virtual box. You could pick any name, but if you want to go along with me, pick that name By default, you see is picking up Lennox tie because a type didn't the name as Lennox and the version it's giving up as Lennox 2.63 dot x for the next 64. If you do not see 64 here, you see 32 bit. Then you'd need to change your bias configuration off When you go to when you start up your own laptop or PC, you have to go to your bias setting and enable a virtualization if you need instructions. I have included instruction. I have given the the link to an article, which will walk you through one by one as how you could enable that a virtualization and your bias. So anyway, if you if it is showing 64 but perfect, go ahead and click next. The memory size is one gig ones or 24 megabytes, which equates to one gigabyte that skirt leave as default. Next, create a virtual hard desk by default is telling me the recommended sizes. Eight. Gig. You could, um, leave a gig or you could change it. We will change in the next one in the next slide, so create a virtual disk click. Create beady eye, which is the default. Wouldn't leave a default. Click next dynamically allocated. Yes, leave a Defoe click next and out of size by default. It is said, it's clearly give you eight, but for for this lab, I want you to type 10 and click on Create. Now our virtual machine is created. As you could see, it's right here saying my first Lennox of'em. So let me go back in here and this way I have a clear background. All right, so now what you need to do is once UVM is created, go ahead and click on Start are So once you started by default, it will ask you, I do not have any operating system. Of course, this is just empty shell or empty virtual machine. Now I need to attach and I eso image to it. And that isa image is the same ice image that we downloaded earlier. That is Cento a seven eyes image. So go ahead and and click on this little folder And now it will ask you where is your eye? So image located my isil images located in my personal folder and in my eyes so and I have right here, says Center was seven. So go ahead and select that and not click on start. Okay. And on this page, by default, it will come on this option, which is say's test this media and installed. Send us I do not want to test. Sometimes this option is good if you are installing with the actual CD room the physical one, the CD because sometimes it has scratches and it could impact your installation. So that's why you should always test that media before you do the installation. But since we did the I so image download and I am very hopeful on, I'm sure that the insulation are sorry. The download was not corrupted. So I'm going to use my up and down arrow key, and I'm going to select the 1st 1 which says install Center West seven, and I'm gonna hit Enter now. What it's going to do now is it's going to read the content off the eyes so it will copy the content off the eyes. So the ones that it needs to start insulation, it will bring it into the memory. And then it will start an installation visited. That's called Anaconda. That's Ah, that's just a name off the visit that sent us uses. It will start, and it will help us going through the installer process from one step to another art. So right here, you're going to see it says The virtual machine reports that the guests always supports mouse pointer integration. This means that you do not need to capture the mouse pointer. That is fine. You could go ahead and cancel that. By the way, if you are, if your mouse is stuck inside off this window, then you could use the right click. You see right here this little thing say the right control key. This is a control key on your keep keypad, and that is on your right hand side. So once you press that key, then it will release your mouth. But if it is, your mouse is really going outside. Perfect. Anyway, let's get into it now. What language would you like to use during the installation process? I am in United States and, of course, English Speaker. So I'm gonna go ahead and pick English and the English for the United States. If you are in a different country, depending on your preferred language, you could go ahead and select the your desired language. Now go ahead and click on. Continue are in the next page. It says insulation a summary and this is us is basically the keyboard that has been selected. You don't need to click on that. The first thing you need to click is date in time, so date and time is by default. For me, it is already selected. Ah, my US time I am in New York. It's already it. Actually, I didn't it actually recognize that. I'm gonna leave that as default and I'm gonna click undone. Then it's going to say language support, and I said a previously be selected English and for the English United States Go ahead and click Done. If you want to change it, you could change it here as well. Um, by default it picks up my keyboard as United States English keyboard. If you are a gain in different country, you could pick according to your requirement. Now comes to the part. Let's scroll down on the right hand side by grabbing the scroll bar. And then it says the next one's this offer Installations force, which is local media, which is our eyes. So image that is attached to this virtual box so you can leave that, as is software selection, is his minimo installed? When you pick a minimal installed, it will not install the gooey. It will onliest all the text way or command line on your operating system. But for this lab, I want you to go ahead and click on it, and I want you to select server with gooey. This way you have the server with the graphical user interface, and you will see if certain things that you could add remove using the gui. But again, um, I would say about 80% of the corporate environment do not use Gu Ys. They always use, um ah command line interface because gooey takes a lot of resource is, and it could also makes your system little vulnerable for the security threats. So, um, if you aren't production or corporate environment, check with your company policy and then you should select the software selection. Also, Um, if you are building a server for different purposes, you're going to see that the servers has a lot off add ons that you could do so but you go to minimal install. You're going to see it has security tools, smartcard support system, administration tools. Um, and you go to compute note. It has all the other add on selected tools and software that are available to you again. It depends what kind of application you will run on this operating system. Based on that, you could select any tools or any add ons, tools or application that you want. Similarly, when you go to infrastructure server, you probably heard off many of the servers like FTP server, NFS server, Deanna server, all that stuff. If you want to have them installed, you could actually select them here so it will install the package. But anyway, if you do not select any package right now at this point, and you remember later on that you need to install not to worry about. You could just simply do the jum install command, which we will cover later in an other lectures. Um, that I will show you how you could install the add on selected add on packages. Um, again, that file and print several give you different options. Basic serve observers. I do want you to go through them one by one. Um, I don't want you to select any of them, but again, if you want to select, that's perfectly fine. But I just want you to get familiar with what are the options that are available on this menu. But for this lab purposes for this training, I just want you to select the server with gooey. And now I want you to go ahead and click Done. Now it's actually checking the software from the eyes, though it's basically the software selection is going to the ISA and has been asking, Hey, I So I've been asked to select several with gooey Do you have the required package? So that's what it's kind of like going back and forth and checking so anywhere while it's checking will go into the next one. Where say's system and it's his installation destination, by the way, it's finished on it worked. It came back and says, Yes, I do. The next one is insulation Destination may wear meaning. Where do you want to install this operating system? Which disk You remember. We picked it. 10 gig of disk So we'll go ahead and select this one. And by default, it has already selected 10 gig. Then it has checked, marked on it and other storage options. It say's petitioning. It's his automatically configure, petitioning, so we are not going to petition it ourselves. We will let Lennox pick the petitions for its own, which is a default petition for the 10 gig disk. And now, if you go ahead and click on done now, installation destination is done. K Dump is when. If there's something goes wrong with your system and it crashes, it has to log something. The wide crashes and that kind of colonel dump is when you, if you have it enabled than it will actually spit out all the information to ah log file. So when you have it enabled, that's Onley. When you haven't, it will spit out the logs only when you have it enabled. Okay, so network and host name. So that's where we need to define the network and the host name off the operating system. So you go ahead and click on it and a host name right here. You see the host named a local domain? I want you to highlight the entire entry and type in my first Lennox VM and click on Apply as soon as you click on apply. You see, right here says current host name, which is local host, which what it had before. So once you click on apply it will change it right here. My first Lennox PM So you probably noticed that I put in upper case, um, the first letters and it changed it to lower case. Um, because remember, Lennox is, um ah, case sensitive offering sistema meaning? It matters if you put in upper case and lower case, but it prefers that you always use lower case letters. All right, so now let's go into the network of air says eternity E and P zero as three. Right now, this is the network port. That is a sign on your jewel box. So right now you see it has, ah, hardware. Which of the Mac address? It has a speed off one gig, and a subject mask is by Deep was picking up its local I P. So what we need to do is we need to click on configure because you see, right now it's turned off. Let's go ahead and click on configure, and the only thing I want you to pick in configure is cool, General and click on automatically connect to this network when it is available. Now what this does, is it? Actually, um, start your network or pick up an I P whenever your computer or your operating system restarts to go ahead and click on Save and you're going to see right away it picked up. And by the way, this is going to be a WiFi network adapter said that has given to you by your virtual box. So now go ahead and click on Done. All right. The last part is security profile, so we do not have any security profile. But if you are doing this installation for your company, check with your company and check with your security folks. Um, see if they have any security that they use or any template than you could attach it here, which would apply all the security settings. But anyway, this is lab on. This is something we gonna be learning later on. So now I want you to go ahead and click on Begin Installation are in this next page. You're going to get two options while it's going to run the pre configuration or pre insulation checks and stuff it has asking. It is asking us to create a root password. So go ahead and click on root password by default route as a system administrator past for in Lenox. So I want you to pick a root password. I picked a week password that it's saying this yellow thing at the bottom. It says the password you have provided is weak. The password fails of the dictionary. Check. It is based on addiction reward. You will have to press Donna twice to confirm. So if your password is weak right now as what I have, my passport is weak, so you would have to select it done, and another time you have to click done twice. Second option is your use of creation. I want you to go ahead and click on user creation. And this is a regular user, not a root or not administrative user. So I am going to create my account. I'm gonna pick my name. Imron. Absolute. And the user name by default will pick my first initial, followed by the last name. And the past would leave the other setting as default again. My password is weeks. And now I have to select done twice. 12 All right, so now you notice right here. It's saying installing genome user dogs and installing this and that. These are all the packages that it needs to install to complete my installation. And the packages total packages in east installed is 1353 and so far it has installed 58. Now, this whole process could take anywhere from 10 minutes to half an hour or 45 minutes, depending on the speed off your computer where you are running this virtual box. What I will do is from this point on, I'm going to fast forward this entire insulation. So if you are sitting now, I will. I will ask you to go ahead and take a break. Take a coffee break or get get some something to eat and once it's done, will start right from there. So I'm going to fast forward right away and see you under the side. - All right, so congratulations, the The insulation has been completed, As you could see at the bottom right here. Says center s is now successfully installed and ready for you to use. Go ahead and reboot to start using it. And also a little message. The bottom says use of this product is subject to license agreement found at this location . Anyway, you will get the license. Ah, confirmation. Ah, that you could read through and accepted in the next. Once it reboots. So go ahead and click on reboot again. This message appears you could go ahead and close this since it is starting the first time your operating system is starting the first time. It could take us a little while for it to start back again. But that's fine. Perfectly fine. Now less licensing port. I want you to go ahead and click on licensing information. It's his license not accepted. Go ahead and click on it. And right here, read through it and click. I accept the license agreement and click Done Never can host name the already configured that earlier so you don't need to configure it again. Now click on finish configuration. Now it is going to start the gooey the Cento us Um offering system gui now. All right, perfect sin Al You'll see it has shows you on the top issues at the time some network information speaker powered off from here just like you know, as if you see a new vendors environment. Now go ahead and click on your name because this is the count that you created. I hope you did not pick Imron Essel because I hope you picked your owning while you're going through the insulation. So anyway, go ahead and click on it now provide the password and that once you provide the password click signing, it will log you in, but going back again if you want to log in as root, then you go click on simply not listed and put in the user name as route and put in the password. But anyway, I wanted log in as myself up put my password in and I'll hit Enter. Okay, now we have this desktop looking type of environment that has to icon on it. One as my home folder. One is the trash can, um, pretty big. I usually keep them smaller so you could go ahead and right click on it, and you could do resize icon. And then you could drag and make it smaller just like that. Right? Click resize icon and drag and make a smaller. You could also move them around, up and down, left and right. So this is your desktop environment. Now, if you want to start your terminal now, by the way, that if you are doing this for the first time, this is the first welcome screen after insulation. You could just leave it as, um, welcome. And it's gonna say English is for the United States. I have that selected, um, and click next typing. Um, it's already selected for me English. If you want to change that now, you could change it as well. Click next location services. I like to keep it disabled, So click on off and next connect to your online accounts. I don't like that. Um I want to keep my links machine private, secure so I'll click. Skip and I wanted to click. Next is start to using my center s letting Once you click on that, it will bring me back to my desktop on the desktop. As I was explaining it earlier, you could right click and click on open terminal. By the way, this help getting started genome helps opened up again. I don't need that. What I'm gonna do is I'm gonna close that again. This there's these windows are popping up because I am using this operating system for the very first time so I could go ahead and close that and I could start the tumble back again . So anyway, how you could close that window, anything that shows up like software updates available, do you don't have to get it Now you click. Click on Not now. And that this is the terminal that what you want to see and this is your command line terminal where you could run all the commands. And that's where this is our platform, where we will learn everything about Lennox. So you're ready. Let's go
13. Linux CentOS8 Installation: Hello folks. This is where we going to do the center s insulation Version eight Now, as I said earlier that if you do not want to go through with Cento a seven and you want to go to with Cento s eight perfectly fine at this entire training or this entire course covers boats seven and eight new feature old feature everything. And if you again if you want. If you prefer you want to go with eight. Let's go ahead and do it now. Um, first thing first we need to have the center was eight I s o downloaded on our computer so we could attach it to abortion machine and then we could do the installation. So I will go ahead and open up My Firefox and I already have my ghoul open and I will type Cento s download I s o the very first link again. I will take me to the latest word Shin off Santos. So the 1st 1 I'll pick a center s I s so Lennix DVD. Ah, eso And it will take me to all the murders that actually has the scent OS eight version and I could pick the 1st 1 The 2nd 1 It doesn't really matter. Um, the I would prefer you go with the 1st 1 If it doesn't work, then you go to the 2nd 1 Anyway, I picked the first, and now it is asking me to save that file. Now, I have already saved that file previously to save some time. So that is why I'm going to cancel. But if you have not saved it, I would like you to go ahead and click on OK, And it will actually save it to your default location off your downloads. Um, I'll go ahead and cancel at this point. And now, once it's downloaded, I want you to go to Europe Oracle Virtual Box. And one important thing is, if you work downloading and installing center s eight, please make sure you have Oracle Virtual Box six and above. This is the one that is mostly compatible. Would send to us eight if you do not have 6.0, um, you could go into the file and click on check for updates, and it will take you to the right link where you could actually upgrade your or commercial box anyway. Now we're doing Cento us eight. I want you to go ahead and click on a new and a type in a cent OS or Lennox sent to us eight or any name you decide the name is not important. Anything that you could remember or you could relate to. And by default it will pick type Lennox of the version. Right? Had 64 you could pick 64 red hat or you could actually pick the one that you picked. Um o r. If it shows up as other 64 doesn't really matter. So I believe it as default that it picked Red had Ah, 64. And click on Next the memory one. Giggly that default the storage. Create local virtual Desk Creek Click on Create Leave a default video I d fall dynamic allocated. And now the size off the disc I've recommended you pick 20 gig. Go ahead and click Create And how it has created a year Learning Center s eight. Good. And click on power on Once the window opens up, it will ask you to to check. Where is your Isa Image file is located. My isa image files is on the location. When you click on this little folder, click on that. And if you have your eyes the image files downloaded on your desktop, then you go to your desktop or wherever the location is. My location is my personal folder in I a So Folder, and here is the eyes image for me sent to us. Eight. Click on Open and I'll go ahead and click on Start. Okay, so this is the page where it gives you two options. The first option it gives you installed. Santos Lennox 8.0 2nd option is test this media installed Cento Us. Letting start eight. Now if you have the physical disk, um, attached to your virtual machine or your physical machine, then it's always good idea to test that media because, um, many times that physical media has scratches on it, so it will. Ah, it will create problems during the installation, but since we have downloaded the eyes so than its, it's best, and it's perfectly fine if you pick the first option. So you go ahead and up, hit the up arrow key and will highlight installed Centrowitz Lennox, the very first option. Go ahead, click enter. Um, if you see this message top you have the auto capture keyboard option turned on. This will cause the virtual machine to automatically capture the keyboard. That is perfectly fine. Um, you could close it. Basically, what it's saying is, if you if your mouse is stuck inside off this window ah is because we have certain features enabled you could get out of this window by clicking the control key the right control key on your keyboard. So I will just simply go ahead and ignored these messages. But clicking the clothes now, basically, what this is doing right now is, um, it is actually copping some of the information from the eyes. So image that we have attached it is taking that and copying it into its memory. And the memory will actually see Hey, give me the installer that will allow me to go through the installation visited to do my Santo s eight installation successfully. So I'm just gonna have to wait for it to start that that gooey that installer on. And once we have that, when we then we go through the installation. By the way, you could also do the command line installation. So on the very first page, you could have done that modification as well. But if you're doing it for the first time, I will definitely recommend you. You go through the gooey installation. So as you see, it's showing starting installer. So give it, um give it a minute or less than a minute. I'm very hopeful. All right. On this green, you'll get the welcome to send us links a 0.0 or the building could be 1905 or whatever. What matters is version eight. What language electors use. Um, well picked English. And I'm in the United States. I'm gonna pick English and United States and click on, continue on the second screen, or you're going to see installation summary Center s Lennox ate the keyboard is us. You could leave that, as is, You don't need to click or change that, um, the localization of the keyboard. It is automatically testing, and it notices that we are in the United States, so it is gonna pick the keyboard English. Us next one is language support its United States and, um, English. The time again, it's America. New York, if you are in a different region. Um, then it should have picked up that region. If not, you click on it and you could select the desired region. Next one is on the software selection. You're going to see installation source, which is our eyes, the image. So that shows up as local media. 2nd 1 is a software selection server with GWI. By default, it's gonna give you server with go. You could go ahead and select this option, and you're going to see in the base environment the left hand side of these other based environment on the right hand side or the add ons for selected environment. Um, every base environment has all these add ons. So if you go to, for example, server, you're going to see these different servers that you could run or these different applications that you could run on your server. You probably heard off FTP and a first D. N s. All these services that actually runs on Lennox or on a server you could pick based on your requirement or if you were doing in the production, you could pick ah, depending on your application team requirement again, minimal install meaning when you pick this one, It will not installed gooey. Um, but with that minimal install, you could also pick some off the tools that you think are appropriate to do your troubleshooting or systems tool. Um, configuration. Ah, workstation of this is a workstation is a user friendly desktop system for laptops of PC custom operating system virtualization host. I actually want you to go through each one of them, go through each and every add on package and just make sure you understand and make yourself aware what other packages or add ons we have available. But for this training, I want you to simply select server with GWI. Vich was previously selected as a default. And go ahead and click. Done. Okay, Once that is done, you're gonna notice that that it's checking with this I so image. Hey, I need several a gui Do you have all the required packages and the local media, which is eyes and made It stays. Okay, let me check and goes back and looked through the packages and says, Yes, I do. That's why you see both of them now in two. The black, um fought the next one we have right here's installation destination. Meaning? Where do you want to install your operating system? Which desk do you want to install it on? And you remember when we were configuring the virtual machine, we carved out 20 gig and by default, it has that 20 kicks selected. As you could see right here in the story configuration, I'm going to leave it as automatic, which means I am going to let Lennox decide how it wants to protection this 20 kick. If I click on custom, then I would have to specify meaning I want you to give ah five give to home. I want you get, like, five. Get to war. I want you to give the remaining two route that comes into custom. So this is a very beginning. I don't want you to get into this because it requires some extra, um, skills. If you are doing it insulation for the first time that my suggestion is, leave it as automatic and go ahead and click on. Done. Okay, Next option. And under the system is K damp. Kate M stands for Colonel dump. If something goes wrong with your system, something crashes. And if you have that Kate um enabled. Then it will log all the errors and Ordell's messages so you could go back and review what caused the server to crash. Some will leave that as enabled or bitches selected by default. Next one is Network and Host Name. You click on it and let's change the host name. Right now it shows up a local host, our local domain, which is spit shows on the right hand side, says current host named local Host. Let's go ahead and change it to Lennox sent Owe us eight and click on Apply again. You could pick any host name that you like, um, and then you could apply it and it will show up on the right hand side. This one shows are networking right now. It disconnected because it's turned off. Here is the harbor address, which is the Mac address. Here is the speed, which is a one gig. Go ahead and click on configure, and on this screen, I want you to go to the general Tab and click check mark automatically connect to this network when it is available. It means every time your computer or your operating system reboots, it actually going to connect to the network automatically so you don't have to enable it or start the network again. Gun clicks save, and now you're going to see it has some more information, like I p address Defour Row DNS. So go ahead. And now I want you click on Done. So host name and network has done security policy. If your company has some security policy or if you're installing Center a seven or eight and you production environment, consult with your security folks. Find out if there are any security policy that you need to apply. But I would say nine out of 10 times. This option is not usually selected to leave that out and click on begin installation, all right, while is starting the configuration, are doing the pre check off the installation it's gonna ask you for uses. Setting is gonna ask you for root password. You need to set the root password, and you need to define at least a user. Let's go ahead and click on root password first. I'm going to specify a root password based on my choice. It is weak. I understand. I do not recommend you guys to pick a big patch for pick a strong password. But since for for me this is a lab. So I'm gonna just leave as is, and by default and sees it as a weak password and it ask you to press done twice to confirm . So if your password is weak, then you have to press this done button twice. One and to and now use a creation. And let's pick a user. I'm going to pick myself. M Ron. Absolute. Of course, you have to pick your own name. And by default, Lennox picks the first name initial and complete last name. Leave these settings default and picked the password Our password again. And my password is weak, and that's fine. I'm gonna press it. The done button twice. All right, so now the prerequisites for the insulation is done. Now it is downloading packages packages, meaning it is going to that. I say image and it is asking Hey, Isa image. Give me all my required packages. And now it is preparing transactions from the installation source. And what is that installation source again? It's our eyes. So image fell. Once that is completed, then you're going to see the actual number off packages that will show up that actually are needed for this installation to complete. And once you pull, it will show you. So most likely it's probably gonna be somewhere around 1213 100 packages we because we are going through the gooey installation when you have grease elected, Gui takes a lot off. Add on packages as opposed to the command line, um, or without the gooey installation. So anyway, so if it comes up like 1300 packages, you need to leave it running. It could take anywhere. I would say the installation would take anywhere from 10 minutes 2 30 to 4 or 45 minutes, depending on your computer resource is depending on the speed off your computer. So I would say at this time you could, um, go ahead, take a coffee break or a lunch break, and then you could come back after half an hour. And what I will do is I will go ahead and fast forward from this point on. So this way I'm not gonna waste your time and my time. And then once it's done, I will meet you on the other side. All right. Congratulations, guys. We have successfully completed the Scent OS installation, as it say's right here. Complete center. As Lennox is now successfully installed and ready for you to use, go ahead and re boot to start using it. So of course, go ahead and follow the instruction and click on reboot Art when you get to the screen and you gonna notice that it is starting back a gain on the center s Lennox installation screen . The reason it is doing that is because by default, your ISA image is still attached to this war Shal vm Wortzel box. So what you need to do is you need to remove that. I s so so when when your system reboots, it doesn't think that it has just boot off off that I eso image. So for that, I would tell you to go to. So to get out of this window and release your mouse, click the control key on the right hand side of your keyboard. Okay, so and click on devices optical drives and simply click on removed Disc from work, you'll drive. Then it will give you ever prompt you to force amount meaning Remove it forcefully. That's fine. Go ahead and click Force. You amount. Now it is unm outed. You could verify a game by clicking on devices, optical drives and there isn't anything that attached. Beautiful. Now you need to reset this machine. Click on machine and click on Reset. It will prompt you. Do you really want to reset the falling works for machines? Yes, that's fine. Click a reset. Now it iss starting your scent OS version eight operating system. Okay, when you get to the initial set up page, um, um, do you need to select the license information? By the way, if you got to this page after two minutes a treatment, that is perfectly fine, because this is initial configuration. First time girl up, bring system. This story, it could take some. Um, some time could take longer than than what it will take you later on. Go ahead and click on license information and click on. I accept the license agreement. Of course. Have recommended to read through it and click on done, and then click on finish configuration. All right. When you get this to the screen a meaning that it's waiting for you to log in now. So I have created my account or your during installation, so I will click on it and asked me to put in my password. So if you go back again, click cancel and you want to log in as root. Then you have to click on and not listed and provide the user name as root. And then you need to provide the password for the route, and that is the past for that depicted uring installation. Anyway, I want to cancel it. I want a log in as myself once again if you're logging in for the first time, and then it will take some time for the operating system to come online. So don't worry. Be patient. If your mouse's captured inside of this window and it's not going outside off it, then please remember, you could click the control key, the right control key on your keyboard to get out of it. All right, so this the desktop, the only important thing that I see on the desktop is your terminal said right here. You could go ahead and click on the terminal, and it was give you the platform to actually run all those commands that we gonna learn throughout this training. So that terminal is, um you could use either council and use that terminal. Or what we could do is we could find out the i p address off this the next machine, and then we could log in as through putting. Um, Anyway, logging into the party is something that I will show you later. Um, but anyway, this time again, as I said it, since this is starting for the first time, it's gonna make you go through some, um, initial stuff like this point. It's giving you a welcome screen. Um, if you need to change your language right now, you can but just leave a default click next, typing again selected for me. Click next location services. I would like to keep it turned off. So I'm gonna move this to the left and click next. Connect your online accounts. Um, I would not like to use those right now. I'm gonna go and click on Skip and the last option the last green is giving me You are ready to go start using centerist Lennix. So click on start using center s Lennox and it should go back to your desktop right after that. Very. You have our terminal that we opened up earlier. All right. So again, as I was saying, this is the terminal. That's the one that you need to use to run all the commands. And you could get yourself familiarized with the desktop as well the gui desktop. But I would say 80% off the environment and the production corporate environment do not use gooey. So So, um, so be ready to use command line. Don't get too comfortable with the Greek. Anyway. Congratulations. Once again, you have completed the center s eight installation cup of successfully. Now, you could go ahead and close this help window. That will also give you some information about genome. Um, that will tell you about the going anywhere. Good luck. And, um, let's get moving on to the next A lectures where we'll learn a lot about the command lines and the commands that you need to learn
14. Message for Redhat Installation: once again Congratulations, everyone for completing the Scent os installation In our next lesson. I am including Red Hat Linux installation. And remember, this installation is completely optional. The reason it is part off my training. So you will have the experience off installing red hat as well as cento us. All my lessons followed by this insulation are gonna be on Santo west that we installed in the previous lesson. But again, I want you. I encourage you to go through this. Red had installation as well.
15. Redhat Linux Install (Optional): just to let you know Lennox installation is exactly the same as center was. The first thing we'll do is we'll go to our Google friend Emel type red hat. Lennox, download. Once we go there, Um, it's gonna take me to, um a few links and I want you to go to right here. It says right had enterprise links download. And it's his developers Red hat. And you come in here. Um, you click on download. It says, download this product. You must have an account and accept the terms and condition off. Red hat. It's a download. Once you click on the download, it will ask you to his user name and password over email and password. If you do not have a using and password, I will hide recommend you to create a new one. I already have it. I logged in and I have already downloaded the red hat. I also image and it is downloaded here. I did that to save some time. So now since we have there, let's go to our Oracle worship machine. Sorry. Or commercial box Reality have one running which is running cento us. We're gonna create a new one, and we're gonna name it Red Hat. Liam, it automatically pick up Lennox type version already 64 bit. Next we leave everything default. Everything. Default. Next. Next, leave the A gig decides default. Create once it's created, it created a shell. You're going to start it by clicking. Start. Okay. Once the windows comes up, it's gonna ask you where your s O file is located. We're gonna click this little folder to pick on the location. If I measure its on our desktop, remember, your mouse is gonna be captured inside. If you want to release your mouth, you could just hit the control key on your right hand side of your keyboard. Not on the left hand side. Just click on this message. Pick the 1st 1 Install Red Hellenic 7.4. We are in the insulation visit. If you see it looks exactly like Santo West. The only difference is it has this red had logo on the left hand side, whereas Santos would have a center s local. So it's exactly looks like as Cento us will go down with picker language which is English and the United States continue the first option that we have to set as the date and time, which is already by default, set for me, which is America. New York. That's where I am the keyboard. Selected English US if you want change to a different language if you want British, English or European are Australian English. You could pick that language support automatically selected for me by default installation sources. Local media, which is I saw images that depict software install. This is the minimum that we're keeping by default. You don't want to install any gooey or any additional packages. We will keep insulation very simple. And then the installation destination. How we want to protection our system will just leave it default automatically configure petition that this sizes eight gig It is already selected and just click done once that it selected next options Kate Dumb is enable leave a default network and host name. Well, come down to the option. It was called down. Where has the host name host named this one of the important things that you need to pick. Well, pick Lennox Red hat $2.18 isn't my host name. You could pick any host name that you want click apply. Once you apply, you'll see here right here, says current host. Name is said to what I wanted to be to be set. You go back up on the right hand side. There is a network configuration. You could turn it on if you know the I P address or if you want to have a DCP assigned, just turn it on. It will pick it up and then you click next for this lesson, we will leave it off and just go on with the installation. Please do remember, you would have to click control key on your right hand side of the keyboard to get out off your window and squall down. And now you want to click begin installations, click inside again in the window and could begin installation wants him on the second screen. We'll select the root password. The root password is weak, I know, but we're just picking it because since it's a training environment, V, if you are in production or corporate, Marmon of strongly recommend you to pick a stronger password. We'll create a user as test set a password again. It is a weak password, but that's fine you would have to hit done twice, so it creates the user account for you. Now, if you notice has 329 packages that he needs to install right now, it's at 58. It will take anywhere from 5 to 10 minutes. So I'll just fast forward skip some of the past on. Go to the page where it will tell me the insulation is completed. Okay. All the packages insulation has been completed now is performing some post insulation set up in configuration. Installation has been completed. We'll come down and we'll click on reboot. Okay. The system has been rebooted. It came back. Now, if you notice there is no gooey, you simply get along and prompt with the host name in front off it. So you log in as root or test and you will have your route. Profit starts with pound or hash sign. So this is the Lennox installation for Red Hat. We did not pick the Gui insulation and 95 to 98% of the time in a corporate environment, you will not be allowed to install gooey
16. Linux Ubuntu Installation (Optional): Hello, everyone. And in this lecture, we're going to cover the Lennox A bun to installation. Now please note that this is completely optional. You do not need Lennox a bun to for this course. I am including the installation instruction off a bun too just so you know how it can be done. And again I am I I highly recommend everyone who's taking my course is to go with Santos sent Os operating system for those who wants to learn how a bunch who works or how Ah bun to installation works for them. I am including this lecture now please, if you do not want to install a bun to simply skip this video entirely and go to the next video So getting back onto the links a bun to first thing first is you have to create a virtual machine for a bun to where you will install Look, Lennox a bun to on it. So for that we will go to our worship box and I will go ahead and click on new type And the name Lennox Oh, bun too. By the way, some people call it job unto some people call it a bun too. Anyway, um, which one is correct? Doesn't really matter. It's just operating system. You just need to remember, Ah, some of the features and the configurations or installations that will cover when you type in the name automatically the virtual machine or the work will box will pick its type, which is links because we tied Lennox here and virginal pick up unto itself because we type a bun to in there. So our commercial box is smart enough to define these values for you. Now the memory size that is defined is one gig by default. If your machine has four gig or less memory than our Druckman that you leave it default, which is one gig I have enough. So what I'm gonna do is I'm gonna change it to two gig. So when you do 10 to 4 times two, it becomes 20 for eight. So that is two gig hard disk. Um, create a virtual hard disk. Leave it a default click create. And now it's asking you the information way. Do you want to save the the location off this worship machine by default? It's pecked at the virtual box Of'em you believe that as this. But if you wanted to change the location, you go click on this little folder and define the location. Ah, the file sizes coming up as 10 gig. That's fine. You could leave that, As is hard disk file type is VD I, which is for the Marshall Box Disk image Storage on physical hard disk dynamically allocated leap that as default. If you want to Nome or information about that, you could definitely click on guided mode. Go ahead and click. Create now the virtual box or the water machine. The container has been created. Now the next step is that you need to download the operating system software, which is the ISA image from the a bun to website for that will go to our browser. I am using Firefox and I'm going to Google, and here I'm gonna type oh bun to download and the first link it's taking me go to download and the downloadable into desktop a bun to 18.4 dot three. Maybe you see it a different version that is perfectly fine. I depends on when you are downloading it at the version changes over time So when you click on and download it, it is going to the download page and we'll give you Thank you for downloading a bun to desktop and pop up this message which you tell you, Say file and then you click on OK, it will save it to your default download location. Um, I have already saved downloaded the a bun to isa image on my one of my folders. So I'm going to go ahead and cancel because I wanted to save your time. So for those who have not downloaded, of course, you have to click. OK, so I'll click. Cancel, always downloaded. Go back to my Horschel box. And here, um, let me clear the background screen and go back to our other screen. Okay? Looks a lot better. Now let's go to our virtual machine and click on start. Okay. Whenever a virtual machine starts up, it looks for an operating system. So it could booted off off that operating system. Since this is an empty virtual machine, doesn't have any operating system. It is asking us from wear or rich source. Do you want me to start up the operating system? Um, we need to specify or attach that I s o, um, file that we downloaded for a bun to website. And for that, you go ahead and click on this little folder. This is going to take me where my file is. So by default, I my files are in my potion folder. If your file is in death, stop, Go and click on desktop. But anyway, this is the downloaded ice image I did earlier. And now I'm gonna go ahead and click on open. Now it is attached. No good. And click start. You could ignore this top messages just telling you about your mouth. Let's minimize the Oracle virtual box manager. So we just have this machine open. All right, So now what it's doing is it actually uploading or bringing the contents off that Aiso image to the to its memory so it could start the visited, the installation, the opening system insulation visit. So we'll give it a few minutes. Also, as I'm going through this insulation any time where, where I know it would take longer, I am going to fast forward. So you probably noticed that from on my side in solutions going so fast but it's not. I am actually fast forwarding the recording. All right, so anyway, um, that's closed down this message again, and I was coming back and saying, Welcome to the install paid. Try a bun to you can try a bun to without making any changes to your computer directly from the CD. If you already you consulted bun toe alongside or instead off your current operating system , this shouldn't take long. So we wanted to. We don't want to try it. We want to go ahead and click on Install a bun, too. Okay, so now, by default, the keyboard layout is selected for US. United States. I'm in United States that that's why it's selecting the keyboard and on the right hand side , Ah, as well on their other ones. Um, other options available. You could leave that default If you're in the United States. Click continue. Alright, what abs would you like to install to start with? So we want to do normal installation When you pick minimal Instant Nation, which will be basic command line utilities, you don't want to go to their just leave it default, then other options download updates while installing a bun, too. So if you do not have Internet while you're installing it, I would not recommend you to pick that option. Also, even if you do have Internet, um, I was still try to keep it out. And if I need to do the updates, I'll do it later. So just pick the first option. Normal installation and click Continue. Okay, this computer currently has no detected operating system. What would you like to do? A race disk and install a bun to this will delete all your programs, document photos, music and other files in all offering system. So this is not going to delete anything that is already in your virtual box or on your computer, so don't worry about it. It's basically saying that the 10 gig that we picked out for a bun to install its talking about that Pacific 10 gig. So it's just telling you, whatever you have in that 10 gig that you carved out for a bun to, it will remove or delete all the programs that have anything on that. So that's perfectly fine. We know that. So go ahead and click on install now. Okay. If you continue the changes listed below will be written to the disk. Otherwise, you will be able to make for the changes manually. Partition table of the following device are changed to this. The falling petitions are going to be formatted to the petition number. This so that is fine. These are default setting, and it's building your file system are extension for which is a false system for Lennox ca and click Continue the time. Where are you? I am in default automatically it picked in New York because I am in New York. If you are somewhere else and you have Internet connectivity, it will automatically detect your location and it will pick it. And it will, um, show up right here. So all you have to do pretty much click on continue. But for somehow, if it's not, you could actually move this around or drag it around to get the right location. Go ahead and click. Continue user name your name of which I'm going to put in my name M Ron Absolute. And as I'm typing your computer name, it's by default is picking based on my first name. I wanted to change that to something different, so I'll use the Lennox a bun to as my host name. All right, so in terms off his user name, I would like to keep it consistent. Across are usually pick I of soul, and I'm going to pick a password. The past for strength is fair. That is fine. You have to option to automatically log in or require my pastor to log in so we'll leave a default. Required my password to log in and go ahead and click. Continue. Okay, so now it's going to copy the falls that is required for this operating system installation . Um, this could take anywhere from 10 minutes to 30 minutes, depending on the speed off your computer. So I am going to fast forward from this point on. And when it's finished, when it when I get the get the option to reboot, that's when I come back and we'll do the reboot. See you on the other side. All right. Installation is completed. Great news. So as message states, installation is complete, you need to restart the computer in order to use the new installation. So go ahead and click on restart now. Okay. The system is back online. now and I have the log in screen. Um, I go ahead and click on my user name and put in password. If you want to log in as root, you have tow click on not listed. Put in the user name as root and the next queen put it a pass foot. It will log you in as root. But I wanted to log in as myself. So I'll click on my user name, and I will go ahead and put in the password. Okay. What's a new in a bun too? So this is going to tell you what works differently from older versions. You could explore that one by one. But since I already know the changes I'm going could just go ahead and click on next live patch. Um now, live patch requires you to do a patch which in east, which enrich your machine, needs to go out on the Internet. You could click on it, but before you do that, please make sure your machine has bridge network adapter, meaning if you go to your war jewel box and go to the setting in the setting, go down to network and right now you notice it is. It's a is attached to Nat. You would have to select a bridge adapter. Click OK, and now it should be able to assign an I p to that machine. And then you could do, um, life set up or whatever that you want to do or even updates. So anyway, for this purpose for this lab purpose, go ahead. Just simply skip and click on next, You're ready to go. You can use offer to install APS like thes. So if you wanted to use the software these third party software, you could go to your software options and download these programs. Anyway, go ahead and click. Done. Okay, so now you have a bun to desktop. You could definitely go into each one of these categories and these differential application programs and go through it to actually familiarize yourself with a bunch of desktop. But, ah, Lennox is pretty much on the command line and wire minutes. So I would say that you should open up your command line terminal and run the commands also , if you have not updated your software on and there is a newer software that is out there on the bun to website is available, it will actually pop up this message. It says update its offer has been issued. So do you want install it again? If you want to install it, make sure your computer This machine has Internet access. And on the network side on the virtual box, your network has not been added, but bridge adapt. If you do everything you have confirmed, then you could do install now. But anyway again, um, desist laps testing I don't want to update any software. I'll just say Remind me later. Now, if you want to open up the terminal, you could just simply right click on your desktop and click on open terminal. And there you have the same terminal that you would get in any Lennox offering system primarily like Santo s, a red hat. This the same terminal you Koran commands like DF minus age. You could run commands like ls minus l and all bunch of commands. Anyway, again, a bun to is a Lennox offering system. I would say 80 to 85% off. The commands that we used in Santo s and red hat are also applicable in a bun to as well. So tried out her run different commands. And, um, again, this is just for, um, experiment purposes. For for your awareness. How'd installation works? You could have them installed and see how it looks. Good luck. I'll see in the next lecture by
17. Linux Desktop or GUI: Let's look at Lenox desktop gooey. When you install Lennox in your environment and you pick graphical interface, it will be installed with desktop called Genome or Katie E, depending on what you picked and I am going through. This lesson for the gri or view is because something that you should know about Gui how it works, how it looks like if you get a question about it, how you need to answer. So let's look at our gooey. So I have that stop qui here, which is Lennox based, and it is called Genome. And if you notice it has two icons, one is home and other one is trash. These two icons are created by default whenever you install Lennox on the top off this window. As you see, this is the consul window. The top menu file machine view input devices help. That menu is for virtual box. This is not for Lennox. Desktop environment is for the worship box. So now let's look at our applications. So when you click on the application, you will see on the favourites whatever you have used most recently, it's probably gonna show up in this menu and you have a Firefox browser and some of the tools, like how you might never get the file system application installer if you need some help and open up a terminal. If you are using gooey most of the time you will be clicking onto the terminal. This terminal allows you to run commands and in Lenox gory environment. It is just like as if you right, click on your desktop and click on Open Terminal. And this is the environment. This is the actual shell that we will be using to run our commands. Other options we have in the man you are accessories where you could one calculator clocks , files text editor and whether, if you are not familiar with the eye, but you should be, and we will cover that in our later lectures, the text editor can be used in the GUI environment to add it. Your text. Then the Goldmans Documentation documentation is about. If you need any help with any of the commands, you could look it up in the graphics. We have to change how to change it. Desktops, Internet office tools, some settings on the sound and video sun dry. One of the option to configure your system with firewall prints. Setting S E Lennox Troubleshooter System tools If you want, change the settings off your desktop environment or even if you want to change some off the configuration, you will go in here and make the changes to the setting option, and then you have other. These are some off the options that you could use to add it the policy. Or, if you want to modify some J D. K. Which is a job based policy tools, but you won't be working with it as much, then the next option. We have places if you go to the home you want, access your documents and download music, pictures and video on the right hand side. You'll see it shows time up here. And then you have these three options any of these options, you click on it. You will get this setting icon so you could pick this setting icon and you will see you could change setting off your gooey desktop by clicking on any of the personalized options . You have his background notification privacy search and then on the hardware level. If you want to connect some off your external devices to the blue toe keyboard. Mouse network is one of the important one. If you are not familiar with network, how do you configure your static? I p you click on it and you could actually go into the configuration and in a sign and I p address to your machine by going toe I p before again. This will come later on during our lectures. So you cancel this out, you go back into the setting and you will see all other different options. They're associated with the same at the bottom you have. If you want to change the system time. Some of the details I'm sharing. If you want to share your file system at the bottom off the desktop, you'll see you have right here. It says one off for this one off war means that you have four different work spaces. Environment. If you have one task running on one desktop Gui, you could go to another work space than you'll be able to perform tasks on another one. So it's just a way off organizing things. If you are user off Mac, you probably have seen this work space environment as well where you could go from one work space environment to another workspace and one. So once again, this is for the genome gooey for Lennox. And it looks pretty much the same in Santo s as well as in red hat. So try it out, try different option and see how those different options are for and just get yourself familiarized with it.
18. VM Management: watchful machine management. Why am I including the voice of machine management in lyrics training? Well, that's a very good question. The reason im including this, is because 80% off the corporate environment nowadays, they run on virtual environment. So whether work environment is running under the VM ware or Oracle warts, realization or right, however civilization, or even if it's Microsoft socialization, you will see that most of those machines that you're gonna be building Lennox on will run unwatchable platform. That is why I'm including this as part of this training. So you would know how you could change. Add remove resource is from a virtual machine that you are setting it up. So again, the virtual machine screen looks like this. You already familiar with this? You already know how to configure or spin up a new water machine. And if you want to add any more, resource is to it when I say resource is what I mean is that you wanted to add more CPU, you will add more memory. You will add more desk. This is part off your job when you will be doing system administration again. Think for a second this will be poured off your job to add or remove. Resource is so that is why it is important for us to go or where this washing machine management now as an example, your built a virtual machine and you install Lennox operating system on it. Awesome. You done your perfect job. But now, a month later, two months later, as user comes back to you and say, Hey, my machine is running hot all the time, it's needs more. Resource is can we please get more memory, more CPU or has less this? Can we please get more disk? So what do you do if it's a physical machine than how do you add it? Well, it's very tough nowadays because you have to pull the whole machine out from the rack top, take off the top off, add more memory, physical memory or add more CPU. Sometimes it's not even available to add more memory dims to a server, so it's not available. You have to add more server Obayan use of inversion machine. That's a beauty of washing machine that you could add all those stuff on the fly so we will take our example off our own virtual machine environment, our oracle and we'll go where a few of the settings that you could change right now are virtual machine. The one that runs Lennox is powered off. So sometimes, depending on the operating system, you could add those resource is on the fly, meaning hot, add or hot removed. So we go to a setting. The first thing we have in the setting is the name. If you want to change the name off your washing machine, this name is not the host name off the washing machine again. What did I say? This is not the name off the host name of Diverse Region. This is just the name that shows up right here. This is the name. So if you want to change change, change something different, you could change it. There's some other advanced option that if you want to quit, snapshot snapshots are like a kind of backup but is not considered back up. But if you are deploying a code in your virtual machine, you're Lennix Machine and the court doesn't work. People always revert back to your snapshot, so the location of the snatcher is specified. If you do not like this location. You could change it Some other stuff. You could look into it in more detail. Dragon drop means if you want to copy something from your desktop while you have a virtual machine running and you want to drop, drag and drop inside of your virtual machine right now it's day sable. You could have it host to guest or guests to host a bi directional. Whichever way you like, you could have changed. So for now I'll have it by direction. So this wave and I started up. If I want to copy something from my desktop to my washing machine, I could do that then. My have a description here. What? This washing machine is done. I could put some description like this work Chul machine was created by Imron of Zil on so and so date. Then do you want that machine to be encrypted? Meaning all the transaction between your host annual Urschel machine. Any transaction going back and forth Do you want it encrypted? So what is the host host is your machine or your laptop? Where you are running this oracle worship box and virtual machine is something that you have built on top of this worshipful boxing. In our example, this is our washing machine. So this effort setting journal setting, then we have system. If you want to change the memory off your system than you could change it right now, you see the memory off your off. Our system is about 1200 1024 maga, which is equal in tow. One gigabyte. If you want change to to get three gig, you could simply put that number here or click on these. Scroll up and down. It will add it. The boot order off the machine. It's gonna go look for floppy, followed by optical than hard disk and network. If you want to be, go straight to the hard disk, skipping CD or floppy on, check it same thing. If you have your hard computer meaning and you have a physical computer, you go to the BIOS, and you do all that setting so you could set it up here and some other extended features, which you could look into it in more detail processor. Right now, we have one process and running your users saying I need to processor or My application requirement is I need eight processes. You could go ahead and change right here and acceleration some of the information hardware virtualization acceleration. You could check it to make it and has which we already have checked. Next setting. We have a display. The video memory we have right now 16 megabyte. When you have when we go to a machine and start and the and the images that come up the graphical interface or even terminal, sometimes you have the option to increase the resolution. So if you have limited video memory, you cannot increase those resolution so you could change the memory here. Remote display. Same thing with all all of this related to the display information and configuration of the words from machine. Then go to storage. Right now, our storage is attached as um, I d e m t, which is the discus empty right now Controller is S t A T. And our disk space that is inside of virtual machine is right here. And it's telling us the virtual disk size is 10 gigabytes and the actual sizes four gigabyte. What does it mean? It means that even though you have allocated 10 gigabyte of this space right now, the actual size that has been uses only four gig. So what happened to the remaining six kick? Well, remaining six gives gig is not actually completely allocated to your machine. However, if your machine does need more disk, it will automatically get it from your laptop or your desktop. Storage audio is if you have any external audio anything or you want to use the windows Derek audience South. Since I have Windows operating system running, you could change that Here network. We have only one network adaptor at this point, and we changed the network adapter to a different way. The one we have internal network which is to communicate between our host, which is our laptop on a machine. Same thing host only adapter. And there is a Brigid attacked her, which Birgitte Adapter does. It's gonna take I p address from your own computer and then it will communicate to the outside world right now. If you just connect host on Lee, you cannot go outside on the Internet. If you want to go to outside Internet, you select bridge adapter and then you click OK, so adapter to Riedel have it adapted three and four. If you want to assign mawr nick adapters to your virtual machine, you could go in and check this mark Serial port. Any other ports that you want to connect, you don't have it. USB. If you want to attach a USB to your laptop that will be read by your washing machine, you enable this any share folder that you wanted to attach to this foursome machine and user interface. How does it look? You want to show in full screen, seem less or show at the top of the screen for any way that you like right here. It shows you when you have a washing machine, these three few operational keys are shown. If you don't want them to be shown, you uncheck it so we'll cancel it, since we don't want to add any resource is. So. This is all about management off your virtual machine. And believe me most of the time, all washing machines set up is done just like that. You pretty much do right click on the washing machine, and you do at its setting or setting, depending on your version environment, and you could change. The resource is this video is important, especially for those who wants to get a job and Lennox our job and system administration. You will be asked sometimes the virtual related questions, because I said in the beginning, 80% off enterprise companies or organizations running their compute environment on virtual platform. So I hope this lesson serves its purpose, and you enjoyed it. Wash this lesson again if you have to.
19. Linux Distribution: Lennox distribution. I will cover here all the clinics operating system and its flavors that are out there, the main ones and the popular ones. There are many, many of them. But a few of them that I captured here for the 1st 1 is red hat. You probably have heard of red hat from many different sources. Red Hat is an enterprise level operating system that are being used by big major companies . They do charge for the support they do provide their own, um, customized, pre configured build offering system. You cannot change it. It's not open source, and anything goes wrong with the operating system. Red hat can provide the support to fix it. Then the next one, we have a scent operating system which is sent a West. This is the operating system. Actually, we will be working with in my course. Um, and the good thing about learning center was is if you planning to apply for a job on Lenox , um, after the course, or once you gain some experience, or whenever you are ready, you could easily find many jobs in red hat for Santo s. It's exactly the same as Red Hat it has also but managed by red hat. They don't provide support on center was and it's completely free. Then we have fedora. This is also one of the popular operating system that is used by many companies. Again, this one is free. Then we have Soucy. Soucie is very popular Obering system in terms of customization, many people uses a this operating system and they change the code to give their proprietary appliances and their proprietary programs. Um, a lot of companies like being where also run Soucy appliances in the environment. Then we have day be in. Um, David is very popular at the PC level, and the last one is a bun, too. So all of these are major Lennox distributions Lennox operating systems that wanted to highlight. Ah, you will be hearing many of these names down the road, and our focus in this course is sent operating system, which is cento us
20. Linux vs Windows: Lennox Forces Windows. The reason I'm including this lesson in this training is because and you need to know a lot about a certain technology, it is good to compare one thing with another, like whenever you can need to compare, um, let's say a car. You have to have certain comparison with other course. For example, if you're buying Mercedes, you should know a few differences between Mercedes and BMW and Audi, said this where you could make a right decision or, you know, the features that you will be getting in your new car. So that's what I'm comparing letters with windows so you would know exactly what the difference is. The basic difference, and you will be able to answer any question that come up during the interview. The first difference between Lenox and Windows is about the price. Of course, Lennox is free, and not all the distributions are free. Right? Had is not, for you would have to pay or subscription support. Whereas Windows it's not free, you would have to pay for it. He's Lennox is now user friendly. You would have to run Jews a commands to get your tasked in very windows you have a gooey to do most of those tats. All you have to do is double click on the program, and you don't. Most of the things are done through the gooey reliability. Linens is very reliable, often times you. It runs from once and years where you don't even have to report it. Where in Windows it often requires a reboot. The windows have done, um, a lot better. It's offering. System has become a lot betters and stable, where you don't need to rebuild or it doesn't crash often. Times software. Most of the software's our enterprise level software that runs and the Knicks wears windows . There's a much larger selection of software, for example, all first games, utilities and a lot more. Also, Windows offers are like chat, chat and social media suffers multi tasking. Multi tasking is one of the, uh, basic reason why people came on with UNIX and the next type of offering system, because back then they needed some type of offering system that will perform multitasking. And for those who don't do not know what multitasking it in terms of harboring system, it's about running multiple processes. At the same time, where, as in Windows, you could run multiple multi tasking. But you do need a lot of high CPU memory. Please do remember, I'm not trying to save into his battle or the nexus the best. I'm trying to compare some of the basic fit teachers. Windows have done amazing job in the past few years, where they have come up with the tools like Active Directory Domain Controller, Microsoft Exchange and you ask us over running on Windows. They have done Amazing job, and they have pioneered the market in that. So there are few things that are very good and Windows, and in Lenox there aren't in terms off program. Ing's security wise of Lennox is very secure, and Windows is somebody secure. And why is that is because Windows is more vulnerable to Seo to hacking because it is facing the Internet because people run like social media type off. Things are chatting sections and a lot of different things that they run and they're they're accessing the intimate were in Lennox. You don't access the Internet open source. Linux is open to public. There's the code is out there. You modify the code. You could come up with your own harboring system where it's Windows. You cannot do anything. It is owned by Microsoft. You cannot have the code open or revealed to anyone.
21. Who Uses Linux: Let's look at who actually uses links the US government and its agencies at the level of National State, federal and International. They use Lennox, and those agencies are such as FBI, I R s and many off the other agencies. Then we have NASA, National Aeronautics Space Administration. They run most of their computation platform on Lenox operating system. So they also they're not only the user plan is they also contribute to the lettuce source code. They So every time there is an update, what is a patch? They also add to that source off the patch. Then we have healthcare environment, for example, hospitals or even scientists. They use Lennox to come up with the newer discoveries in the medicine field. Ah, bullet train in Japan, which runs at the speed of 150 to 215 MPH. They run their platform that does the application that controls that train. Everyone's on Lennox traffic control. Many countries in the world are implemented traffic control, different matters. For example, they have cameras. So every time you break a light, a traffic signal, it takes your picture. And how does it happen there is an application behind it, which since the moment of your car and that application of all analytics financial institutes, for example, New York Stock Exchange all they do their trade ings that trading platform applications running on the Knicks and the tame industries like cinemas, production houses and many other team industries or blood e commerce leaders including Amazon, eBay, PayPal and WalMart run their platform on Lenox. So, for example, if you go to duct upthe dot amazon dot com and the first page you see which is a Web server , that observer is actually running on Alex operating system and many other Fortune 500 companies such as Google, IBM, Bechdel's and Facebook. And many, many, of course, that I cannot add them to dislike bronze on Lenox operating system.
22. Keyboard Keys Used in Linux: Hello everyone and welcome to the lecture keyboard keys used in Linux. Now you're probably thinking, hey, I'm going to the keyboard keys, but I already know these keys. Great. If you know these keys, Beautiful. And I would recommend you could go ahead and skip this lecture right away and go to the next one. But I have created this lecture for those people who are trying to get into IT for the very first time. And I have seen, and I have experienced that those people who are trying for the first time have or had problem in the past. Understanding these keys are even pronouncing these keys. These keys are actually symbols which are primarily on top of the digit key. So I'm going through these keys one-by-one so you understand actually how to access them and how these keys are pronounced. So let's go to the first key. First key is Escape key. Escape key is used when ever you are, especially in a VI editor and you have any key press or in editing mode, you can escape it. And it will get you out of that. So as it sounds, escape as your Escape key, as your lifesaver to get out of any of the previously pressed keys. Then we have tilda, which is the key right below it. Tilda is that little curly thing on top or right below that escaped he usually when you do cd tilde, it's actually taking you to your home directory. And right below that tilde, we have the back tick. Now, don't confuse the back tick where the single coat or even comma, back tick is kinda like backward. And it is a backward single quote. Then we have the next key is the number one. And on top of the number one we have a symbol that is called exclamation point. Now a lot of people have heard of explanation point grade, which is kinda like emphasizing something in English. And in Linux. You could also refer this or also many times it is referred to as bang. The next key is at sign, and I'm sure a lot of people are familiar with that. If you have an email, then you will notice that your email has your name in front of it. And then after that followed by the at sign, the domain for example, at Hotmail gmail.com or wherever your e-mail account is. Number three key has a pound sign on top of it, also referred to as hashtag. And Linux, this key is used and in scripting or in a file or any configuration file to comment out any of the things that are not going to be used and just for information purposes. The next key number four, has a dollar sign. In scripting language that dollar sign is defined as int variable, which we'll cover in the shell scripting module. The next one is the percent sign. Number six has the carrot sign. Also. Sometimes IT people in a simple language, they call it as cap. But in Linux, you, whenever you hear carrot, it means anything at the beginning of something. So if you're doing ls minus l and you wanted to grab, grab something that starts with something you could use the caret sign. Number seven has Am percent, um, percent or and sign. So that is also to put something in the background. If you're running a script, you could use m percent and it will put the script or your process in the background. Then number eight has the asterix sign. Also, if you, if it is hard to pronounce, you can pronounce this star so many times I also pronounce a star so it doesn't really matter. You pronounce a star or asterisk, both are. Okay. Then number nine, it has opened per parentheses. Now again, don't confuse open parentheses with the curly braces and bracket, which I will cover right after the second line. So keep in mind number nine, the curly thing looks like a half C is referred to as open parentheses. Number 0 has closed parentheses. Then next to it we have the hyphen sign. Hyphen sign. No, first of all, on top, it's underscore. And then the bottom is hyphen, which is also used as an option or dash. So if you're running a command in Linux, then you have to specify some times the options with it. Every time there's an option that needs to be access, you have to specify that dash. So whenever you hear dash or hyphen, they both are referred to as each is the same key interchangeably, plus sine equals sign. We all know. Then we are, we have a tab key which actually skips few spaces. Then there is the most important keys, that is curly braces. So opening the top one is the opening curly braces and the bottom one is opening bracket. Just like that. The, on the right-hand side, the top key is closing curly braces and the bottom C0 is the closing bracket. And Turkey or enter key. So this is, I'm sure everybody knows Enter key. But sometimes people also referred this key as carriage return. Then we have colon key and semicolon key. These two keys are used in scripting language as well. Or whenever you're using VI editor, you can specify colon WQ to save the file, which we'll cover later on, of course. Then we have double coat and a single coat. So remember the single code below is not a comma, so it sucks single code. So double coat on top, the bottom is single code. And then the most key that is mostly going to be used in Linux right here is called pipe, which is a simple straight line. It is used to combine a few commands together or take the output from first command and give it. To the second command. Below it, we have backslash. Now remember, backslash is used in Windows and whenever you are specifying a path that backslash, the path that is given in Windows, it is used with a backslash, and in Linux, it is used with a forward slash, which I'm going to cover in this line, the fourth line. Alright, so Shift key, whatever the keys that I'm talking about that is above numbers that are, that can be accessed by pressing Shift key, then we have less than sign. And below the less than, less than sign is the comma. And the next one is greater than sign. And below the greater than sign is period or dot. Now, these less than sign or greater than sign is also referred in Linux as input and output. So if you are using two greater than sign, it means appending to the file. But if you use one greater than sign, then it will overwrite to a file where as less than sign will take the input from the output. Again, don't confuse it right now. I just want you to learn how you could access these keys and how you could pronounce this key. So later in the lecture, I don't want you to be, hey, what is pipe or what is tilda or what is greater than sign? How can I access that? So that is why I have this lecture for you. And then next key is the question mark. And, and below it is the forward slash. As I mentioned in the line in the row above it. The backslash is used for Windows. The forward slash is used in Linux. You could access the path windows to the command line, to the backslash. But in Linux you have to use forward slash. And the last key I want to cover is the right control key. You see on the keyboard, you have to control keys one on the left side and one on the right side. Many times in virtualization or oracle virtual box, if you want to get, you get your mouse, which is trapped inside the window. If you wanted to get out of that and release your mouse, you have to use this and write control key. Also in Linux when we are using certain commands and you do write control key, it will do a different function than then pressing the left control. All right guys. So I hope now you understand each one of these keys and how to access them and how to pronounce these keys. Now, maybe I have pronounce couple of them differently, or maybe it's pronounced different way depending on which country you are living. But that is perfectly fine as long as you know where and how to access each one of these keys. But in Linux world, most of the time that I have experienced these keys are accessed or pronounce the way I have explained in this lecture. Anyway, I hope this lecture served its purpose. And if you have any question, please do send me a message about any of these keys are if you don't understand the functionality of any of these keys, Good luck.
23. WELCOME TO MODULE 3:
24. Command Prompts and Getting Prompts Back: Hello, everyone. Before we get on to module three, there's something important I wanted to talk about. And that is command prompt and how we could get a command prompt back if it gets stuck. So what is a command prompt? Command prompt. Also referred to simply as a prompt is a short text at the start of the command line, followed by prompt symbol on a command line interface. So if you have your linens machine and you have your gooey and you open up your terminal, it will look like this. And if you notice in this terminal window you have this route at my first links VM and then , um, close brackets and hash sign. So the first part off this entire command prompt is the user name route. The second port is the host name, and the third part is the prompt symbol. Now, depending on which system you're logged in, as in Lenox, most of the leading systems will show up the command prompt, like of this. But maybe there are certain letting systems that are configured differently, where you will not see use a name or horse name or a different prompt symbol. But by default. When you install Lennox, this is how the prompt will look like when you see the symbol, the problem symbol. You see the hash tag hashtag means that you are logged in as root. If you're logged in anyone else but route, then you will see a dollar symbol again. This can be reconfigured. Or you could change a symbol as well, Which is which can be done at your profile level anyway, So you have the prompt. Now, if you get stuck at certain command and you don't get your problem back, you could simply type controlled, see on your terminal to get your prom back. Now, let me quickly go into my Lennox machine and I will show you how the prom looks like. So this is the prompt. If you are logged into your Lennox Consul, you install that you logged in. You right click on your desktop. It will open up the terminal again. This part here looks like it's a user name and this is the host name. You can also get the using them by typing who a mile? Sure, you're logged in his route. You could type host name and I'll show you the name off your machine again. This is something that I will definitely cover in the little lecture. But I'm just showing how the problem looks like. And as since I'm route, I have a default prompt off hashtag now getting the prompt back. Meaning every time you need to run the command, you have to have this prompt back. So if you do not have that prompt back, you cannot run a command. So if you're stuck at certain point, let's say if you are trying to run a command, a command, that's a cat again, which will something we'll cover later. You're doing cat and you're doing and you just accidentally hit Enter. You see, it's your commander stuck. Now, every anything you type here is not gonna works. You have to get that prom back to get that prompt back. You have to type control, See, just like that. If you're running another command, that's a top. And it is giving you some information on the screen at Riel time. If you want to get out of this and get your prompt back type control, See again, just like that, if you want to use another command, Let's say less minus l, um, to let's say pipe it and you see it's giving you this, um, redirect sign thing. It means it's also stuck. That means your command was not fully executed. So in order to get your prom back again, type controlled. See? So this lecture is all about command Prompt. If you are stuck anywhere and you do not have your prom back type controlled, see to get your prom back.
25. Access Linux System: excess to Linux file system our Lennox itself at the system. Now, Lennox, you could access any linear system or UNIX system to, uh, a terminal if you have a terminal like terror term. So let's look a few example off operating systems. Each offering system has a different protocol, or klein, that is used to access the system. For example, windows. If you wanted to connect a Windows machine from another Windows machine, you would need her more desktop client, which is also afford as RTP Klein. You put in the I P address off the machine that you want to connect to. Then it's gonna ask you for using and passwords. And the next thing you know, you will connected remotely to another winters machine. So the client that is used is called rdp. Next one we have is a VM ware s X I servers, not VM. Where is a virtualized environment? How do we connect to it? Well, they have their V sphere client, but Visa Klein is another client that is installed on your computer. You open up, you input the i P address. You put his user name and password, and that's where you have. That's where you connected the environment. And last one, the one that we really wanted to know that is Lennox. And how do we connect to our Lennox machines? You need to have a party which is a party terminal, a secure C R T terminal or any off those terminals, Whether it's free or whether you have to pay for it, you have to use that again. For that, you have to put in. They use the name, the password and the I. P address. Ssh! From Lenox to the next is also possible. What that means is, if you are already in a Linux or UNIX machine, you could just use ssh protocol or a cessation command followed by the I P. Address off your remote Lennox machine, and you could connect to it. So again, I'm gonna show you real quick All those three clients. The 1st 1 is the remote desktop client that this is a client. It looks like in your Windows machine you could go to a start and search and just type of more desktop will come up. And that's where you put in the computer. I p followed by the user and password for V sphere to connect to the V center or your sex eyes over hairs. Avian Webbys reclined. And for Lennox, we have this putty client where you put in the I. P. Address on top. You see, the port is 22 which is the port for ssh and then once you connect to it, will prompt you for user name and password.
26. Download and Install Putty: in this lesson we want We want to cover quickly how we can download and install Putty, which is a terminal client to connect to the lyrics machine. So this is how the party looks. So let's look at how we could download it First will go into our, um, the browser Open up a google, and we'll just simply type download hurdy. The first link you get put he dot org's click on it, and the first thing done will put it right here. Click and then you're gonna get to dot M s. I, um, files. Thes files are used on the vendors machine. So if you have in just 32 bit, you don't know this one. Or if you have 64 bet you go down with this one. I have 64 so I'm gonna download this one. It will save the file to your desktop or wherever you have the location on their your brows are set to All right. Download is complete. It should be on my desktop. It's right here. I'm gonna double click Run next. Leave the default next. Here. It will have add shortcut to party on the desktop. I want the shortcut. The party and will be in Seoul on the local hydro. Yes, click install. Okay, The last screen is gonna ask you to view the read me file. You don't have to. If you want to believe a checked on and then click finish what's in Finnish. You go to your desktop, you're going to see this putty shortcut created on your desktop so you could just simply double click. And this is the party client that you have. So we're gonna put in the I P address and the porters already set to 22 then we'll connect well in its machine. But first, we need to find out what is the i p at the Lenox machine. So let's look at that in our next lesson.
27. New network command: I This lesson is about new network commands. Now what? All those network commands Cento us and real There was a command to check your i p address Your interface I p address is in if conflict and that is used for rail or sent to us five or six. Well, incentive Us or rehl seven. They have replaced that command If conflict command with the command i p so 7.5 and up that if conflict command has been deprecate ID So if you are at this point downloading and installing Red Hat 7.5 or Santo s 7.5, you will not have the If conflict command on your system, you will be able to use I p commands to use I p space A or a d d r to list all the available I peas or interfaces that you have. So if you want to use the if convict command in the newer version off off your Lennix machine, then you have to install a package called net dash tools. So the complete command to install it John installed net dash tools. But of course, in order to install, you have to make sure your machine is able to communicate to the outside world. Or in other words, it's it has the Internet access. So let's look at both of these commands and see how they work. So I log into the Lennox machine. Okay, so, um, if convict command is the command will list all your interfaces available on your legs machine. So the primary interface that we are concerned about is this e and P zero as three and you know it has an I P. Address off Fine. 90 to 1 68 56 1 a one. This I p is usually assigned when we have on the on the organ Marshall box. When you go in there and you go to setting on you go to network and then you have host Onley Adapt if you change it to bridge adapter than your I P will change as well. But anyway, the second command that that I want to cover as I p dash or space age, this will give us pretty much the same information. But the one that we are concerned about is this number two which is E and P zero as three and I P address if you're looking at, is this one I to 1 68 56 1 on one. This command can also be run as i p a d d or which is the same as I p space A or I P Space 80. Or you could also run man I p and you will see what are the different options you have available. So So going forward from this lesson, I will be using i if conflict command on a lot of my lessons and on some of them I will be using i p. But if you do not have if convict command, please use I piece base a command which will give you the same information.
28. Connect Linux via Putty: here we will access our length machine, the one we install earlier to our party client. Now, remember you could you have access to our livings machine You could use to party client Or you could simply log and directly to the consul. It's really up to you. So this is the party client. Looks like we're gonna connect to our lyrics machine, which is our first length machine. Ah, through the putty. Let's go to our Lennox machine. Here we have our lyrics machine and that's a consul. We log into the council and then we open up a terminal And that's how we perform most of our task, most for commands. Now, another way to connect is through the putty. Ah, for that we have to assign an I P address to this links machine. So what is Sally Pierre just right now? The commander check is if config so in this call up. You see, here are network adapter. Is this e and P 00 s three, but it doesn't have an I p address. So how do we assign an I P address which we will go into our Oracle virtual box click on setting and go to no work changed in that to host only adapter and click OK, once it is saved because simply one If config command again and then you scroll up and you will see right now it's still does not have the Ethernet I p address right here. It should come up somewhere here, so I think probably the adapter is not up. So we will have to become route and type in command if see, if g so if up. And the name off the adapter, which is E and P zero s three. Once you hit that, it's his connection Successfully activated. Let's wait for the prompt. The prompt came back. Hit up arrow key And look for if config again. And this time you see, it has an I P. Address, which is 1 90 to 1 68 56 101 Now we gonna put in that I p address in a pretty terminal 1 90 to 1 68 the 56 1 a one hit enter. Or you could also save the session saying my Lennox, um, the m like that you could save it this way next time you don't have to type in the i P address. And then you click hair and then click open once it opens. Getting asked you for warning. Sign It is going to tell you if you wanted to keep the ssh keys, it's just await secure wave to connect to Lennox. Just click. Yes, it's gonna say log. And as I'm logging as myself, I so and you probably have your own accounts. A log in with your own account hit enter in the past work. And there you go. This is exactly as if you were logging in through the gooey. Now, the reason we need to know how to log in through the putty is because 98% of the time when you are gonna be working in a corporate environment, there is no gui environment where you're gonna come in and log into the gooey. You always gonna have the putty session where you're gonna put an I P address off the destination server and then you're gonna connect to it. Now, if you type host name, you're going to see your host name right here. So this exactly as this one right here. So in our lessons down after all these after this lesson, we're gonna be using interchangeably. Sometimes you're gonna be using putty. Sometimes you're gonna be logging in as the consul. So it really doesn't matter where we logging in from, But you should know both ways how to log it.
29. Important Things to remember: some of the most important things that you should know about Lennox. The Knicks had a super administrator account called Route. Just like of Windows Has Administrator account with Lennox has Are UNIX System has ruled account that could do anything that could actually clean out the entire file system. Fruit is the most powerful account that can create, modified the lead accounts and make changes to system configuration files. Lennox is case sensitive system, meaning if you typing in in finally with upper case, it will be a per case, not like windows of upper case. Lower case does not matter in minutes. It does matter. So keep that in mind. Avoid using finally, with spaces. Lennox. Of course, it does not like spaces in the final aim, so try to avoid any file names that has spaces in them.
30. Introduction to File System: Lennox file system. Now, what is a file system? A file system is basically think off as a closet as a shelf. Um, when you command you change. You put your T shirts and one shell if you put your socks in another. So there is a systematic way in your closet where you put all your stuff. The file system in an operating system works exactly the same. Opening system has filed system where command files go to a different folder. Peripheral devices of files goto a different folder. All the programs and applications that you install goto a different folders so it will be easier, much easier for operating system to access those files now operating system sores data on a disk drives using a structure called file system, consisting off files, directories and information needed to access and locate them. There are many different type of file system in general, improvements have been made to file system with new releases off operating system, and each new file system has been given a different name. In Lennox, we have file system called Extension three, Extension four X fs, and in Windows, it's the file system called N T. fs our fat legs file system stores information in high, rocky off directories and files. Meaning there is a first folder one folder which is slash a root file system and every other file recreated within the first file or directory. The file system structure in Lenox actually looks like this. As I mentioned, the first file system was first folder. Always start with slash, which is also referred to as root. Now, please keep in mind. Slash route is not as just. Slash Slash is the first directory structure where you have to start your navigating your file system and then underneath it has different folders. As you could see, it has been booed every sector. So this is the the way Lennox structure its file system. Or if you compare this Lennox file system with windows, you will see the Windows has also something like that similar structure. But they have given a different name. So let's look at the Windows file system. If you go to start and you go to computer, you're going to see your C drive. In this case are see, Dr when we refer to our file system structure diagram in the background you'll see right here. This one has slash. So in vendor, it starts with C soc or slash is the same. But seeing Windows and Slash and Lennox. So when you double click on windows, see, Dr, you're gonna see all those different folders. Now, why do we have all those different fold? Why not just one folders? And it will be so hard for the operating system to find the right file or directors that you're looking for. So, for example, like APS and Del, then you have Intel folder. All the intelligence chip related files are in that directory. The Logs program files program files are the folder, and you install 1/3 party applications. That's where they are. Download all the files get, then we have another one program files X 86. That's where the 32 bit related directories are created and users that are the user directories. If you click on it, you'll see my director right here as well. And then, of course, the windows, anything that related toe windows. So that's why it is pre defined by Windows that every time we create a file or over every time we install a program automatically, it gets installed into these files in directories. So just like that, and become here you'll see here that this is the file system the same way in Lenox, this file system is created. But of course, the naming convention is different. Now let's take a look at our legs file system. So I'm gonna open up Oracle Virtual box. So let's go to the file system says it said in the linen file system, it starts with the route. So when you do CD slash, which is root slash hit enter and then you do ls minus. L Here you have a list of all the directories and for house that are starting with slash. You could go into each of these directories and you could see how the file system is structured. So I hope you guys got the just off how the file system looks like. And why do we have file system in our operating system?
31. FileSystem Description: Now this is the time to look at the file system structure description. The 1st 1 has been Slash Been is the directory that has all the lyrics commands. So please remember that Slash been has the directory that has holding his commands. Slash food contains files that aren't used by offering system, but by its boot loader. Every time your computer boots the offering system looks into this directory. So look what files it needs to bring up the operating system, etc. Etc. Has all the configuration falls, additional programs and data files where you could change like if you are running NFS, you're running anti peace and male or you want to change your never configuration any type of configuration changes that you need to do you will go toe at sea and we gonna be working in our training a lot with this directory because we're gonna be changing the configuration file back and forth library, which is short for lip that has all the C programming library directories, which the root account that we have. That's his home directory. Espen. Has the system been Aries? Prock tells you. What are the different programs that are running temp has a temporary directories, and then you have slash home, um, and Windows as his comparison be, have user U S. E. R. In Lennox, we have home. And then the last one we have war. War is very important for you. And you probably gonna be long changing directory or going into this directory almost every day because this is where all the system logs are created. Every time you have an issue with the system, you're gonna go into this directory, you're gonna trace the logs, you're gonna check what the issue is, where the error are, where the problem is. So this directory issues for all the logging information.
32. FileSystem Navigation Commands: navigating to file system. Of course, Now you know a lot of bottom file system. Now we need to know how are we going to get into the file system? What are those commands that we really need to learn to actually go from one directory, toe another, get their file contents and find out which directory were en when navigating a UNIX file system? There are few important commands. Again, The number one command is CD, which stands for change Directory tech and 2nd 1 is P W D, which is print working directory, which tells you Wish Director you are currently in and the 3rd 1 is L S, which stands for listing, which lists the contents off your directory or folder. CD Stands for Change Directory. P D stands for Pet Working Directory and Ellis stand for list. Now let's look at the rial example. I'm going to start with Windows because the reason I compare windows and then it's all the time is because it will be a lot easier for everyone of you to really understand the concept behind it, because we actually work on windows almost every day and the scroll through everything and we clicked through everything and we don't really realize how experts we have become. So if you really need to know Lennox, you there should be some comparison with Windows that I will be doing. So let's look, at example off windows. Okay, So I have to see Dr Which in Lennox is What is the C drive for Lennox is slash. When I wanted to go into this a C drive, I will just do double click and the folder comes up. And when I wanted to go into program files all to double click and the folders comes up and so on. And if I want to go into windows actually, I'll just double click in Lenox. Let's go to Lennox Machine. Remember, our next machine? The first thing I want you to do, of course, has become route. Meaning you are as yourself right now. How do how do you know you are yourself? Is because first you see here on your prop, you'll see Name. If you just still wanted to know your name, you could just type Who am I And you will see your user name you When you become route, you have to type s U which means switch user and just dash enter Put in your password. Okay, So you have this message that would tell you the last time you became route was the state this time and so on. Anyway, um, let's do clear as clear is so only gonna clear the screen. I just want to make this a little bigger, so it would be easier to see. Okay, So now when you are in a directory, how do you know where you are in windows? You could tell right? You could tell you are in computer. Local drive in, Windows writes up right here. But analytics, you don't know. So the command that you gonna need is PWD. This is what's going to tell you that you are in this directory. If you wanted to go into a different directory, let's say you want to go to slash, which is slash Flash is the primary or the parent directory of all the directories. So you type C d. Which stands for again change directory space slash you hit. Enter Once you hit. Enter. How do you know you are in that directory again? You type pwd and it will tell you you are in slash directory now what's inside of this directory? We need to see that in order to see that you have to type LS option l. And everyone tells you all the listings off the directory and folders and files that are inside off this directory in linen and windows. When you are my computer, you double clicking on a folder. Let's say you're clicking on program files around, Um, and you click on any other folder. Let's say Del So you notice you just double clicking it and it is taking you to the directory in Lenox. Udo have that you you don't have clicking. So what you need to do is you need to do CD so you are already what director you're in. You are in route, and let's say if you want to go to a directory, call Ah, that's a boot. So seedy B 00 t boot and there's you are you are in boot. Now let's say in this example you want Come here. You already see the listing off. What's inside? How do we know the listing in Lenox? Well, you have to run a command. It's not that easy. There you go. It tells you this is what you have inside. By the way, some of the lines are chopped up a little, so I'm just gonna make this a little more bigger. Look, So you're going to see anything that stores with Dash right here? It means it's a file. Anything that starts with D, it means it's a directory or a folder. I wanted to go back to my root directory, but before I go back, I wanted to know where I am. Commanders PWD. We are in boot and I want to go to a slash route again. There two ways you could do you could do either CD slash and we'll take you to slash directory or you could do CD dot dot which is will take you one step back. One directory back in windows. How do you do that? And windows? You could simply just do backs flat. Uh, you could simply press the back button back button. And there you go. You have all that also, and windows. You notice you are when you double click. Once it is doing three things for you, you double click wants that is doing CD for you, then automatically it's listing all the directors insights it's doing ls for you already and now how do you know which director you are in right here on top? That's how it tells you. Restrict you in So it's in windows. You're doing three things in one shot in minutes. You actually have to Jews all three commands one by one to see the same thing as you wanted to see in windows. So let's say if I'm in if I wanted to go in etc. And I wanted to go into another directory which is at sea sis config. So I am to directors in How do I know PWD Working directory? It tells you in Etc. Sis config. Now if I wanted to go back to Etc directory what I would do cd dot dot and confirm If you weren't at sea directory you do PWD and the Eagle. What If you want to go one step back again cd dot dot and where you are You are en route. They go. What happened if you just type CD and hit enter Okay, It did work because we got a problem back We didn't get any error. But which tractor? Off again? We are in. Let's check. We are in slash route. Why? Because we are who we are. Who am I? We are route. We are logged in as root and root directory is slash fruit. So everyone this three first three commands that you really need to learn in order to navigate the file system without the still commands. You can not do anything. Lennix. So what other three commands really quickly? 1st 1 is CD. Let's go to home. Let's see what's inside the home. This type ls minus. L you forgot wish Director, you are in this type Pwd. You are in home. If you want to go to a different record, let's say you want to Goto Um I want to see what's inside off slash So I will type slash and what's inside of its Ellis? My cell, These other directors. I wanted to go into each of these directories and final. What's inside of let's see, you want to go to war? Uh, enter what's inside of the war? These are these directories, different type of direction. I want to go to ah fire all a log directory right here. So I'll do CD log. What's inside of log? I have to do. Well, it's my cell again. These are the files and directories inside. Off locked Victory. Okay. All right. I forgot where I am. Where I am. PWD Warlock Art. I want to go back to slash directory. You could do dot dot then dot out again. Or you could just do simply CD slash. And now where you are, you are in slash. All right, so this concludes our lesson. And I hope you have pretty much a very good idea about CD l s and P W D. Commands as a whole. Work of a strongly recommend you to log into your Lennix machine. Go two cd slash. Then unless my cell and I want you to go into each of thes directories one by one subdirectories, come back to from a directory, find out the listing off the directory, and then you will find out exactly how to navigate the system.
33. Filesystem Paths: file system part pats. Here we will talk about how we could never get the file system through to the absolute path or relative path. So So, basically, there are two pats to navigate a file system. The 1st 1 is the absolute path, and the 2nd 1 is the role of the path. An absolute path always begins with slash. This indicates that the path starts at the root directory. An example often absolute path is if you are going to go into the Samba Directory, which is in War Log directory. It has two directories abo it so you could start with CD slash war slash log and slash Samba will take you directly to a samba folder. By the way, this is just a example that I picked up for to make you understand about the absolute path . Then we have the relative path which does not begin with slash. It identifies a location relative to your current position. An example of relative path is you see d into slash war. Once you are already in war, you could just do CD logs. Now you notice we're not using slash log because we are already in war directory and we could just simply go into CD log. And then from there we could see the into samba again. Here you are not using slash log or slash samba because they do not begin with slash, they are within the slash war directory. So let's look at the example. Okay, the first thing you have to do is become root user s you dash, you put in a password. Now, if you wanted to go directly to the samba folder, you could just go cd slash war slash log slash samba Where are you? You are in soir log samba If you notice if you go through the relative path, which means let's go to slash We are in root directory, slash directory and you want to go to the war directory. You could simply do war or you could also do war once you in this directory. And if you try to do at this point, if you try to do CD slash log, it's not gonna find it because what you're trying to tell the operating system that there is a log directory within the slash directory, which is not the case. So how are we going to get into the log is by simply CD log, and if you do PWD, you'll see you are in war log Now. If you want to go into one more directory, which is samba, what command would you run? CD slash samba or CD sama? Well, you will run CD samba and will take you to the samba directory. When you do P W. D, it would tell you you are in war slash log slash samba directory. So this is the main difference between the absolute path and the relative path. And the reason you use thes two different path is because if you already know the directory where you want to go in, you don't have to go into one directory than the 2nd 3rd off Ward. You could directly go into the path off the directory in our case, which is again war sash, log slash samba and there you are. And for example, if you want to go to another director, let's say we're going to CD at sea, says config and network scripts. You could just do that, and it will take you there. By the way, if you hit Tab, it will auto. Complete your directory. If it exists in there now you Which doctor you are in you and it ceases config. Network scripts. If you want to get out of from one directory, you do CD dot dot Where are you? You are in it ceases config. You want to go one step back, you do CD dot dot and you are in etc. If you want to go one more directory out, you do CD dot dot and you do. You are into slash directory again, the Root Directory, the main parent directory. So that's the That's what this lecture is about to tell you. Ah, the difference between the absolute path and relative path.
34. Directory listing overview: in this lesson. We're gonna cover the directly listing attributes when you do Ellis within a directory to use CD into a directory, and you do ls and you're gonna only see the directories inside. But when you do ls minus l or lt are other options. Within that the A list command, you're going to see different fields that's gonna up on your screen. The first field is the type off the file. So if any file that begins with D it is a directory, any father begins with L. It's a link, and any file that does not have anything on it. It's just a regular file. So the first few tells you about the type The second field tells you about the number of links. It has a heart links that attached to the directory. The 3rd 1 It tells you the owner of the director who owns it, that the fourth, the 4th 1 tells you the group off the directory. Which group owns the directory and then the size off the directory or file the month, the day, the time and the name. So these are the basic attributes When you do ls minus. L Let's go to our Lennox server and see how it looks in our living server by click Open terminal. Okay, where's directory? Are you end that stupid W d and I am in my directory. So let's go to slash home directory. Sorry slash Uh, just last doctor, which is the parent, and then we'll do ls minus. L. Here you'll see the first again. The first column right here tells you what type of file. Otis 2nd 1 How many links? Who nerve group, owner, the size, the month date time and the name. So this is what you should need to know whenever you're doing. Ellis. Because if you are trying to do CD to Ah, Fire, let's save you. Have this while test foil. If you do test. If you're trying to get into this file, it would tell you it's not a directory because it's a file. That's how you should know whether you are able to get into a file or are not. If you go into let's a CD slash user there you go. You are in slash user directory because it's a directory. So that's how you find out whether a file is the directory or link or just a regular file
35. Creating Files and Directories: creating files and directories in this lesson view will color how we could create files and directories different ways to create files. The 1st 1 is the touch. The Touch Command creates a file that is, of course, an empty file. The second way to create a file is if you are copping an existing file and creating a new fall at the destination location and the third way to create a file is through V. I, command of EI is our editor, which really people cover in detail later in the lessons. But I will cover quickly how we could create ah file using V I creating directories. The easiest way to create directory in the command is M. K D. I. R. Bridges make directory. So now let's get into our Lennox machine and we will use every command listed here as a practice to create our files. Okay, the first thing we have to do is to find out what user I DVR logged in. As so you do. Who am I ever tell you? You are logged in as yourself And then the second thing, you have to know which director you are in and I am in my home directory. Now I have I will be creating ah, few files and as your whole work. I want you to create those files and directories as well. The first way to create a file. Here's here. I have a list off ours that I will be creating. We will use the first command to create a file. Will be touch. Okay. Touch space I have here Jerry had enter. When you hit enter and you get the prom back. That means your command worked. Now, how do we know? Where is that file? You do, Ellis minus l and you'll see here the directory you have is right here, Jerry. Sorry that not directly the file. Now, I want you to create another file. Touch Cramer again. Check if it's created. Yes, it is created Jerry and Cramer. Now, I used the option ls minus. L, which will list all the falls under directories in alphabetical order. If you wanted to list all the files or directories that are created, it it was last modified. You will use ls minus lt. Or which means give you everything by the timely water and in reverse, meaning the oldest, one of the top and the newest one at the bottom. When you hit enter, you'll see Jerry was the 1st 1 that was created, followed by the Kramer. Next one we're creating is George. How do you verify that file was created? You do, Ellis l Now these files can be changed or renamed removed, but we'll go to the next set of files to create. Uh, I want you to use this time to copy command. So I want to use copy Jerry, and then the destination file. I want you to be Lex. Dual assman sell to your So what exactly did it copied this Jerry Fall and named it Lex? I want you to do the same thing for Clark. So copy, Jerry. War cream work or whichever fall and Do Clark. Same thing. Copy. Jerry and Lois, let's where Five. You have all those files. There you go. We got all six files. So now 34 has recreated with touch Command three compiles recreated with the ah copy command. And the rest of the files will create using V. I now remember V. I is a very tricky so I will only create one file on. We will cover the V I later. So be I. Space Homer. So hit. Enter. Once you hit enter, it will bring you to file editor. Now, be very careful what you type in here because you will not be able to get out if you really don't know what you are doing. So at this point, I just want you to do shift Colon W as in right Q as in quit an exclamation point, which is also for as bank hit. Enter the file. Homer is created. How do you verify? It has to address myself to your And there you go. The home or file is created. Now the other three files I will create by the Touch Command. Now you will notice You don't have to run Touch command over and over again. You could run the test command just once and do bark space Lisa Space and May or G March scenario with this Just one command. It will create three files so hit. Enter verified. All three fathers Bart March Lisa off them are in this directory now. Ah, the next step I want you to do is create directories with in your home directory. So just do pwd just to make sure you are in home directory. Then from here, you do em que de ir space Seinfeld. Now the directory is created because you got you got your prom back. How do you wear? Abide unless mind sell tr and you see at the bottom That's where the directory is created. And if you notice some of the limits, distributions also changed the color for use of this way. It will be easier for you to identify which one is the file or which one is a directory. Same way launched to create another directory M k D I o r Superman. And again, you could also do the same way. Uh, instead of running, um, come one command after the other, you could just run one command and followed by two different directories. So the second victory we have a Simpson Simpson and hit enter once you hit and turkey and do this myself to you are the all three directories at the bottom and you have all your files right here listed here. So this is the way you create files and directories in your home directory If you try to create a directory in, let's a slash or somewhere else where you do not have permission. It would tell you that this directory you don't do not have sufficient right secrete directory. So let's take example if you go to CD, slash, etc and I want to create a file here, let's call it, um, test 123 and hit. Enter. Gonna tell you you do not have permission to create that fallout in there because we don't loan slash Who owns the slash root owns it. And you are not root. Who are you? You are yourself. In this case, I have salt again. We learned 34 commands Touch copy the I to create falls. And the last command we learned to greet directories is M k D I R.
36. Linux File Type: linens file types. Did you know there are seven different types of linens files in Lenox that includes directories, lengths and whole bunch of other stuff? Let's look at them one by one. The 1st 1 is a regular file, anything that does not have a letter associated to it in the beginning. Off it, it's a regular file. Anything that starts with D. It's a directory. Any attributes off a file that has a L in front? If it is a link and anything starts with C is a special file or device file, meaning if you attach a key boat or a C, P or memory, anything that is attached to your system that has also created as a file and that false starts with C and there is a socket file starts with s name pipe that starts with P and a block device that starts with B often times thes are the type of questions that are asked during the interview. They'll ask you tell me the file that stars with, um, see, what does that file is for or what is the file that starts with P? Remember, I'm not talking about the file name I'm talking about the first column that you see when you run ls minus l that defines a type off file that you're dealing with.
37. Finding files and directories: finding files and direct trees. Often time system administrators are system engineers are traditions. Whoever the user off limits is they forget where files are located, just like in Windows. When you want to file, find a file, you're given a little search box and the top off the window and your type in the search and looks for its file. It takes a very long time, of course, and Windows. But Lennox. It's a lot faster and a lot easier. So there are two main commands that are used to find files and directories in your system and the reason you need to find it. If you remember, I gave you example off our closet, you go into our closet. You you want to find a shirt that you haven't been born for a long time, and you don't know where you have a which drawer of its shelf. You do need to have tools to look for those files and those tools in linen or find and locate. So we're gonna use those for commands in our lyrics environment and do some exercises and see how they work. So here we have our limits machine, and let's find out where you are. We are in our home directory and in our home directory. We have files, um, different files in different directories. I wanted to go into Seinfeld directory, and I want to see what's inside of it inside of it. There are different files called Creamer George Jerry Putty, Seinfeld characters, all those different parts. Now what if you are you go back one step and you are in home directory. And here you you thought that you created a file called Cramer in this home directory. But when you come in here, you don't see it. So you could either go into each directory one by one to a less command and find it, which is very cumbersome. You don't want to do it so you could find it by the command. Fine. The first. The syntax of the command is fine. And where do you want want to find it? You could give a relative path, which is dot which means in this current directory, start the search from this concurrent directory and this contradictory is home. I have self so fine dot Dash name space, double coat, Cramer, the coat clothes and you hit enter. It's gonna tell you that the Kramer file is inside off Seinfeld directory. And it's in their starting from this current directory. So this contract, he has Seinfeld dirty? Yes, of course. And now I know I created that Cramer file and signed folk. Okay, perfect. Locate. Command works the same way. So you are in your home directory and you want to locate Cramer. This is telling you exactly where that file is. Fine. Command is used sometimes to look for files in a very high rock way, where you have tons of different directory where locate is gonna find you in a short searches. So if you want to find where that's a are never file is where does located. So if you see fine slash because you want to find the network file from the root off the file system because you don't know where that file is Starting from which directory. So you always start with root space Dash name comma. If C f G dash and what is our interface? We don't know our interface a well, just control, See, And we'll do if config and aren't if S e and P s zero as three. So fine slash name. C f g. This is the name is a file name off our interface, which we will cover by the way later. And we want to find it now. We're getting all the permission denied. Whoa! OK, OK. Relax. Relax. Why are we getting permission denied? Why? Didn't find it? Mm. Okay, I know why. And I'm sure you guys know why too. Because you do not have permissions to go into certain directories. So why? Because you are I have cell and who have permission to go into different territories. Tell me route. Yes. Route has it. So you do s you Stroot to become root, put in a password. Now you run that command, find slash from the beginning. C f g, Dash, D and P. Um, I always forget that story. Okay, so fine slash name. And if c f g, Dash d and P's OS zero s three and now I'm gonna run it now, it's gonna go into every directory and look for it. The 1st 1 is just a run directory. It suppose this is just so for the process itself. So don't worry about it. You ignored 2nd 1 you'll see it, found it. It is telling me this file that you're looking for is in etc. Sis config. Network dash script. And if c, f, g, Dash, E and P's OS three, if someone asks you, where is that file located? As if it's in just a general question or if it's an interview question, you know the best way to answer it is I will run my fine command or locate command to find where that file is located. So practice those two commands, run men on these commands and look for different options that are you could use for these commands and see how easy it could become for you.
38. Difference Between Find and Locate Commands: Difference between find and locate command. Now we recently learned what, how we could use fine command and how we could use locate command to find the files. They're usually people forget once it created. So now we need to, in this lesson, we will learn what is the exact difference between final locate command y. We would use one and now use the other, or vice versa. So locate command uses a pre-built database which should be regularly updated. While Find command iterates over a file system to locate files. Does located is much faster than find, but can be inaccurate if the database can be seen as a cache is not updated. So in simple words, the difference between locate and find command is locate command has a database that it maintains. So if that database is updated and then you try to find it using the locate command, then it will be, the search result is going to be a lot faster. Whereas fine command is actually relies on file system to do the searches. It does not have a database. That is the main differences between these two commands. To have the database updated. Whenever a new files are created, then you have to run the command update db. Or if you do not run this command, then by default, perhaps after a few minutes or hours, that the system or the operating system will run or update the locate command database itself. But if you do not want to wait and UI to get the result right away, then of course you have to run the update db command. Now further, without further ado, let's get into our Linux machine and I'll show you exactly what is the difference between both of these commands that we have learned in the previous lesson. I'll go straight into my Linux machine. I am logged in as myself and my host name is My first Linux VM. Okay, so now if I create a file, let's say touch, and let's call it Susan. And hit enter. Now where am I? Which directory I'm MIN. So you do PWD? I am in my home. I absolved directory. Okay, perfect. Now, if I want to find the file, I will run the command find.me, this current location, dash name, Susan, and hit enter. And now it's telling you the Susan file is in this current directory. You could also do the same thing if you could specify the full path, absolute path, which is Home I saw. And then you hit Enter. Then it will tell you that this Susan file is located in home i of soil. If you run the locate command on Susan, you think what will happen here? It will not find it. Why? Because the locate command relies on its own database, a local database, and that database is not updated yet. So for that database to know, hey, there's a new file that we've just been created called Susan. You need to know about it. Then what we need to do is we need to run the command update db. When you run it, you'll get that error message saying update data db cannot open a temporary file for war urllib and locate m located db. By the way, this is the actual database file where all the files information on the file system are stored. So it saying it cannot update, why? Because or it cannot find it or cannot open it because VR not root. So become root. And now run update db. It has completed exit out of root. Make sure now you are yourself. Now you run the locate command on Susan and hit enter, and there you go. It finds it, it find it so fast. So locate command. You do not have to specify the path where it has to go and look for. You do not have to specify the options dash name. It's that simple. You will run locate command followed by the name of the file that you're looking for. And it will find it in the split of a second for you. That's why locate command searches is a lot faster, however, it relies on the database file. So make sure every time you create a file and you need to do locate command on that file, run the command update database. So that's the main difference that I wanted to cover in this lesson. I know I had a lot of people, a lot of students ask me about the fine and locate command. So I added this lesson for you guys So there is no confusion about it. And now you know everything about these two commands. All right, enjoy.
39. Changing password: changing password in this lesson, we will co of how do you could change the user password? Either you are route and you force the user to change the past from in the first time you log in or if you you're just yourself and you want to change your own password, you should change your initial password as soon as you log in. Now, this is when your account is created for the first time in the system and you log in with a password that's been given to you. Or sometimes what happened is a password is not given to you. You would just long in with your user name, and it will automatically prompt you to put in a new password to change a password. The command is password followed by the user. I d. The password is not the entire work. It's just p a s s W d. It does not have all an r in it. So it's password space, use variety and user. I d in my case is I have solved and you hit Enter. It will ask you for your old password or your existing password that you have. You provide that password. The next thing it will ask you is to put in your news password. You input your new password, it will reconfirm the new password for it. So I will ask you re type your new password. The reasoning to ask for the second time is because if you have made a mistake in your earlier entry of adding new password, it will match to confirm that you have added the right password. Now, if you just type p a s s w d while you are route, remember, it will change your cruel password if you type he s w d followed by user I d. Then it will change the password off the user. So let's log into our Lennox machine through council and see how he could change are just a passport. Here we have our legs Machine council just to a right click and open the terminal. I always like to make this terminal little baker make the window a little bigger. I could just simply drag and drop or go simply back symbolized by clicking here. Anyone? Let's get into our changing password. So when I type password well, by my user, I D it say's Onley route can specify a user name, so only Root has a right to specify the user name. I'm not rude. I'm being myself. Who am I? Who am I on myself? So all I would do is just put it, just password command, not to use any of a tent better. And now it's asking me to change or to provide my current password. So I'm gonna put in my password now. It's asking me for a new password. Remember, I'm not putting this. I'm just gonna put it 1234 and let's say what it says. It says the password is sure than eight characters. So let's put in 12345678 And it says password fears that the dictionary check. So now UNIX are most of the operating system nowadays. Have this check where it looks for a dictionary and see if that password exists off. See if that word exists or not. So make sure you change. You change the password to something that does not go with addiction. I'm gonna change it to something different. There you go. See? It took it and reconfirm it and password authentication tokens updated successfully. So that's this command to change the password. And I want you to try that command. Try come up different types different, different ways become route and change your password by typing password. Um, I have solved Jews name and then log in as yourself. Try that command.
40. Wildcards: wild cards. What are while cards, just as his name says they are wild cards, meeting. If you play cards and, you know, in poker or blackjack, they do pick a card like a 10 or nine, whatever the card, and you could match it to any of the card to make your flash trail or whatever that you like. So that is kind of a wild card. So just like that in Lennox, we used wild cards to get the output that you were looking for. Ah, wild card is a character now. This is a definition right from the Lennox Dictionary that can be used as a substitute from any off a class of characters in a search. So there are many wild cards, but the most basic ones I have listed here they're three. The 1st 1 is the one I use most of time is asterisk, which is also referred to as a star. Ah star represents zero or more characters, anything that matches but that star placeholder. We'll look into that in a moment when we actually used the star wildcard in our Lennox machine. That we have question more represents a single character so if you have Ah, file name, text and you're looking for any files that has the word text. And you could use t e instead of ex. You could just put question mark in there and then t that means what ever files that had t e doesn't matter what's inside off the X and the last letter is X the tea, then it work. The 3rd 1 we have brackets, which represents a range of characters. So it's better we look at in done limits machine to understand them more deeply. I'm gonna bring up my machine real quick. Where did it go? Right here on long den hallways is myself and I'm in my home directory. Of course. Now, um right now these are the files in directories in Exist in my home directory. I want to create nine files that has a name that's a A B, C D one and X y Z and then same thing instead of one. It just increments the number 23456 I could do this. Touch a B c d one dash x y z one time, then hit up Arrow key again. Change wanted to changed to three and keep going. But don't you think it's cumbersome? A tedious It is. Right. So we use wild card to perform that task because you're gonna create nine files. So it's just a practice that we're doing for nine follows. Trust me. In a corporate environment, you're probably gonna have to create, like, thousands of miles. What you gonna do? You gonna just hit up arrow key and or type it 1000 times? No, that's not productive. So then what do you do? Use wild cards? So first of all I'm gonna do is I'm gonna remove these files one by one. Again. I could removed vile card as well, But let's created first and I'll show you how I could remove it. So I have two left now. I could use a wildcard to remove both in one shot removed, ABC wild card. So what is telling it? Removed everything that has a farm name that starts with a B C and whatever that comes afterwards. You don't care. Just remove it. Hit, Enter. That's myself here and you'll see all those two files are gone. Now I'm gonna create nine files and to create nine falls. I'll use the command touch as you know, the touches. A command to use. And then there's a wild card, another oil card that's called curly Braces. So I was creating filed A B C d curly braces one dot dot nine because I'm gonna create nine files. So this curly braces 1.9 selling create nine files that has digit one through nine and Dash X Y z. When I run this command, what do you think that I will have listed in my home directory? I will have nine files right here at the bottom. You'll see. I have nine files. Awesome, right? This is what you wanted to do? It is much more faster to do in the wild card as opposed to typing what by one. So let's use the gastric. It what? I just want to list every file name that starts with a B. C. You do ABC ass trick, and you will have all the files that starts with a B. C. I want to remove every file that starts with a B. C. You could remove one by one a B, C D. One and so on and so forth again. Very cumbersome. Don't do it. Your system administrator. You are smart folks. You don't want to use the commands one by one. What do you would use? You use a wild card so you'll do a, B, C D or a B. And to Astra the reason I picked the four letters. Because if I just pick a and hit Asterix, it will also remove any other files in my home directory that starts with a and which I don't want to do it right now. I don't have any file. So let's say if I create a touch A So now I have all the files and a so I just want confirm I don't have a so I don't delete any file accidentally. So yes, I don't have any. Father begins with a other than these. So if I just do it removed a Asterix ever removed all the files that starts with Kate. Let's check it. See, all those files are gone. Isn't that cool? Yes, it is. I love this asteroid because I use it all the time. I'm gonna recreate those files again by heard hitting up arrow key that will return my last ran command. Just confirm they're there now. What if I wanted to remove everything that ends with X y z? Same way removed. But this time we'll put Asterix in front off X Y z it enter. Boom! All gone. Awesome! I'm gonna recreate it just for the exercise off this lesson. It created nine files. Now we'll want to the next wild card. But is the question mark, The next question mark is telling it ls minus. L question Mark B C d pastoring. Okay, what am I asking here? I'm asking is gave me all the files that has whatever the character is the first, as long as the other characters has B, C, D. And whatever comes afterwards, these are the matching files because whatever the first characters weathers a or not, I don't care. I just want to make sure I will get the listing of the files that has B, C. D. And after the So that's how you use the question Mark and the last one we have brackets bracket is gonna tell me that gives me anything that has C or D letter in a file. It's just that simple either. See, either d either f or this and that. So you put all that stuff that you're looking for inside of the bracket and you will have all those files you see here. And it went so fast, I'm gonna put it in mawr. Put. I want to see one page at a time and you'll see it gave me. And it has a has be every file that I'm getting as either has A or B either has A or B. So that's how it works. That's how wild card works again. Now I want to get rid of all the files that has, um why x and y in it. Awesome. I have my wild card. I'm not gonna go into leave one by one. So this command is telling the show that go head and please delete all the files that has X and Y in it. And X and Y has to be together, Of course. So we do have these matching files X y, and it was good and delete it, and all of them are gone. So while card not necessarily is used just with LS or removed, you could use it that any of the commands you we have. You could use it with all the commands we have learned so far. Try it, try it with different commands. If it doesn't work, that's OK. Go online. Google it and try wild clad while Clark Examples Try them. Just get familiar with them. This will help you a lot in your job, I promise you.
41. Soft and Hard Link: soft links and hard links. This is, Ah, one of the important topics in Lenox and something that you will have to remember because you will be working on creating soft links and hard links in your linens career. Or if you're gonna be working in the system administration capacity before I tell you anything above what a soft link and hard link is, I have to tell you, I knowed what I know is I know is basically a pointer or a number off a file on the hard disk. So if I create a file call, let's say Hulk, that file name is H U l K. That is a name for me as a human for me to understand the name of the file. But computer does not understand names computer, understand numbers. So every time you create a file, computer assigns a number to that file on ah, hard disk and associate that number to it, that number is called. I knowed. And every time he tried to retrieve the file or read a file, it goes and retrieve that number. So now, now you know that I know. Let me tell you about a soft link. Now a soft link is a link that when created and it will be removed if ah, filers removed or renamed. So if I create a file and I link, create a link a soft link to that file so once it created, it actually looks for that. I know through that file, so that creates a softening. So if I removed the source file, it will remove the destination. Like whereas Hard Ling has been the leading A renaming the source file, the heart link will not change. It will remain the same as if you have copied it. To create a hard link command, you will run l n as a link to create a soft link. You will run the same command, but with the option minus s. And I have a picture right here which, of course, as picture speaks 1000 words. So if you see on the right hand side, it's myself. Link. It is connecting through my file to the I note where, as my hard link is connecting straight to the I note. So if the middle part, which is my file dot text goes away, my soft Lynn goes away However, in my hard link file, if middle file my file dot text goes away, it doesn't matter. The file stays. Let's get that log into our machine are letting machine, and I will explain you much better how those lengths work. By the way, one more thing I should mention. Link is just like a shortcut in a regular term, as if you are creating a shortcut on your desktop. In your Windows environment, you have a fire located somewhere in window system 32 blah, blah, blah blah. Of course, you have to go to the file all the time by navigating through that file system. Click, click, click, click, click, click, click, click. So much work, man. So what do we do? We create a shortcut to our desktop. All you have to do is double click and boom. It runs the same. Just like that. We have linen softening and hardening. So without further ado, I'm gonna log into my machine and I'll explain you and this is our machine. It's gonna drag it'll and more to the left. Just why? To confirm again it I am logged in as myself. This is my name. This is my home directory. Perfect. I want to create a file. Cold Hope everybody knows Hulk, right? One character, big joint character. I like it. Like his movies. Okay. Anyway, uh, I created Ah, file call, Hulk. Now I will like to create a link to that file Hook. I will go to temp directory. I am in Tempt Not in my home directory. And I want to create link soft link to hook and hook fire location his home I have solved. And the name of the file is hooked. Boom. It created the file link. How do we verify it? Your friendly command. Unless my SLT are. And if you see right at the bottom, it is telling you it has created a link and Lennox operating system. Since we are running Lennox with the goo, it's changes some off the color changes to blue. So right here the first bit it's telling you it is l What is l four? L is for link. What is D for D is for directory? Yes, very good. And what is a file that doesn't have anything? Of course, it's a while. I already answered that. Okay, anyway, so it created a link. Now I will go back to my home directory, but just typing C d p w d to just confirm I am in my home drippy. Yes, I am. And I will type something in my file call hook. So I'll do echo and do, um hoc is ah, super hero. Okay? And I will put that to poke fall when I do Cat hook, it's their right. Okay, Now I'm gonna go to my temp directory, and I'll do cat this. Confirm I'm in my temper. He is, And I'm gonna cat the hoc. And you see, it has the same content that's just typed. And so it's just a short, good, just a link. I will come back to my home directory and I will run ls minus. L I What is I? I stand for, I notes if I wanted to find out the I know off this file I will run. I So, um yeah, it's there. But since I didn't type unless minds lt are went into middle school type talismans lt r and then high. So this way it will be at the bottom. If you see that I know number right here is the number that is associate ID with my file hook. Again, I note is the number that is remembered by your operating system. And it is on your disk. It doesn't remember hope. When I go to temp and do ls my cell to your and right here. If I do, it s minus. Lt are I to find out the I know off this hook, it has a different I knowed. Is it a different? I'm not sure. Let's check ls minus. Lt are I. And I'm gonna do home. I have so hook, it has a different I knowed. So this one is remembered as a different file. It is remembering at its link. It does not know that it is actually. Ah, file. It just knows it's a link. So this number is associated to a link. Now I will go to my home directory again, and this time I'm going to remove the Hulk. Public is gone from my home directory. Right? I'm gonna go back to temp directory and I'm going to see where my whole kids But if I just type Hoke will just give me hook. So, Hulk, is there but it's no longer blue or its look crooked. Why looks crooked? Because the file is gone. If I do cat right now and do hook, tell me what will happen. No such file or directory. Of course, there is no flat file because the link is removed, the source link is removed so the link will still linger around, even though the source off the link is not there. So it's better they'll just remove the link as well. And just verified. Yet it's gone. If I just wanted to do ls myself tr just through hoc. Yeah. See? No. So that's how the soft link works. Now I will explain you how the hard link works. Let's go and create our file again. We'll call it Hulk again, and I will put something inside the file that go. Hoke is a super hero. Okay, I'll put that in hook. I do a verified. We'll just do cat the file. And yes, Hulk is a superhero. The continents there. Now I will go into temp directory and I want to link to this file creating hard link. You see, I'm not going with minus s option s stands for softly so I'll do link home. I have saw Hook Link is created. How do we verified you just run ls minus l to your and you will see at the bottom. It's telling me that the link is created now. The difference between this link, hard link and soft link is that there is no pointing to other file. That is the difference off Harling softly. Now, if you'll read. If I read the content of this file, it says Hulk is a superhero is the same content, everything the same. Now let me go back to my home directory. I'm in their home directory. Let's check that hook file, and I will write down something else in it. Now that go 123 and then to hook. Let's read it. Hug is a superhero, and then 123 in the line. I'll go back into my temp directory and cat hook, and it is added here as well. So what is telling us that you could modify the source file? You could modify the contents of the store source file. It will modify the destination link, which is perfect. Now let's go to my home directory again. And this time I will remove hook. All right, health file is gone. He confirmed it. It's not there now. I will go back to temp directory and I will do Unless my SLT are again and you will see the file still exists. The link still exist. And when we do, Hoke and Indust still have all the contents. Have you put it in? Well, okay, so what is it telling us? It's telling us that in the hard link, when you remove the source off the file, it does not remove the destination. So that's the basic difference is I'll go ahead and just remove this hog file as well. The Hulk A link as well. So, um, please do remember the difference between soft link and heart link. Many times, these question will be asked during the interview. If you're not going for the interview, if you are just wanted to, um, level up your career, have fun
42. Welcome to Module 4:
43. Linux Command Syntax: command. Centex. Every time you run a command, you have the option and you have argument. Command typically have the Syntex like command, like as if you are running command. Let's say L s It's a listing command. The option is gonna be the minus l or Lt or whatever used in argument. If you are looking for a Pacific fall now, what are the options again? It modifies the way that a command works usually consist of ah, hyphen or dash followed by a single letter. Sometimes some commands except multiple options which can usually be grouped together for a single hyphen. And what are the arguments? Most commands are used together with one or more arguments. Some commands Azuma default argument if none is supplied and arguments are optional for some commands and required by others. Let's look at our Lennox machine and I will explain you exactly how the commands and text works. So we are in this Lennox machine again. The first thing you always have to do is find out who are you are who How which users are you logged in? As so you do? Who am I? You are yourself second thing, which director you're in. You're in sash home and slash your user. This is your home directory. And by the way, every time you start type CD, no matter which dirty you are and you're always gonna come back to your home directory now when I mean by command. So the first when we run command ls in your directory, you will see all the directories and files it has without other details that you get So when you use the option so you do ls mine's l. This will list everything that you have in your home directory. And then it will also give you all the details. Whether it's a committee, it's a directory file size who owns it and all the bunch of stuff. So you adding the option with vision minus l. So options can also be grouped with when I'm meant The group is it means ls minus l. And you could add another option to it. Just t Do you see the It will list all the contents of your directory by the time they were created. Then when you do another option with that ls mines lt, or it will still give you the all the listing, but I will list all the newest files or directories starting at the bottom and the oldest one from the top. So that covers are ls as a command. And then there are the 2nd 1 is the option which we use ls minus lt are. And what do we mean by argument? Let's look at the argument again. Argument can be used to be more pacific. Meaning, Let's say, if he wanted to know just a file, Bart. So you do ls minus. L b a r t. This is gonna Onley list the file bark if you want to know the details about the file Bart Ah, who owns it was a permission on it. You could just use that argument to list this. Now you have command, you have option and you have argument If you wanted to, let's say delete Ah directory, which is, by the way, the command to the lead is R M removed minus f, which is to remove without asking you whether they they should delete it or not. You could just stood move minus f And then let's say Avant, remove Seinfeld and when you hit enter, it's going to say cannot remove Seinfeld. It's a directory. So we have to use an option to remove it. And true, to remove a directory with an option. It is the less said if this time you take out f and we just do our So are is an option to remove a directory. So when you hit enter it will remove the Seinfeld. And how do you validate that? You do ls minus l to your and you're going to see in your listing. Seinfeld directory is gone, and I want you to recreate it again is m. K D. I R Sign fell. You do ls minus l to your And there you go. This has at the bottom. It has your new directory, Seinfeld. So again to wrap up this lesson Ah, we cored the command, the option and argument and the best way to find out which options you have available with the command you always run, man, which is stands for manual and l s, which is the command. When you hit. Enter, it will give you ah user command a manual which will give you all the options. Like if you run minus a it will ignore entry starting with dot If you uppercase a Biggs and C and so on and you could just hit space to go down and see other option keep hitting space . He pitting space Keep hitting space and you see all the different options. And by the time you get to the bottom and you cannot hit space anymore, you could just hit queue to get your prop back. You could also run a man Ellis hit, Enter. And if you just wanted to view the first page with job without going any further, you could just simply quit out of her right away instead of just hitting space base and go to the end. So you had que So this is what primarily recovered in this lesson again, command option an argument.
44. Files and Directory Permissions: file permissions in this lesson, we will learn how you could change permissions off your files and directories. This way you're protecting your environmental files and your directories from being viewed by other users or being deleted by other users. UNIX is a multi user system. Every file and directory in your account can be protected from or made accessible to other uses. By changing its access permissions, every user has a responsibility for controlling access to their files. Permissions for a file or directory may be restricted to buy it types. There are three types of permissions. Read right and execute. I'm sure you know, read and write. What does it mean by execute? If it's a program, if it's if a file itself is a script or program, it has an ex permission, which is executed herbal. Not everybody is allowed to run a certain permission. So if a user is allowed to run a program, they would have executed herbal permissions to it. E permission, which is read, write and execute Herbal can be controlled at three different levels at a user level, which is yourself at a group level, can be people in the same project or group or same department or others like everyone else . File or director permission can be displayed by running LS minus. L command. So you will see here at the bottom. You'll see. Read write X. The first bit shows that it's It's a file. The The next three bit shows it has read, write and execute herbal permission by the user. The 2nd 3 bits are for the group, and the 3rd 3 bits are for the others. Command to change. Permission is change Mod Ah, lot of times salts referred to as she Ahmad. So let's look at our links machine. So this way I will better explain you how permission works again. The first step you always do is to check who you are. You are yourself. Which director you're in, You're in your home directory. And when you do ls this command will show you documents and folders and files. But it's not going to show you the details whether it's a directory, what permission it has or what's the size off it? So what's the option we use? I'm sure you know this by that by now. Ls minus l or L T R. Whichever you prefer. So when you do ls minus l You see the listing off all the files with all its details. Now let's pick one file. That's pick. Um, we'll pick Jerry. We also use the option ls minus. L Jerry Here. You'll see the first bit right here, Dash. This one refers to as its a file this second three bits referred to as read right and execute. Now this shows the user I have solved, which is myself. Who created this to file has on Leigh read and write permissions. I do not have execute permission. It means I This file is not a script. That's why it does not have executed herbal If it was a script that it would have x to it. So I have me myself, as I have sold, has a right and right to read the file and right to right to it. The second group who owns it who has a permission is right here is Har w and again Dash which means the group which is the group itself, is also I have soul also have r w and dash and the last one is other. These last see permissions is that the others are can only read this fall. They cannot write to it or they cannot delete to it. So these are the permissions at the level off user group and others. Now, let's take the command to change these for permission. What's the command to change? The file system is changed. Mod Again. Every time you are learning a new command, I will highly recommend you that after the lesson you run man and C h m o d they followed by the commanding. This will give you all the details about the command, what it does, what options it has, what the commands are used for and so on. So I'm gonna use C h M o d command and I. What I wanted to do right now is I want to have the group right here. These three bits. I want this group to not have the w the right permission. So I will do. Is G as a group minus w and the finally Jerry. So what I'm telling the opposite system to do is remove their write permissions from the file name Jerry again. This shows that I have a command right here. and these are my options. And these are my arguments. So once I execute that, you will give me my prom back. And when I do, Ellis minus lto my cell, Jerry, and you will see right here. Now there is no right permission. So anyone in the group I exult cannot write to this fall. They could still read it, but they cannot write to it now. I want to remove the read permission from everyone. So the command to do that is C h m o d. And if you want to do for everyone, the Usu's A As for all minus or and which fall are you working on your working on? Jerry? So you hit. Enter and you do ls minus lt Or or just l and Jerry, You will see no one has read permissions. Now we only have the right permission by the user. I have sold. I want to remove that right permission as well. So what would do C h m o d? And now which option? Um am I going to use and will use you as a user? Remember, we had three different groups. Three different ways. We could change it right here. Eat. Permission can be controlled at three levels. U g and O. So I'm gonna use you as because you as myself. Minus W. Jerry, how did you ever fight again? You do at this myself, Cherry. And there you go. Now, you could tell by looking at this file that it has no permission. So even myself, if I wanted to delete this file, I cannot delete this fall. Let's look at our M to remove a file, Jerry, it will say remove right. Protected, ugly, empty file. It is giving me the warning sign that you this is write protected. If I say I guess that it were amore. Because since I'm the owner, actually, but it does give me a warning sign so I don't want to remove it. I'll just say no. And then if I wanted to read a fall to read a file, you could use the command cat, which were liable cooler later on. But for this lesson, I'll just tell you, Jerry, we could do the reid, and I will see it says permission denied. Why is that? Because I don't even have a read permission to read? Uh, fall. So I wanted to give back all the access that all the permissions that I had in the beginning right here is the file on. I wanted to give back all the permissions. Let's start with first User C H M O D. And the user is you and I want to give Plus because I'm adding permission. I want to give Reid and w and Jerry. Let's see if it has a permission. They want. Yes, it has it now the user has it now. I wanted to give this group the same thing. So what do you do? By the way? You could run up arrow key to go back to the last command that you typed. So this, in this case, will just to replace you with g hit Enter. Let's check it again. And there you go. We, the user has it rewrite. The group hasn't read right, But others don't have anything. We're hoping recreate the file. Others had to read permission. So I wanted to assign to others as well. So the command to do is is changed mod others plus read. Jerry, Let's try it again to see if it worked and it did. Now we got all the permissions back. Now this same command works in a directory, works on a link and works in a file you could use on Anyone said these are the three permissions that you could see. You have this permission column. The first column in your ls minus L output. This would tell you what kind of permissions you have now. What if a directory has this Execute herbal right here? Does that mean the directory is a script? No. The reason it means X here is because you could CD into that directory. That's where you have X in the directories. So if I have this, um, directory called Seinfeld, I could do CD Seinfeld and I log into I could actually get into the Seinfeld directory. Now let's go one step back and to a less minus. Lt are again. And now I don't I want to take away the permissions to f for everyone to go into the directory. So what we'll do is change mod. I want everyone so a minus execute herbal sign ful. So now when you do ls my sanity or you'll see this directory has read, write but no execute herbal, read, write no execute herbal, read, write nor read. Nor excusable. Nor right so Kenna and CD into the dirty. Now I don't know. Let's see CD's hind Phil Permission denied. All right. Why? Because we don't have executed. All right to that directory. We have to have execute herbal right to CD into that directory. So let's assign the permission back all plus X sign ful and this check again and you will see the sign for the bottom now has execute herbal, execute herbal and execute herbal. This is how you could protect your files and directories from being manipulated or being deleted even by accident.
45. Files and Directory Permissions Using Numeric Values: Hello, everyone. Now that you have learned how to assign permissions to file and directories using letters But now do you know you could also assign permissions using numerical values? Yes. So every time you have a file, you could assign permission to their file or directory using numerical digits. And how does it work? So, you know, change mod you g o is for user Group and other plus R two a file, but actually assigning Read permission to everyone. If you wanted to use in a numerical way, you could do change Mod for 44 And the file which will assign exactly the same permission as in the first command and the end result will be read, read and read permission on Lee to everyone for a file. Now, how does that four for four changes and a sign that permission? Let's look at it by looking at the structure off a file. So, as you all know, owners assigned permission on every file and directory and we have users and they have three type of permission. Read, write execute Herbal Group has three type of permissions and everyone else or others or all have those to you trapper, permission this waltz. We all know that. Then let's go. More specifically, that the 1st 3 bets that we have already covered are for users the owner off the file. The 2nd 3 bits offered the group and the last three bits are for the others. Now, moving on the table below that I'm going to show you are is actually assigns numbers or permissions to the permission types. So let's look at that table. This is the table is something that you need to remember. Now if you have zero assigned, that means no permission. One is for execute Herbal two is for right. Three is for execute plus right four is to read five is to read and execute sixes to read and write, and seven is to read or write and execute. Now, how does these all +47 numbers all off All eight numbers work. If I If I do change marred 764 to our file, then it means the first digit will always be for the user itself. So seven meanings. If you look at the table, it means this is going to assign, read, write and execute herbal permission to the owner of the fall. The second letter, which is in this case, is six. It means that a read and write on Lee and that will be assigned to the group, and the last one is four. That is for others. And the four means on Leigh read So on. Leigh Read will be assigned to the file. So again, first digit is for user. Second digit is for group, and third Digit is four other. So let's try in our Lennox machine in a lab machine and see how it works. So I'm going to create a file. Let's say, Sam, I'm going to touch and credo file saw Sam. I will do a list minus lt are and the file is there. By the way, you I am logged in as myself and I am in my home directory. So that's clear this green by typing clear into a less minus. Lt are again and you will see the sample is all or all the way the bottom. Now, by default, I have given the permission as read, right, read, write and just read. If you wanted to change this permission 2764 meaning me as myself would have read, write and execute. Herbal and group will have on Leigh. Read, write, and everyone else will just have read. Then all I have to do is change Model 764 Sam. Now, when you do at less money, sell to your you will see right at the bottom. I have now read, write, execute herbal, read, write for the group and just read for everyone else. Now, if I wanted to remove those permission, let's clear the screen and just do ls minus. Lt are on Lee on sam file So just only that file shows up on the list. If a line to remove every permission off everyone else, I will do change. Mod 000 Sam do ls minus. Lt are by hitting apparel key which will bring the last ran command and you had entered. You'll see all the permissions are gone now If I wanted to let's say if I want to assign, read and write permission on Lee to myself then how are you going to do it then? All you have to do is change. Marred myself would be the first letter. Remember the first Sorry, the first digit. So I just want read and write only. So that would go for number six. Because if you look at the table number six only gives, read and write, then the rest. I don't want to assign anything else. So you cannot leave anything empty like that. So you have to leave 00 Still no permission. It'll type it, Sam. Not if you do. Ls minus. Lt are on Samuel C. I only have read and write. So let's try one more time. What if I want to keep these permission? Read and write and why. Toe assign Read permission to the existing permission for others. Meaning? Right here. The last three bits. I want our here. So for that I would do first of all change mod. And of course, I wanted to keep the permission. And that permission is six for group. I don't want to assign anything. And for others I want on Leigh read. And if you look at the table, the read number associated with Reed is four. So if I do hit four and type Sam And now if I do ls minus lt or on Sam, you will see. Read and write and read is only given to others. In this case, let's look at one more and last one example. What if I wanted to assign? Execute herbal permission to everyone in the in the system for you to change mod? Know what's execute Herbal Execute herbal permission. If you look at it, it's number one from the table, so that means 111 because I want to sign. Execute Herbal to myself, two groups and two others. So 111 and sample Let's do ls minus. Lt are and you will see its Onley given xxx and now you go on Lee execute herbal. If you wanted to have executed and read, then you would have given number five and 111 which will give you yourself. Execute herbal and read, and the rest only execute herbal anyway. That's how you use this table. Or that's how you use the new Miracle letters. Sorry in America Digits to assign permissions. Also, if you do not remember this this chart or if it's not handy with you, you could also go online. There are many calculators online that you could use you all you have to do is type online , chump change, mod calculator, and it will come up. A lot of websites have those free calculators for you. All you have to do is pick. Click on the ownership group or public meaning others. Whatever that you want to do. Check those marks and at the bottom you'll see links. Permission. It will give you the exact number that you need to type it in for change. Mine. It's very easy. Anyway, you could do either way you could use you could do using the letters or you could do so using the digits. I just want to cover both methods so you understand how the permission works, using both methods.
46. File Ownership Commands: file ownership. In this lesson, we will cover how files and directories are owned and how we could change the ownership off those files and directories. So the file ownerships are created on user level and a group level. There are two owners off a file or directory a user, the one who creates the file or directory. And the 2nd 1 is a group. The user, the group that belongs to, If you are if you belong to two different group and permission applies. That second group has a read permissions. Or it could delete a file or directory as long as you in that group, and you would have that right command to change. File ownership has changed Own, which is also known as Chief Home and Change Group. C H g R P Change own changes. The ownership off a file changed group changes the group ownership off a file recursive ownership changed option. If you are using an option with change own or change group with minus upper case are, it will not only change that directory, but also all the files and directories within the parent directory. If you look at the example off windows Let's say we have this full dick, all videos. And when I click when I do right, click and go to properties will see that under security. This file is owned by the systems, and I have so and administrator. So you see these two people here? These are the group and a single user. One person here it's just a user. And again, the system is a group. So group system and administrator owned this file or folder called Video, and the user who created that folder is I have so and you see at the bottom it tells you whether that user has read, write or secure herbal permission. You could see right here. It has all the permission that we talked about in our Lennox machine. When we log into our Lennix machine again, the first thing, what we do, you see who we are. So we are ourself. See what falls or directors we have. These are all the listing off ours and directors we have now here in the 1st 2nd and hair the third column. The third column tells you who owns this file. Let's say we go to Lisa. We created this file Lisa and the person who owns this file, Lisa is the user I've saw or yourself yourself. In this case, the four column right here is the group name in this case is IVs all again because I am part off my own group. I belonged to my own group. I could change that to a different group. But since I'm a regular user, not a super user, I won't be able to change that permission to any other group. That Onley person or the only account that could change that. Ah, ownership is route. So let's become route s you dash. Once you log in, you do P W d. And here it will bring you into slash route. Now remember, you are not in your home. Director, You are in group director because you are route right now. So I want you to go to your home directory. Which is she remember slash home and slash or use the name. It will take you to your home directory. You could just to pwd to confirm and to a less minus. Lt are to confirm it at the time that these are your directories and files. If you wanted to change the permission off Lisa, and you wanted to change it from yourself. And you wanted to have this owned by route. What you'll do is change own and you specify the name off the user. You want to change too? And the name off the file, Lisa. And then when you do a less myself to your you will see right here the file is now owned by route. You could also do just to be more Pacific so you don't see all of the files you do unless myself, Lisa, and you'll see here. Now the file is owned by route. You could do the same thing when you do ch g r p, which is to change the group. You could do the group. Also, there's another group called Route, and you could do Lisa again on ducal. Verify it. And now you'll see this file. Lisa is owned by a route, and in the group who owns this file is also route. Now what happened when you become yourself again? How do you get out of this route account? You just simply type exit. You're logged out and just confirm who you are. You're yourself which directory or in your in your home directory? Do ls minus lt. Or And you see there is this fall, Lisa. Now what happens if you try to delete this fall? Let's see. RM Lisa, it will tell you. Remove right. Protected regular off empty file. If you say yes and duelist my cell tr There you go. It is gone. The reason it is gone now Why is Because And you go one step back to your home directory. So your home is right now is sash homes like yourself? And then you go one step back. You are in Just sash home and do a less my cell. Here, you'll see the of salt directory, which is your home directory has permission off yourself to read, write and execute. Meaning anything inside of the director you greed you could write and that you could execute to, regardless, if whoever puts the file in whoever owns the file our, um who whichever groups owns that you could go ahead and still deleted. Now, if you try to create a file in, let's say at sea and you go touch test file, it would tell you permission denied because you do not have permission to write to this file. How do you check that? You do ls minus l slash. You could do that or you could simply go to CD slash and do ls minus l. And you'll see here is a list of all the directories that are inside of slash and the one we were trying to go to is at sea. If you notice it at sea is owned by route and the group is owned by route as well. Now the route has the permission to write to it. But what about the people who are in roots group? They don't have a permission to write to it. What about everybody else? They don't have a permission to write to it. So that is why you cannot create ah file in at sea. So let's let's say, if you become root again, okay? And now you go to etc. And you create a file touch test 123 It's verified. A list minus L t r. You see, the bottom is your file. Now another way. What you could do is while we're working on this, you can minimize this window and you could open another window by right clicking and clear , open Terminal said. This way we have a regular account which is our account and the root account. So there. So if you don't have to exit out of a rule account So we are here. I have solved which director of urine, urine slash home and we created the filed in etc. Right as a route. So let's go to etc. And let's see ls minus l to your. And now we're going to try to remove this fall test 123 and it's gonna see it removed, Right, protected. It's just a warning. You said yes and it stills his permission denied. Now why? It's saying permission denied again. You go to a CD slash name and you do ls minus l and you will see right here. That's the at sea directory and it's tell you right here. The Group three bets do not have write permission and the other three bits do not have write permission as well. So that's how you change these user of the files ownership and group ownerships that the two commands that we learn is chief ownership, which is C. H o and w Sorry. Ow! And And the 2nd 1 has changed group so again really want you to do a man on each command and go over the description, The different options it has same thing you do with the with the second command as well. And also, I want you to practice this command by changing the permission Onley in your home directory . So your home directory is slash home slash yourself and you could try changing permission to one of the directory, like create a new fall. Don't testify that you created and just see permission test file create this while and just ah, practice your change. Um, ownership and change group. Ah, command on this file and see how you could change it.
47. Access Control List (ACL): Now since we are on the topic of assigning permission to files and directories and changing groups and ownership. We have to look into access control list as well. Access control list is another layer, or I would say a top layer or additional layer that runs on top of your permissions, which allows you to assign permission per user. So what is ACL? Eco stands for access control list, which provides an additional more flexible permission mechanism for file systems. It is designed to assist with Unix file permissions. Acl allows you to give permission for any user or group to any disk resources. The use of ACL. What is the purpose? Think of a scenario in which a particular user is not a member of a group created by you. So let's say if you create a user ABC and it's not a member of the group root. But you still want to give some read or write access. How can you do it without making the user member of the group? And that's where we have access control lists, which will help us do it. So let me put it in a very simple words one more time. So let's say if you want to allow a file that is created by root and allow the user to read that file. Now, that user is a regular user, not part of the group root. And you want the user to read that file. So of course, the one way to do it is you change the read permission of others, the last three bits, so others can read it, but then, or everyone else could read that. But we only want one user to read that instead of all other users to read it. That is why we only gave permission to that particular user using ACL. I hope that clarifies. So basically, ACLs are used to make a flexible permission mechanism in Linux. From Linux man pages, ACLs are used to define more fine grain discretionary access rights for files and directories. The commands to assign and remove ECL permissions are set F ACL and get f ACL. So set file ACLs, getFollows, ACL, get file, ACL, give you the information about what the existing permissions of a file and set will allow you to sit the way you want it to say. Let's look at a few examples. Here are the list of commands for setting up ACLs. To add permission for a user, you have to run a command set, F, set file ACL with minus N option to modify U for user. And then you have to separate it with the columns where user is a huge user name. In my case, it will be Ives Aww. And then call them and the permission that you wanted to give the user too. And then of course, the last part is the file name. Which file do you want to get the permission to make sure you specify the complete absolute path to add permission for a group. You can also allow the permissions to a specific group. So again, if you give permission to, let's say read permission to the group, the middle three bits, then every group in your Linux system can read it. But what if you only want one group to read it, right? There could be a problem. So then again, access lists, access control list comes to the rescue. And to add the group to allow it to read or write that specific file, you have to sit with g and group name and the permissions to allow all files or directories to inherit ACL entries from the directory. It is within meaning cascading, which will be set with minus d m option and then entry, whatever that you want to put in and the name of the directory. Sorry, of course the directory because you wanted to cascade a file cannot have a file within itself. So that's why directory would have to have that. To remove a specific entry. You have to do set F ACL when minus X to remove it. And then you have to specify the user and the name of the file. This is only for a specific user. Now let's say if you want to remove all the ACL permissions from everyone, then you have to do set F ACL with minus B option and the name of the file. Couple of things that you need to remember. One is as you assign the ACL permission to a file or directory, you will see that it will add a plus sign at the end of the permissions. So when you run ls minus l, the first column which shows you the permissions. It adds the plus sign at the end of it, which shows that it has an ACL assigned to it. The second thing is setting with W permission with ACL does not allow you to remove a file. So you can modify the file, edit the file, but you cannot delete that file. That is something that's still the user keeps that permission to itself to delete it. So now let's get into a Linux machine and we'll try a couple of these commands to learn how we could set ACL permissions to a file that is owned by someone else. Ok, I am logged in as mice as root. Of course, you can always check the root has the pound or hash sign to it. But again, always make sure, make sure you are on the right computer. And I am on my machine. I am in my tmp directory and I'm going to create a file. Let's say I'm going to call it Texas, and I'm gonna pick just TX as an acronym. Let's make sure it is created and has a write permission. As you can see, it has created owned by root and owned by group route. And the owner can readwrite. The group can only read and others can only read. If you do get F ACL on the file, you'll see more information again, file is this owner group, their user permission, group permission. The permission now comes to a part where you'd want to allow everyone, sorry, where you want to allow only I absolved to write to that file. Then Ives all as you know, counts are considered as other, right? I absolve falls in this category. So if you give right here, if you give that permission as W right here, then what will happen? Everyone else can write to that file. So again, I hope you understand where I'm getting at. So to overcome this problem where only one user can modify that file, then you assign it as a set FAC. So do set F a Cl minus m to modify your permissions. You for user, who's the user IAB saw. And what permission you want to give. You wanna give read, and write. And the name of the file would be temp. And the file name is Texas. But before we run it, I just wanted to go in and start sorry, not this. I want to go in and start a duplicates session and I want to log in as i have. So right now, if I do cd, temp and cat Texas, there is nothing in there. By the way. First of all, sorry, not cat because everyone could read it. So I shouldn't have a problem. But what if I wanted to edit it? So VII says it says at the bottom right here read only. So even if I put in something hello or whatever that you want to put and save it, it will tell me I can open up a file. It's not editable. I do not have permission, so I cannot do it. If and I run this command, get file ACL. So I set file ACL with, I absolved with Reid as well and write as well for that file, hit enter. Now to verify it, if it asks me has set those permission, you do get F ACL temp TX. And you will see right now, right here it says user I absolved has their right to modify it. Now, if I do EI Texas now, you see, I do not have that same error that I was getting it before. I could just put in anything I want. Hello Texas. Oops. Next. Save it. And it lets me save it. And when I do CAT ON texas, I am able to do that texts. So that's why these ACL are so important to assign that Pacific permission to a specific user. Same thing if you wanted to do that group assignment to the permission, you'd run the same command, but instead of you, you put in G and it enter. And when you do get F ACL, you will see now group Ives all also can modify this file. So if a user is part of my group, they could actually go in and modify that foil. Going to number for the number 31 is to actually assign those permissions and cascade down to every file and directory, which is very simple. So I'll jump right into number four. To remove that Pacific permissions, I will have to do set file ACL minus X. And what are you taking out? You're taking out the user i absolves permission. And for that you have to type the file name. Run, get F ACL, and you'll see that I absolved user is gone. But what if you wanted to remove everything, not just user, but every permission for every user or any, every group, then you will have to run the command set file ACL as minus B option. And now when you do get ACL, you'll see it's back to its original state. That's how it works. And when I said you cannot delete, even though I do have the write permission to write to the file added that file, I cannot delete that. So if I do RM Texas, by the way, I have to give the permission back again. This is the permission. Let's verify it again. Yes, I do have permission to read and write to it. So if I try to remove it, it will say operation not permitted. So the reason I'm including that, so I don't want you to waste your time by, you know, trying to delete that file and thinking, hey, I do have the write permission, but y cannot not delete it. The reason that ACL does not put that in there, so it only gives their right to only this user just in case by accident that user deletes a file. So that's how the ACL permission works. It's very granular and it goes down to the user level. And again one more time, the reason it was built or it was introduced into the Unix or Linux environment is so we could assign permissions to the user, not to the every user, but to a specific user. So try it out and try different, tried on different files, try on different directories, See how the directory works as well, how it could change the files. If you can login cd into the directory by giving Pacific access to a user.
48. Help Commands: help commands. Now, what are the help? Commands, Um, that are used in Olympics environment That will give you some of the information or some help about other commands. Ah, there are three types of help command their use in most of the Lennix distributions. The 1st 1 is what is. So whenever you run a command, what is followed by the command that you want to inquire about, You'll run waters and spaced and command. This will give you a quicker assure version off the information about the command that you're looking for. The next one we have is the command. Whichever command you honor on, Let's see ls space and then dash Dash, help! This will give you a little Ah, bigger. Ah ah! Longer version off the help of it. More details about that. The options about that command and the last one is man, which is stands for mental man space, followed by the command the man name itself. When you run that, you'll get a complete full listing off the command descriptions that help about it. So now let's look at our Lennox machine and we'll see how these commands work. So we're here in our Lennox machine. Let's to the clear and you'll find out we are again. Who am I? View ourself. You type clear. The first command of you learned weaken A run is what is It's all one word space. Let's say, ls this will tell you the let the s is list the directory contents. The next one will run ISS. So what a CD. That's what tells you the bash built in command. The CD is a bash built in command, meaning when you have your Lennox system installed, it comes in its pre built command. And what it does it change the working directory from one directory, of course to another. Well, let's try the same command to what is pwd Ah tells you print name of current working directory returned working directory name. So why do we have two different, um, answers? Ah, for one, command is because we have two different sources or two different dictionary already installed. Ah, are you could say two different mental pages installed on our, um on our limits distribution. There are there could be more that could be 234 or five, depending on what type off command it is and what kindof description it has. Let's look at the next command. Let's say ls dash dash, help. Um, see their ago. It gives you a little longer description off your Ellis command, and it tells you all the different options that are associated with less command. So of course, right here. That's where it starts. And it goes all the way down. Tells u minus a option minds uppercase option and so on. Um, because also run C h m o d dash dash help. Remember, C h m o d command A za changed my command of a change the permission of a file. So when we do help, we're going to see it tells you, gives you quick description starting from here. It tells you that change the mod off each file to that are a file changed, Ahmad, if each file to mode and a few different options, um, same thing you run this command with other different commands. Space doctor slash data help. It will give you the information about the command. Now, the last one we're going to look at is the man command man, central mental, and then space. Let's say Ellis and you run this command, they go. It will give you a very nice, descriptive way. Ah, nice formatted way off the user command information tells you the name snaps is the description and each option off the command. You could do space to go. Ah, on each page. Ah, hit space bar space bar Every time you want to quit out. Just had Q and you're gonna be out if it same thing when you do a man command and then pwd you do, um, enter and you're going to see an exact same thing. Www Deeper in name of the current working directory. And what are the options? It has my favorite command. Um, in all those help commands is this man command because it has exactly the information that detailed information off each command?
49. TAB and Up Arrow: tap completion and up arrow key In this lesson, we will learn how When we run the tab button on your keyboard, how can it completes your directory or your command that you're trying to run and how the up arrow key works and how returns you last round command hitting tab key completes available commands, files or directories such as when you running change. Meyer mod this command, it has o. D at the end as well. So if you just type C h M and hit Tab, it completes the command for you the same way when you do ls Space Jay and a tab, it will list all the files that starts with J. Then you have CD D s. So if you do see d d as headed tab, it will bring you any all the directories that matches the 1st 3 letters uppercase de es. So basically, the tab makes ah typing a lot easier and Lennox, so you don't have to run the whole long commands again and again, you could just simply tab if you know the command and it auto completes it for you. This is very useful feature and Lennox I'm telling you, this is very useful. Once you're gonna become a riel export in Lennox, you're gonna be using this tab button almost every day. And every time you logged into Lennox Machine, then we have another cool feature off. Lennox is heading the up arrow key. What that does is every time you hit up arrow key, it will bring you the last ran command on your Linux terminal. Isn't that cool? It is cool because you don't have to run the command again and again and again. So you just hit up a rocky and boom and hit Enter and we'll run that last comment. So let's see how these Katou, um, tab and a park He works in our Lennox machine. Let's clear the screen. Um, so the first command I want sure use. Let's say if you have C h m and more deep, this is the commands of what if I just take out CH OD and just right now hit tab. It completes that command for me. But if I just do see it and hit tab twice now, it will give you all the commands you see that starts with C H Now, you know, there are many other different commands that start with C. H. And you could try different commands to see as long as you know about the command. So don't run in command that you really don't know. Or you I would recommend you run man command on that before you running it. So another way we could check our tab is if you wanted to do ls And I want to do Ah, J. I wanted to list all the father has Jerry and I will have tapped. There you go see it. Auto completes my jerry. Why did that? Because most likely, I only have Jay fall starting with just one file, which is this is the one J Let's say they are to files that starts with three files. Actually, that starts with L, lex, Lisa and Lois. And let's see what happens when I do ls and do l and hit tab twice. It gave me all three files that starts with l. Isn't that cool? You don't have to actually go into the directory. Full do ls minus. L look for your father. As long as you remember the first letter and you hit tab. It will give you everything that starts with it. Same way we'll do ls minus. L and let's say for want to do desktop. I wanted to see the into desktop, etc. There is this, um, folder we have in our home director desktop. Right. We could do CD this de es Kate s top type. The whole thing Get enter ongoing. Let's go one step back again. Or we could just do CD desk and hit tab and it auto completes it for you and you hit enter . Isn't that cool? Will save you a lot of time. I love this this feature off Lenox, and I'm sure you're gonna love it too. Now, the 2nd 1 what I was talking about is the up arrow key. So if you hit upper key right now on your desktop, you'll see it will return the last command that we ran. If you hit it again, it will keep bringing all the commands that we ran in the sequential order seats. So far, we have ran so many commands and it's bringing everything. So now if you type the lower case, the down key, it will bring you back to all the commands that you were last friends. Now we didn't run any command. Um, after CD desktop, if we wanna go back again. Up arrow key, desktop leg. So now, um, let's say I want to do this m I want to do so. Um Ah, Let's see. What is, um, Ellis? And what is pwd and clear? And one more command. We will run. Let's say date Date is another commander will cover later on. And so you're on it. It will give you the date off your system. So now, um, you ran a few commands 45 commands. Now, instead of typing all those commands, you could run. You could up arrow key. One time, two times, three times, four times five times. And it is bringing all the commands you ran. So, guys, this is what it is all about. The up arrow key and tap key. I'm telling you, this is gonna make things so much easier once you're gonna become expert at the end of this course. All right? I hope you really like this one. And I really want you to practice this tab and a perky again and again, again. So you will know how these both features work.
50. Adding Text to Files: adding text to files or read Eriks Um, Harry will learn. How can we add a text or digital letters? Or how can you populate an empty file? Recreated some off the empty files using touch, command and touch is just, ah, a way to create an empty fall. But now how can we add text to those falls or anything that you like to add to it? There are three simple ways to a text to a file and the basic main ways to add textile files. The 1st 1 is through the V I editor. The Eye is editor. It's a command that is used in Lenox to create a fall and at text messages to it. Then the next one is redirect command output using the the write direct and the to write directs to a file, and this lesson will cover their these redirects through ah, command output into a file. And the 2nd 1 way, we will learn to echo when you want to echo whatever did you type? You could output to ah, file. That's how the file gets created. Or that's how the file get populated with information. So let's look at on our limits machine and run these commands. So here we have our links machine. Let's make sure we are in our home directory. Yes, we are in our home directory. Let's clear this green and let's check. What are the different files we have in our home directory? Okay. We have all those different files and directories that we created earlier. Now, we wanted to add something to, ah, file any empty fall. Because if you see here, these are the few files have he added. And all of them have zero bytes. And it because these are empty files. So when you wanted to do echo and you type Hi, my name is Imron and you hit Enter. It brings you back the exact same thing that you type. So the command echo actually echoes back what you shouted out. So how about if he output this to ah file? So I will say it's a echo, Jerry. Sign Fell is the main character and the show sign felt So this is the text that I wanted to type. I wanted to add into the file called Jerry. And how are we gonna do it? We couldn't do it by redirecting the redirect, which is a key right above your, um the dot You typed over the shift, and then you specify the name off the vile, which is Jerry it enter. You'll get your prompt back now, when you do ls minus l and you Hit. Enter. You're gonna see Jerry has 58 bytes inside of that file. Now, all of the fathers who are because we didn't put anything in there. Now, that's good. He added something to our first file. This is amazing. Okay, now, how do we know what's inside off this file? How do we check it? How do we verified? We do know that the CD gets into our ah directory. Unless lists all the files. And PWD tells us where we are about how we're going to see what's inside of directory in windows. How do you do it? How do you open up a file? Well, you do a double click and it opens up in Lenox. There is no double click. Then how do you do it? There is a command called cat Cat is a command to read the content off. A file will cover the cat command a little more in detail in the next lessons. But for now, if you want to know what's inside off the file, we will use a command cat followed by the name off the file, which is Jerry when you hit Enter. And there you see, you have Jerry Seinfeld is the main character in the show. Seinfeld. Now, this is what we typed right here in our echo envy. Output it that to a fall called Jerry. Now, what happened? If he'd do echo and do and and we wanted to type another line in that same file. So let's say, um, Jerry show waas created in 1989 and you put to our fathers Jerry, remember why we are using to output arrows Here is because if you use one arrow like this, it will overwrite your last file and remove this line that we added into this fall. You'll remove this line and create a new fall with the content off. This jerry show was creating 1989. Now we don't wire to remove it. We don't We want to keep this line the first line and we want to add a second line. If you want to add a second line, then you need to use the double redirect signs. When you do that and enter. How do you verify it? What's inside over Whether it went inside the file or not again, I want you to use up arrow key twice because that's the first. A Berkey brings you the last command. The second time you hit up Iraqi brings you the command to cat the Jerry Fall hit Enter And there you go. Now you have too far to lines in your file When you do ls minus l Last time you have 58 bytes. Now we have 89 bites because the file is keep growing. Now, this is the simple way to add contents Toe Ah, file if he running the same command again. There you go. Jerry Seinfeld is the main character in the show. If you take out that and you just do Jerry Seinfeld is a main character, right? And now we wanted to use one redirect, and we want to redirect Jerry. Now, remember this. It will wipe out all the contents off the file. Jerry, basically wipe off the entire file, Jerry, recreate the file with the new text message is text that I am typing here tried, Let's say hit, Enter do Cat Jerry, Enter. And there you go. Jerry Seinfeld is the main character. It does not have all the type things that we did earlier. It took the the latest one, the latest hyping the latest echo we did in the fall, and it added into the Jerry file the same way I want you to add a few things about anything that you know about these characters. By the way, these characters are actually taken from those hit shows American hit shows of Seinfeld, Simpson's and, of course, the main, Um, always Superman. Um, if you know a little bit about any of thes characters, please do right inside of these files with using the echo commands. And this would be, ah, very good exercise for you. How you could populate each file with different things that you know about again. Remember, if you do one single output that will override the fall, if you do double that will append to the file. Okay, Now this is about echo. What if you wanted to do that, create a new file called touch and ah, this time will call at, um listing. Well, file No listing. Off directory. That's what we call this, right? You hit. Enter Verify the father's created. Yes. Listing off de ir is just the name I pick. You could pick any name Now how do I populate that file? That what? Whatever I want to type in. Of course. You know, that way you could do it is through echo and whatever you want to type and output to a file . But now I want to show you a second way that you could populate through the output of a command, which is if I do ls minus. L could enter or ls minus. Lt are Let's say which brings me the latest one of the bottom. I wanted to have this entire output starting from here to here. I wanted to output this entire our entire result off my ls minus. Lt are into the file I created listing off directory. So we will do ls minds lt are output to listing Hit tab it auto completes your file and now you hit Enter You see what just happened? It is did not give you the output off ls minus. Lt are on your supreme what it did. Instead of giving you on the screen, it is out putting toe a file you called listing off directory a less my cell tr shows you that the total number of bytes this file has is 11. 40. Okay, awesome. Now what's inside off this Derek off this file, you could check by typing the command cat listing are tab and hit. Enter. You see, guys, it's a same output that you have as you would have it on this one. The only difference that you see this output gives you a different color because it is actually running the command. Where, as this output cat of this listing is just the simple text messages texts inside off a file , you could change it. You updated whatever you want to do. If you want to Due date and you want a pen that date, by the way, the output of date is today's date. And if you want to append that to the file Jerry hit. Enter now verified. Jerry. You see, it has the first line, that V type to echo command, and then it has the second line that we got it from the date. So does these two funny characters. The output to, uh puts a pence to your existing fall and does not delete your fall. So again, these other two ways have you learned one through the echo and redirecting and went through the output off a command and redirecting toe afar. And of course, there's another way is a V I devil cover later in the lessons. But now, right now, you have to practice thes two ways off, adding are a pending toe a file.
51. Tee command: standard output to a file using the command T. Now we have learned how to actually populate Ah, file Using the reader commands like a the greater than sign you echo something you up put to a file Jews in the greater than sign. Now there's another way that you could do the same thing was using the command T what t commandos T command is used to store and view both at the same time. The output, any command. So, in other words, the command is named after the tea splitter used in plumbing. So you've seen the T splitter, right? So you put in the water from one side, it comes out from the both sides. So this T command works pretty much the same way. So it basically breaks the output of a program so that it can be both displayed on the screen and saved into a file. It does both. The task simultaneously copies a result into a specified files or variable and also displaced the result. So if you look at the picture, you'll see. Um, right here we have a command. So whatever the command you run your on echo your on ls um, pwd Each change of whatever the command that you run, right. You put a t in front off it, and then it will not only send the output on the screen, but it would also put it into a specified file the file that you wanted the output to go to . So that's how the T command works. The reason we want the T command or the graters then sign command, which ought to do the same thing, is because if you wanted to run a command and you want up to, ah, file, you also wanted to view while you're running the command. You wanted to view how or what the output looks like and whatever that goes into the file actually going the right output that you're looking for. Okay, So, um, let me go into my Lennox machine, and I have it right here. Open. It's clear this green and type who am I And you will see the name or the user account that I've been locked in with which directory I'm in. I am in my slash home sash. I have salt directory. Of course. One more thing. You should also check as the host name that you logged in. The host name is the correct host name, which is my first Lennox VM. These are the few things. Of course you need to check all the time big to make sure that you are logged in to the correct system. Now let's get back toe a command t Now let's say if he wanted to echo something on the screen, let's say be echo. Um, David Party is the lanes boyfriend they would put it is just a character in a in a show sign ful. And he he was a boyfriend off Elaine Best. So it's just a statement that I'm putting in. And then you hit Enter and you will see that same, um, echo on the screen. Now we could use the greater than sign to output to a file. So let's say if I wanted to up to a father Elaine Dash David, This is the name of the well, right. I could do that when I had entered. You'll see it has added this text toe a file name. Elaine Dash. David No. What if I verified by running the command cat, Elaine David and you'll see the file has the correct text that I wanted to have it in the file. Perfect. Now, if I replace it the same thing, that's clear the screen one more time and run the command one more time, and you will see when you run this command with uppercase. Sorry, not uppercase with redirect sign. It actually runs it, but it doesn't throw anything on the screen. But if you replace this with a pipe and T, then you will not only see the output going into Elaine Dash. David filed the output but also show up on the screen. So head enter and you'll see David Party is Elaine's boyfriend, so it is going both ways. As I said, that T is like a plumber's tea that goes both ways. So when you do cat Elaine, David David party is Elaine's boyfriend. So now don't be confused that, hey v Randa Command earlier, and it has that same text message that we ran it with a greater than sign. If that's what it's in your mind, that find that school header and move you lane David file So it doesn't exist. Yes, so clear the screen now run the same Commander Hit Hitting Up Arrow Key, Our Eco David parties. Elaine's boyfriend. So Auntie Elaine Dash David, This is the file hit Enter. Okay, now do cat David. Sorry, Elaine Dash David, and you'll see the file last year. Perfect. Now what if you wanted to ad our append to the same file? Because if you type, let's say echo David and Elaine into the same file and hit. Enter and you'll do cat Elaine David. You'll see it removed the the older file and creating a new file where the newer output. So you want a pendant toe a file that the older, um, text message does not get deleted. For that you would have to use a command same commandment, but remind us a so hit up arrow key and go back to the same command that we ran earlier. And this time type t dash a same thing. Echo. David Puddy is Elaine's boyfriend. This is just a text pipe It anti it and but the option minus a and the file names in same pile and now go ahead and hit. Enter now, go ahead into a cat on Elaine David while and you will see it has two lines. First line is that we created without minus minus a option and second line we created with minus a option. So that's how you upend our ad or create a new while. Now let's try to see how many characters do we have in Elaine and David File. So the command is W C minus E. And you'll see it has 52 Elaine David characters. We could also put that out, that whatever they came on the screen to another file. So I used this command, which can be discussed orbit I will cover later on. Of course, this command actually count Every word in the file called it Lane Dash David, and it will output on the screen. You could actually redirect that output using a T command to enter the file as well. No, let's say, if you want to do ls my cell and you see that listing entire listing off your directory. So let's say if you want to have all that with the T meaning I wanted to review it and at the same time want to put it to ah file. So I'll put it is I'll name it list de IR and hit. Enter and you will see the entire listing from here till bottom, and you also see your fall less de ir. If you do cat list de ir and hit, enter and you will see the same listing could let's clear the screen and now hit up Arrow key to cat list er file again, and you will see that ls minus. L output. So basically it's putting on the screen, and it is putting toe a file. If you wanted to do the same thing, that's an echo minus l. And you could also up to multiple files, meaning Ellis myself t to Let's say, file one file to file three and hit. Enter. You see, it actually were grand. And it has all the listing off all three fathers. Well, and when I do cat but one, it has the same content cat fall to it has seemed content and so on. The cat filed three same ls minus l output. So this is how, um, the T command works. If you wanted to get more help or more options on the T command, you simply type t dash dash hope and you'll see it will tell you exactly the options that are that is being offered by the help Command C minus A is a panda Mind's eye is to ignore and worsen and help. So if you type, um, t dash dash word in to see the version off this command, you will also see that this command version is a dot to to, And it tells you this is a free software. You are free to change and redistribute it. There is no warranty to extend the permitted by law. And so and so and written by Mike Parker, Richard M. Stallman and David McKenzie. So these are the people who actually built this command again. Since Lennox is an open source, you could even create your own command, write your own code and introduce it to the Lenox boil. So that's how the T command works. Um, I hope you understand. If you have any question, you could just shoot me an email and, um, tried out, tried a different options couple of options, and I'm sure it will work just fine.
52. Pipe: pipes. A pipe is used by the shell to connect the output. One commander to the input off another command. The symbol for a pipe is a vertical bar. The command Centex is command or the option or the argument. And then you pipe it to another command with its option argument if there is any. Basically, if you want to connect to command together or if you want to take the output off the first command and pipe it to a different output, then you could use a pipe in a my keyboard. A pipe is somewhere the key all the way to the right. It looks like that. And in a regular key ward Ah, you'll see the pipe option is right below the backspace. And you could do, I think, with shift and pipe. Um, so the way it works is you have Ah ah, you have a command. It goes in tow a pipe and it comes out the output. So let's say if you have Alice minus l, that's a command. You run, you pipe that the exact same, um, pipe character that you use and you put another command to were to refine the output off your last command. So let's look at the example in our Lennox machine if he our in slash etc. Directory by three where your we are in our home directors If if you go into CD Zach etc. Now, this directory has a bunch of files and directories which you cannot view all in one page. It will display all at once. But everything will scroll up so fast that you wouldn't even able to view one by one. So when you do ls minus lt are you hit? Enter. You see? It went up so fast what you could do, you could scroll up. So of course, when you to scroll down slow by slow you're going to see all those, um files commands and directories that are inside off at sea. Now you want to view all of them one page at a time. So how do you do that? The way you do it, you put it in a pipe. So you first you do ls minus. Lt are you. Pipe it. And then there is a new command that I want you to learn which is called more more is the command which gives you the output off a file one page at a time. So when you do this myself, tr pipe it and more it enter. Go now you'll see one page at a time off all the contents off, etc. Directory and at the bottom. It does tell you that it's more you had space bar to go down to second page space bar again . Space bar again, wherever you are, you could quit out if it beheading que and you'll get your prom back again. Let's do up Arrow Key hit Enter Space Bar Space Bar Space Bar Space Bar to go all the way down. You could keep hitting the space bar, and that's your problem back. So that's how you put in a pipe. You could also do a pipe to have the output off our command and change its output to a different way. Let's say if you want to do ls, by the way there's another command, which is Ah, a simple command. If you wanted to learn is l l, which also give you the result as if you are doing ls myself. So you do l and you'd learn to command mawr, which give you one page at a time. What if you wanted to get the last line off you output, then you run at its my cell. Pipe it. And to get the last line, you will have to do tail minus one. It gives you the last line off your output. Now, tail is another command, which is also a cool command which will give you the last line or lines off a now output which will cover later on. So this is what the pipe is. I want you to try with different commands, learn about pipe. Um, I'm not sure if there is a man page for pie because it's a character, but let's see. Yeah, there is none. But if you wanted to know more about pipe, I have some documentation. You could get it, or you could off course, look it up online to find out more about pipes. Ah, the pipe has is very important for our lessons that we will be covering Les Iran because this is how we gonna combine our commands
53. File Maintenace Commands: filed maintenance commands and this lesson, we will cover a few of the commands that are used to maintain or keyboard. Change your files. Some off the commands are listed here. The 1st 1 is the copy command CPI, which copies one filed to another. The 2nd 1 is to remove a fall, which is our M. The 3rd 1 is move. This command is used to move the location off a file from one location to another or to rename a file that does. Two things are it serves to purpose. Then we have M k D I. R, which is to make directory and then rmd ir to remove a directory. Or there's another way to remove a directory by typing R M space. Dash are or hyphen are. Then we have changed group, which is the ownership off a fall, um, at the group level. And then we have changed ownership, which is the ownership off the file at the user level, some of the commands we have already covered and some off the commands we will be covering in this lesson. So let's go to our links machine and gold were these commands one by one and that's log into our machine. We already have the last green open. Let's clear this out. Ah, where are we? We are in etc. Even you type CD and hit Enter and then PWD Now you are back in your home directory. Clear the page said this so you'll start fresh. Now the first command of you will be learning is CP against CPIs. A copy command. You could find out by hitting Man and CP. This will tell you CP copy files and directories. So the way you could do it in Windows is you right? Click on a file and you get the option of copy. And then you go to another file. Under the directory, you're in the location and then dry Click into the paste. And Lennox, this is how it works. We will. Let's let's look at our listing. We have all these falls. So now we will copy the file called George, and we will name it to a different name that say, another character off a show. David and you hit. Enter. So this would tell you that CP based source, which is the George and the destination, which is a David you hit, Enter and then you do ls minus lt or the l. The TR option will give you the newest fall created the bottom you enter So the David file is created. If you also notice the George file is still there. And it created a fall a copy to file George and rename it David. Um, we could also add something to the file is, let's say, a coke. David Huddy is the lanes boyfriend. And then we'll up to David and hit. Enter. And how do you verified you do cat David? So you're see the contents in there? Um, that's what you do. The copy for you could also do. Is you copy? Ah, David. And then you could copy it. Not at this location where you are. You copied some other location. Let's say we wanted copy into temp. Ah, location. So it is going to copy it. It's not going to remove the volatile. Copy it to the temp directory. Enter. Do ls myself your You'll see it. Has the david copied the original copy here. Now we will go to slash temp, and then we will do unless myself to you are the bottom to see the father's there. See the same file that he copied. But it's in a different location, and it is owned by me, owned by the same group as myself. And it has same number of bytes you could do Cat and David to see what's inside off the file service. Derek, you are in. We are intended victory. If you want to go back to our home turkey, just simply type CD hit. Enter PWD and you're back in your home directory. Alice myself, your and that's what you have your all the files that survived a copy. You could practice that copy command by copping different files or different names, whichever names that you like, the next command we're gonna learn is remove. Ah, let's create in the file touch and we will create a new four off um, Homer barred March Lisa and we call another file. Ah, poop. Apu is another character off Simpsons family, so we'll create this file called APU on. We'll do ls minus. Lt are and you'll see it created the fall up poop. And if you want to upend a fall or add something to laugh about, what he would do. We do echo. Ah poo is an Indian character in the show, right? So I'll put that to where ah poo. How do you wear a fight? A pool? Polls indicate that's how you do it. Now You want to remove this file now, after certain times, you don't need it. So what you do you'd do R M a. P o. Rachel simply is that enter and it's gone. Let's try. Let's make sure it's gone or not. Yes, see, there is no such file up who in our directory? Because we removed it. We could also remove a directory, but we'll cover them and it turns gonna come. The next command we have to learn is move, move. Command, actually move the file from one location to another and also renames off. How does it work? Let's call LAX and Superman. There's this character, of course, is villain. Character lacks. So let's see, we have the legs. Yes, we have. They're We wanted to rename that to Luther. So lax. Last name was Luther. So let's try. We wanted to change, Luther. So how do we do it? We do, move lacks. And this is of course, the source. And what's the destination Name. You want to give it to Luthor? L u h t e r. This is going to rename this fall within the same directory. It enter Ellis myself to your and year. You see, Luthor. So this is how you rename it? Um, if you want to rename any other file Ah, you could do that, or you wanted to create a different file. You could do that. Let's say you we have this fall called, um David And he wanted to change to the last name, of course, which is move David to Putty. So that's his last name. So we're moving David to the name Putty. So that s my SLT Or so it changed the name from David to Putty, but it kept the content off that file, which was a few new cat. You'll see David parties, Elaine's boyfriend. So it just changed the name. It didn't change the content. Next one of you, by the way. Also to change the location is if you want to move Huddy from this location to a different location, that's if to temp, it will move that file to a different location temp. Now, let's see. Do we still have the file? No, we don't. Where did it go? We moved it to tempt. So how do we know it moved to tempt you'd CD into temp ls minus. Lt are. See, this is the putty file that you created. Now this. Move this back to more putty. Back to our home directory. And what is our home directory? You guys, you know that home here, or use the name and hit. Enter it should bring you back to the your home directory and you do CD hit. Enter it will bring you back to home Directory to us myself to your and your party follows back. Next one is make directory. It simply will make em Katie ir game off. Thrown one of the biggest show. How's that? Um recreated this. This is how the new directories created Make d I r. Now let's try command which is removed. Directory. So removed a tree. If you wanted to lead one of these surgeries from your from your home directory that they wanted to remove game of Throne directory, You just simply type RM d I r and came off thrown and it is gone. This is one way to remove it. Another way to remove it In order for us to remove it. Lets recreate it again. Hit up Arrow key and you will get back to the same command. Make the I R. A move thrown. The doctor is created. Another way to remove it is RM Dash are I came all thrown and it is gone. All right. Next car Mary have changed group changing group as changing the ownership off the far changing the ownership off a group off a file and that the last command is changing the ownership over file. So if I wanted to change the ownership off file Putty, um and I wanted to change it to group called Groot. So we will do change. GRP wrote Huddy. Um, it's his operation not permitted. Why? Because who we are? We are ourselves. And who could make these changes? If I want to assign something to root, I have to be route. So let's become route once your route. Let's go back to our home directory and now do is change g r p route and party. And this time it worked because we have all permissions in the world would think off now. Next command, change ownership to root off party. This will change the ownership off the filing party to route as well. Now, if you want to do ah both commands at once. A change owner you could do. I have solved colon IVs All hurry. So what this command will do? It will change the ownership as well as group ownership of the file Name. Party hit. Enter response. Lt r and they go. You got your file back where the original permissions are original. Order for permission. So these are the file maintains command once again. The recap cp rm. Move em que de ir removed the i R change group changed ownership.
54. File Display Commands: file display commands. This lesson cores about all the commands that are used to display the content off our file . You give you the file by doing ls minus. Lt are, but and you could How can you view inside of the file? The first commanded Alcoa is the cat which views the entire content off a file regardless, whether is one page or two page um mawr command or less command both hard the same. Um, but Mawr views the continent a file one page at a time where, as less command views the content for off a page in reverse order. But it also allows you to view one line at a time. Then you have had, if you want to know a few lines at the top off Ah, for file. That's a for five million lines, and you just wanted view the 1st 10 lines you could use head command, followed by the number of lines that you want to view the same way the tail works. Instead, off the top of the file, it actually gets you the lines at the bottom. Off the file. A gain of her father's woman has a 1,000,000 lines and you put tail minus 10. It will give you the last 10 lines off a file. Let's look at our, um, Lennox machine and see how we could use these commands. Okay, so let's clear this page out. Okay? The first thing I want you to do is copy the file called War Log messages and copy it in your home directory. You could do slash home your home directory, which would work. Or you could also do copy the name or the location off the entire file and followed by space and dot dot means at this location where I am, you could enter. And now you do ls minus lt, or you hit. Enter and you will see at the bottom. Right here. It shows that you have this file, which is 129338 bytes long. By the way, you could view you could copy this file only if you are route. So when you do, Who am I? You are route and you remember how you will become route. Let's say if you exit out off it and you do, who am I yourself and now you gonna copy war log messages to your current location. It's not going allow you. So you have to be route to become route s, you space dash. But in the password. And now you are in route. So go to your home directory. They uses home director, which is your home directory. And then you'd you'll see here This has this message is file that you copied from war log and the reason you were not able to copy it because you see here Onley route, which is user The owner of the foul who is route is allowed to read and write to this file . The rest off people, which is group has no right anything and so on. The others have no right on read right to do anything. Let's go back to our commands that you were cover If I wanted to view the contents off this file called messages. The command to use is cat messages. Simple is that you hit Enter. See, it has all those contents messages. Basically, this messages file has all your logging information off your system. Anything that is going on with your system any, um, services that are running any air messages warning messages coming in the health of your computer. Everything is stored in this file. We copy this fall in our in our home directory just to cover the file display command lesson. So do clear, and then do cat and messages again and you'll see it has a bunch of lines, text lines in it, and we could view through cab. But then we have to scroll up so another way that so you don't have to scroll up. How do you do you doom or messages you had enter and there you'll see, you will get one page at a time off that filed messages here. You'll see it says 1% the bottom. You hit space bar to keep going down. Keep going down your going one page at a time. And while you're going it also telling you the percentage off the file you have read. You keep going down. And if you wanted to get your prompt back, what do you do? You simply type que. So that's how you use the more command. Now let's use the less command less command space messages had enter. It does the same thing. You hit this base bar that the space for one page at a time. Also, it will give you one line at a time to view it. When you hit J in your keyboard will come one line at a time or you had K, which is is Go back up. You could also do up Arrow Key or Down Arrow Key, which ever that you prefer J R K Upper cure down or keep whichever you prefer, so that's one less allows you to do next. One we have head. If you do mawr and messages, you see the first page off your file messages. What if you want to see on Lee the 1st 2 lines? You don't care what's inside the file after the first full line, then what do you do? You do head minus two space name of the file messages, and you will see the 1st 2 line off the file. Then you'll do tail minus two messages. This will give you the last two lines off the fall, which is Ah, the last who is March seventh 3 10 You could do cat again two messages and will bring you down to the last page and you go verify Yes, the's word, the last ones. So to wrap up recovered cat Command, which lists the contents off your file regardless how many pages it has, it's just displace everything in one shot more gives you one page at a time. Let's give you one page of the time in reverse order, but also view lets you view one line at a time. Had gives you the first lines, depending on what you define until gives you the last lines, depending where you have defined. Um, now exit out off, um, fruit account, find out which doctor you're in and do a less mind sell to your and you will see. Ah, there is a file called Jerry in there. Um, let's do Cat and Jerry and you will see two lines and Jerry file. The first line says Jerry Seinfeld is the main character, and the second line shows us the date and time off file another file, but an output or a text message, whatever that is. If I just wanted to view the first line of the file, I don't care the second line. What I would do is head minus one Jerry, and it will give me the first father first line. Of what if I wanted to view the last line? I don't care. The 1st 1 that says Jerry Seinfeld, main character. I just wanted to know this line. I will do tail Ice one, Jerry, and it will give me the last line. So this is how had entail work.
55. Filter Text Processor Commands: filters text processor commands. In this lesson, we will learn all the commands. Fun command, I would say that are used mostly in Lenox. These commands are very powerful command. And it gives ah huge advantage off Lennox or other operating system. Some off those commands are cut, talk, grip, short, unique and word count. Here are the six. They sick and very powerful command of evil learned I log into the Lennox machine now. Now, this time I have a log into the lyrics machine through party client. When you open up your party client, you put in your use the name and I p address off the machine that you're trying to connect to and you would put in a, uh it will ask you for the password and you lock it. Now let's see who we are, where we are. What's inside of our directory? I want to log. I want to change my directory to the director called Seinfeld. In this directory I created a file signed ful characters. This is the file I created earlier. Just for the purpose off this lesson. To view this file, you have to use a command cat and I'm sure you remember this because we covered that in a few lessons. Back when you do cat sign fill, you're going to see the contents off this file. Seinfeld Dash characters. Now here is a list of all the mostly characters that were inside the in Seinfeld show. I don't want you to focus on the characters itself in Seinfeld. I just want you to focus on the text that it is inside off the file called Seinfeld Dash Characters to show you how the cut command works. Let's first do cat Seinfeld, which we did. And what if we wanted to get the first letter from each line? Teoh. To get that output, we have to use the cut command. So you would you run command cut minus c and you want the first letter. So you're but one followed by which filed that you want to cut it from from the file signed flash characters you enter. You'll see it gives you the output with on Lee the first letter. What if you wanted to get this 1st 2 letters or you're gonna use? See, I said, well, C one to C two. No, because if you type see to it will give you the second character from your output. What if you wanted to get the 1st 2 characters, then you would have to specify the range one through to then I will give you the 1st 2 characters from the output. Now this is the primary use for the cut command. If you want to cut the text and it's not really the cut and paste as a Z, you could think off like in Windows. You cut, ah, file and paste a file. It's up. It's not even cut. Uh, and you do. When you are in Windows, you you're cutting. Ah, a few lines or a few words and pasting it somewhere. It's not that it's on Lee to cut the characters out off it. And then, of course, you could move it to a different file, like by out putting it, too. Ah, first two character just put C So when you use you notice and you do ls minus lt or you'll see and you do cat, it created the file with 1st 2 characters in the file because you used a cut. Now let's move on to the command talk again That's dues. Cat sign fell walk separates each column in a file. So in my father Seinfeld Dash characters, you notice we have two columns. One is the first name. Second is the last name. What if I just wanted the first column or the first name? I would run a command talk single code curly braces, print dollar one curly braces, close single court close and the name of the file. This is going to give me the first column off the file. You could also run the same command by typing cat Sign fell, and then you use pipe and do walk, print, dollar one and close. This gives you the exact same thing. Um, and basically, pipe actually takes the takes. The output off this file puts in enough all pipe, and it shows whatever the way you want to show. What if you wanted to view that the second column, which is the last name you put simply too. And there you go. You have a last name there. What if you want to see the third column? Nothing. Why? Off course. That is not their column. Okay, let's move on to the Third Command, which is a grip. Grip is actually like a search as if you have. You are in windows. You're searching it when you do control left, you're searching it. That's exactly what crop does. So if I wanted to grow up, um, the name Seinfeld inside, um, the file signed for characters. I didn't get anything. Why? Let's look why I didn't get anything because designed for last name has upper case s in It said That's why we didn't get anything. So let's put up our case and there you go. You will see it on Lee Grabbing the sign Felt What if I wanted to grow up? Um, only Costanza's Costanza and it on Lee gives you the list of all the lines that matches Costanza. Let's see if I wanted to do Cramer again. We didn't get anything because Cramer has a K upper case and they go, we got two lines of matches are, um, criteria. So that's how group works. Their grip is very powerful. You go combine many different output to a group. There is also eat grew up. So I want you to actually learn more about grabbed by typing man and grab and try different options. Also, you could use some feel free to use Google and see what are examples you could find on the crap. Ah, the next commander will learn is to sort command, as it sounds are at its named short shorts to file. Um, if you do cat sign fill, you'll see, um, it's not sorted in alphabetical order. Meaning like Jerry J. Starts with J, where, as a right hair, Elton should be on top. So what? How do we sort it? You could simply type sort and Seinfeld, And then you'll see it is sorting with alphabetical order. So that's what pretty much sort commanders used for. You could also use short and reverse order if you want the, um, you or Z the bottom. Let's say right now when you ran short Seinfeld character, you see right here Uncle Leo is is the bottom because it started you. What if you want to have in reverse order so you just simply put in the option minus are and you will see uncle, your now it's on the top. Now let's look at this next command, which is unique, unique removes all the duplicates from a file. So let's do cat Seinfeld and you notice this, um unique. Um, it's not gonna work because every line is different from the other line. So what we could do is we could get on Lee the second column. So this way, the second column is gonna list only the last name. So if you see on the last names now we have, ah, Seinfeld. Seinfeld to duplicates. Actually, three duplicates and three Costanza and so on. We just wanted to have one family member. One family member out of every family said this way we could use a unique. So you hit up a rookie again and you type sort here because, remember, always you sort before unique. Um, I will tell you why in a little bit. So you do sort. It will sort out, um, from alphabetical order. And then you type unique. And there you go. You'll see everything. All the duplicates are removed. Now what if you had not used sort and just use unique, you'll notice that it has signed fell here and Seinfeld here to it gave you to sign ful. Why? Because it has to be shorted first before this unique toe work. So that's why we use sword and unique. It's clear the screen out next, commander, we're gonna learn his word. Count. Word count counts the word inside off your file so you could simply run W c the name off your file and you'll see it tells you it has 17 lines, 34 words and 236 letters or characters inside off the file called Sign ful Dash characters . This command is very powerful and very useful when we wanted to count the number of lines in riel Um, in really enterprise environment, sometimes you have millions off line in a file. So it's good to use this command. We could also do, um, cat, Seinfeld and W C if you if you only wanted to know the number of lines in a file, so you just do pipe it and wc minus elovich is for lines. Don't tell you 17 seem as we had it before. So this is what the WC is used for. Ah, and these are all the commands used for. I wanted to compare real quick All these commands toe our windows, um, environment. So in windows, um, I have this. Ah, file that I put it all copied everything. All the contents off the file here. And I wanted to use the cut. Meaning what if I wanted to get only the first letter from this file? Is it possible? I don't think so. It's possible. Or if it is, then it might. You might have to do a lot of different things to get it to work next. One. You want to only get this second column or the first column from this text file and Windows . It's gonna be so hard. You probably have to do text to columns, or I don't know if that works in Vendor in Ward, next one is grab. Grab one works most of time if and it's by the control F or to the Search Command, but it will give you the group one at a time. It's not gonna take out output and give Put it in a different file, wherein Lennix you could do that so short you could you could get that sort done in windows . Ah, unique. I think we also get the unique Denver. I really don't know how that works, and the last one is word count very hard to do to do the word count and windows. So there are so many different filters, these commands that you could use in the next. And these are so powerful over Windows environment. So that's what about it. Please. Um, I highly recommend you to please do man command on every command that we learned in this lesson and use different options just for practice. So this way, you know, some off the options that are used with these commands.
56. Filters Text Processors Commands: Hello, everyone. And welcome to filters tax processor commands. This is a lecture where I'm going to show you. What are the commands? The text processing commands of evil cover in this lecture and of course, of falling lectures. These text processor commands are very powerful. That gives a huge advantage to Lennox over many other operating systems. These commands are cut that allows you to cut the output. It takes the input off a command. Or if you're reading a A content off a file, it takes that as input and then it cuts to your desired output. Then so then goes to OC OC actually allows you to list by the columns. Then we have grew up and eagerly commands Grab an EQ group Commands are just like as if you want to search by the keywords. If you are searching for ah Pacific Word, let's a warning. And in our file you could just grab for warning and into the fall. And it will list on lee the lines that contains that word warning, then the short command. As you see the name, the short command sorts out the output in alphabetical order. Then we will learn these unique command, The unique commander will not show any duplicates if they are. There are words in a file that are same as the one previous to it than the unique command will eliminate all duplicates. And then the last command we will learn is the word Count Command, also for two as Walker Command. So some people refer to it as vodka sub some people for it as tub WC count. Anyway, this is the one that will tells you how many words how Maney letters and how many lines do you have in a file or in an output? So anyway, we are going to cover everyone off these commands, and I have separated each lecture based on the's command so you would have a very good understanding off how each command works. So you get Are you ready to go and practice these commands with me? And then the next lectures? Let's go, let's go do it
57. Cut command: Hello, everyone. And welcome to the lecture off cut Command, which is poor. The text processor commands What is a cut? Ah, Cut Command is a command line utility that allows you to cut parts off lines from specified falls or pipe data and print the result to standard output. It can be used to cut parts off a line, but the limiter by position and characters and the commands of you're going to learn are as follows. So there are the first command that you could run is cut file name again? Do not run. Cut with just a file name because not gonna work. You have to specify the option. So I will log into my linens machine and I'm this time I'm going to log in and through my party session right here. I have my limits machine. And if you want to log in through the party session, you have to log into the your consul. Run if config command, get your I P address, which is 19 to 1 $61.62 put into the party. And then you could log into through the party. But if you do not have this I p address. Then you go to the Oracle wardrobe box network setting and you change the number of setting to bridged adapter. And then it will allows you to get this I p address anyway. So now the first command will use is cut and the file name and in the file name are we going to use? I have logged in as myself, and I am in my Lennox machine and Wish directory. I'm in. I'm in home directory in my home directory. I have a directory called Seinfeld. I'll go into the Seinfeld directory inside of that directory. I have, ah, file name Seinfeld characters, and this is the file that I am going to use for this cut lecture. When you do cat on Seinfeld characters, you're going to see the list or all the lines inside off the Seinfeld characters. And these are the actual names off all the characters inside of the Seinfeld show. I don't want you to focus on the Seinfeld show itself, but I just want you to focus the the content off this ah file. If you do not have the Seinfeld characters file, please create it right now. pause this video and you should. The files should have this content inside off. You file Seinfeld characters anyway, So let's assume that you do have this file and you do have exactly all that, um, content inside off this fall. Now, the first thing is, you do cut Seinfeld, and as I said, you cannot run cut without any option. It will give you the error message. Then the next command that you should run is the cut dash worship. So cut dash dash word gin and it will give you the version. Right now I'm running the version eight dot to to your versions Probably knew or the older it does not matter which version you have. The cut functionality is the same. Also, you could do cut, dash, dash help to find information about each option that it has to offer. You can also do man cut toe, find detail information about the command or utility cut, and you could go down by pressing the space bar and hit queue to get out off it. The next command I want to show you is if you want to get the first character or the first letter off the file Seinfeld characters. So let's say, if you have Seinfeld characters file, let's cat it out and you're going to see that if you want to only get this first letter off every line, then you will run the command cut minus C one and the file name, which is side while characters, and it will give you the list off all the first letters in every line. Then the next commander you'll run is what if you want to pick and choose the characters. So let's do Cat Sign fell again. And let's say if you want the first letter than the third letter and then the fifth letter and then the eight letter, then you could do that by simply doing cut minus C one or three or five or seven. Whichever characters that you want to pick and choose and specify the file lame and in this case, it actually has pulled all those letters and jotted down together as one word. Then next one is a list, a range of character. So what if you want to list the range of character meaning, as do cats mindful again and you want to list the first character all the way through the fifth character. Then you could do by simply doing cut. It's minus C. Sorry, Mina Si one at through five or through three. Whichever the ranges you wanted to specify. You hit enter and you will see you will get the output. Exactly. That was show only five letters. Next one is a list of Pacific A range of characters. What if you want to, as do cats on what if you want to do right here. Ah, 123 and then a 6 to 8. So from here to here. So it is as easy as we have done earlier to count minus C 123 Then you put comma six through eight for six through nine. Depending on your requirements, you hit enter and you will see that it is giving you the 1st 3 letters and then the 6 to 8 Lear's. The next example that we have is we could also get the list or output by the bite size. So if you do cat Seinfeld, all of these letters are actually cule into the bites as well. So by it pretty much works as a characters as well or the letters. So if you do cut minus B one through three and Seinfeld, you will see its output is pretty much similar. Or exactly I would say, like the minus C one through three. Anyway. Ah, the bite might change on a certain spaces. So just be careful what you wanted to use. Then the next one is What if you wanted to get a list off, um, columns off a file by specifying the delimit er so what is the limiter? So let's taken example off at sea password file. So I want you to do Cat at sea, Password file hit, enter, And in this file you will notice it. This is a file, by the way, is used when you create a user in Lenox this fall is the one that manages all the users or keep record of all the users. So that is something you'll learn later anyway. So in this file, if you notice there are columns and thes columns are divided by this little Coghlan's. So you see this X and right after X has this colon and then this column colon and column. So let's say I'm not gonna use column. I would use field so it would be easier to understand. So colon and field, colon and field. So what if you want to get a field by specifying the delimit er and in this, in this case that the limiter for you would be colon. So, um, if you want to do cut minus D and you specify the limiter with, um colon minus f and you specify the field six, then the name off the file, which is Seinfeld, you will see. Oh, sorry. Not Seinfeld. Ah, etc. Password at sea password. Then you will see it is giving you the sixth field. That is a right after the colon. That's do cat at sea password again. And I could explain. You see, the first is this second is this third, fourth, fifth six And this is what is grabbing for you. So in my case, if I have my user account, I absolve. This is my first field second, 3rd 4th fifth and six. So this in my home directory. So sixth column is actually my home directory. So it is pulling that home director. You could also use the delimit er on many different symbols as well. It's not only Colon. If this file was has a field and separated by, let's a comma, then you could use just like this Comma over was separated by. Let's a question mark. Then you will put question mark anyway. So the colon Let's say if you want to pull in the sixth and seventh field and you could just special 6 to 7 and had enter, it will give you the two fields. Next one is again. I already covered that. Okay, And then the last one I have is the cut file not only works on the file itself, it also works on an output off off a command. So let's say if you are in your home directory home, I absolved and you do ls minus. L You'll see the list off all the files and directories. What if you want to get on Lee, the this three, these three bits this three bits were actually are the permissions off the file which is owned by the user. So if you wanted to get on Lee, that and then you will do ls minus. L then cut minus C two through four, right, so it will be to three and four. Yet enter and you will see it is Onley giving you that up? So that's how the cut command and cut utility works. I have given you many examples. You should try it. Try it a different way to fruit toe to a different files or two different output. And it will be a lot of fun to work with it. If you have any questions, please do send me a message and I hope this lecture warts while in the cut command.
58. Awk Text Processors Commands: Hello and welcome to the lecture off AUC. This is one of the commands for text processing commands. AUC is a very powerful command and we are going to try a few commands that talk has to offer. So what exactly is an OC offices, utility or language designed for data extraction? And most of the time, it is used to extract fields from a file or from an input to Let's try a few commands off our OC and I have my limits machine open right here on the side. I am logged in as myself. I logged in his party. Um, I logged in through the party, okay. And the host name, which is a server name off my machine, is my first the next PM and I am in my home directory. Perfect. Now go ahead and clear the screen by typing clear. Now let's go back to the slide and in the slide will go over the first command and the first command is to check the version off walk. So Arc Space Dash dash version will give you the version off the off the Ark utility when it was written and who wrote it and few description off the Ark. Go ahead and clear the screen and try the next command. The next command will actually list the first column from a file, So let's go to our Seinfeld directory, which is in our home directory. In that directory, we have a file called Seinfeld Characters, and this is the FAV you will use for this lecture. So when you do cat Seinfeld characters, you're going to see the list of all the characters or the contents inside of this fall. And this fall has two columns as you conceived by the first name and the last name. What if you want to get on Lee the first name, which is the first column off this file? Then you will run the command arc single coat, curly braces, print dollar one, curly braces, closed single court close. And the name of the file in our case is far Seinfeld characters, and you're going to see it on Lee giving us the first column off this file. If if I want to get the last name, which is the second column or second field off this file, then I'll do print dollar to you could just simply, by the way, you could just simply hit up arrow key and come back using the left turkey and change the value. So in this case, I'm going to change from 1 to 2 and leave everything as is and do the right arrow key to go all the way to the end. A hit. Enter and you will see it is giving me the second column, which is the last name off the older characters inside the Seinfeld characters. Fault. Then we have the next command is what if you wanted to list the column often output. So not just the actual the contents of a file, but actually the output off command. So if I do ls my cell in my directory, which is home, I absolve Seinfeld. You'll see I have these column, which is a permission and links the user group size, month, date time and the file name. All are these different columns or actually feels If I want to print the first field, which is the permission field and the third field, which is a user ownership field, then I could simply do ls minus. L arc it single court curly, brace it printed dollar, one comma dollar, three curly braces, close single court close and you will see you only going to get the first and that their column C out. Powerful orkest Moving on. What if you wanted to get the last column off an output? Now, if you do ls minus. Lt are. And what if you want to get this last column, you counted by saying 123456789 that it is a last column. So you hit up Arrow Key and and you just put in dollar nine and it will give you the last column. But there is an easier way instead of few for counting every column, you could just type N F. That will automatically gives you the last column off the output so they would go to It's a print. Dollar nine is the same as print dollar N f. Which gives you the last column. Then what if you wanted to search for a Pacific word from, ah file using our command? Okay, so all can also do the search for you. So let's say if I have a file ah, cat Seinfeld characters and in that fall. We have all these characters. What if I only want to search the line that has the word Jerry? I could use awk single coat slash. Jerry. Make sure you specified exact as uppercase J slash Curly braces print what it found and coat close and the fire languages Seinfeld. And it is giving us the Jerry Seinfeld, which is the first line from our file. As you could see, there is no other line in my, um, content that has Jerry in it. What if I wanted to do the same thing, but instead I wanted to do Seinfeld, So I'll do S E I N f e L d that enter. And now you'll see there are two Seinfeld's in there Jerry Seinfeld and Morty Seinfeld. So it matched the exact keyword that we're trying to search for next command Herbal try is Ah, what if you wanted to get the list or the feels that is separated by a delimited? In this case, viewers use etc. Password again as similar to as what we use in the cut command. So if you do cat at sea password and you see every field in this file is separated by colon . So you could also use our command here instead of cut command to get the feels. So if you want to get the first field, which tells you these user name on Lee, then you could use awk dash minus f the limiter. And in this case, the delimit er is calling and then single cold curly braces, dollar one curly braces close single, cold, closed and at sea Password and you'll see you got all off the user names from that fall. Same thing. What if you want to get the home directory so home direct TV know that it is actually the sixth field three types. Six. And you'll get all the home directory. So cut and OC in this regard works similarly next one will learn is what if you wanted to replace, um, a column that matches a certain keyword. So let's say if you do echo Hello, Tom. And in this case, the dollar to is Tom. So it will replace Dollar two of Adam and I'll print it. So let's try it. So when you do echo, let's see. Hello, Tom, and you hit Enter. It will echo it out and echo it back to you. Right? So when if you run this commander gained by heading up Arrow key and you do talk single code curly braces, dollar to and in this case, dollar to we all know is Tom and I want to replace Tom. Let's save it, Adam. And we type Adam here close. And then that we do colon, not a semi colons. Sorry. And then print dollars. Zero print dollar zero dark, $30 0 Meaning whatever it defines printed now. So we'll do Curly brace close and quote close single court close and hit. Enter and you will see now instead of doing Hello, Tom. It is doing hello, Adam. Because we replaced the second column with Adam just like that. Because use you could also use our Seinfeld characters. Fall. So let's do cat on Seinfeld characters, Valerie. Now, what if I wanted to replace every last name with my name? So my name is Imron, right? As you all know. So I want my name to be as a last name for every second column. So in this case, I will do Is cat Seinfeld and I will do talk. Same thing dollar to which is the second column equals double coat M Ron double court, Close semi Colin print dollar zero curly braces close. Single code close hit. Enter and you will see. Now every last name is my name. That's how you could change that. How this oc a command become so powerful to make changes to your file. Moving on. What if you wanted to to replace the second? Oh, I already did that. Perfect. So I'm one step ahead. This is something that I just showed you. The next one is okay. Ah, What if you want to get the lines that have more than 15 bite size? Okay, so if you do cat Seinfeld, you probably noticed there are some names that are smaller and there are some names that are bigger like this, George Steinbrenner and Estelle Costanza. So these are the bigger names, and it has a bigger bites. So what if I only wanted to get the names off? Those lines are the lines that has those names that has more than 15 bites are lent 15 characters. So I will do. First of all, I look at Seinfeld and then I'll do walk or what I could do instead of catching it. I'll just start with talk, and I'll put the file name at the end. Then single single coat lent parentheses, dollar zero parentheses closed greater than 15 single code close. And the name of the file in this case Seinfeld character and you will see it is giving me that. Those two lines that has the size of the length that is more than 15. If you do 14 it will find a few more. Ah, it also found this time it also found George Costanza. So that's how you could use this. All commend in terms of the length, then a moving on. Get the field of matching Seinfeld in slash home Slash I absolve. So when I do and I go to my home directory, just type CD hit P W. D. And you see you are in your home directory in my home directory when I do ls minus l. I have all these files in directories now. What if I wanted to get the list that Onley matches Seinfeld? I'll do ls minus. L look single core curly braces If parentheses dollar nine and we all know dollar nine is the last column you could do dollar nine or you could do an F equal equal double coat Seinfeld. If it matches Seinfeld, then you have to print it. So print dollar zero Semi Colin and then you have to close it. A curly braces and then a single coat and hit. Enter and you will seek ups I got are a message. Let's see, Where's Ellis? Minus L ock If dollar nine equal Seinfeld. Oh, I didn't put this parentheses right here, so I hit a barrel key. I have to put the parentheses to close my argument and now hit. Enter, and it will give me Onley the file or a directory that matched the last field or the ninth field as equal to sign build. Then the last one. I will give you an example off the or command is what if you want to find the total numbers off feels in a file or an output. So let's say if you run ls minus. L here and you count it to find out which column that you wanted to get right. So let's say if you're looking for the last column and you want to know how many columns is this output has. You could count 123456789 Or you could just simply run the command ls minus l an architect printed and f no, no dollar enough Just NF curly braces, clothes and single court close had entered and he will tell you it has nine field. The the top one that you see to is actually when you do ls minus l You're going to see right here on topics is total to 80. You could just ignore that. It's basically giving you that There are two fields and the rest every line has a nine feels So this is all about oc there there's there are there's so much that you could do with all Commander, that I probably I don't have time to cover But you could go ahead and tried. Do always man on ock to find out What are the other options that you have? They're also Georg Peel PG Auken, D G Auken. There's different ones that you could use and there are different options that you could use. Try every one of them if you have time, so you have a better grip on the command OC
59. Grep egrep Text Processors Commands: as we are continuing to the text processing commands, we will move, go over the grab an EQ rip commands that is also as one of the powerful commands in terms of text processing. So what exactly is a grew up? The group command, which stands for global regular expression, print processes, texts line by line and prince any lines which match a specified pattern. So basically, in simple words, it's a search technology or a search feature Lennox that allows you to search for a Pacific feature or Pacific keyword, Actually, Sorry, not feature ah Pacific keyword that you look for in ah file or an output from a command. So let's get into a little machine and I will show you a few of the commands and examples. So this where you have a better understanding how the corrupt or e group command works? I haven't looks machine right here opened and gay. No, I am logged in as myself. The machine. The host name is my first Lennox of'em and which directory I'm in. I am in slash home. I absolve now one thing I do want to tell you probably thinking to yourself Hey, why am Ron always run. Who am I? An host name when he sees himself here as I absolved and right here is host. Name the reason I do that because a lot of system and you're going to get into the corporate world a lot of systems not gonna have this type of prompt. They probably gonna show you either this symbol or the HASHTAG. So you're probably not going to know whether you're logging as I absolve or you're gonna locked into the right machine. But if you do see it Perfect, that's great. But if you don't, that's why I want you to get used to off thes few commands who are my host name and wish director you are in before you start making any changes to your system. Anyway, let's clear the screen. And the first command of U will run for corrupt as always, checked aversion and check for help. So for grab dash dash version, it will give you the version. I now you you could read it. You you know where to find the version. The next one is Group dash Dash help. This will give you all the information about the group and it's, um, options. If you wanted to get a quick list off all the options available, you always use group dash dash help. If you wanted to get, um, the longer description or off every option, you could use man and do crap. And this will give you a detailed information about the group commit anyway, so we know that version of you know how to get help. Now let's get to the second ah, lap question, which is to search for a keyword enough file. So I am in my home directory. I'll go back to the Seinfeld directory in there. I have a file called Seinfeld. Characters are carried out, and these this are the contents of the Seinfeld directory. Okay, so now if I just clear the screen, go back up and I will do is I will grab for Seinfeld in the file name Sein Seinfeld characters. It means Onley. Give me the lines that matches the word Seinfeld. When I hit Enter. There are two lines of mashed a word. Seinfeld, which is Jerry Seinfeld and more Seinfeld. I could, same way I could do with other files as well. Let's say if I wanted to grow for my user name. I fell in at sea password. I could do the same thing group I absolve, slash etc. Slash password, and it will go into the pot and search for that Pacific keywords. And it brings back one line because there is only one a user in etc. Password that has the word. I have salt and that's me. Of course. All right. Next command are the next ah, Syntex. That we'll learn is search served for a keyword and counted. So if I am doing let's hit up Arrow key twice and this is a command we ran again, which is to grow up Seinfeld from cycle characters and it gives me to. But what if you have a file that has thousands off words that matches your criteria and you wanted to know how many times it shows up? Then you could just simply do group minus C and ever tell you that it is showing up two times. So that's what minus C is used for. The next one is minus I, which is the one that you should always use, and I have a habit off using group of it always minus. What minus I does is actually searched for keyword and ignores the case. Sensitive meaning. If I have group Seinfeld Seinfeld characters give me to sign for what if I have, um, on inside of this while I have a Seinfeld with lower case s. So let's say if I'm groping for Seinfeld, the lower case s then hit enter. It's not giving me anything, even though I know there is a word sign fell in it. So that's why I always use minus I option to tell my system. Hey, ignore any upper case or lower case from that keyword and from that file when you do Once I it actually grips our and gets do the result regardless, whether they are written in upper case or lower case next one is N displays the mash lines and their line numbers. So we used Let's clear the screen, and if you remember, we used minus C option, which gives you the total number off lines that matched our criteria. Now I wanted to see those lines two and online and number where exactly it happened. So in that case that hit up a barrel key and replace minus even minds and hit Enter and you will see it will give me the two lines that mash my criteria And it also telling me the first line is actually on the line. Number one and the second MASH line is line number eight. Isn't that awesome? Yeah, Like it. Okay, next one is minus V. Also very powerful. Meaning what? If you want to get everything but that search keyword. So let's say if I wanted to get all the lines that do not match Seinfeld Celesta Group minus V Sign fell or I could just do V I or Ivy too. Include I as into ignore Sign felled from Seinfeld characters. And now you will see I have a list off every line, the whole five content. But this does not have that to Jerry Seinfeld and Morty Seinfeld. This these two lines are, um, edit or are excluded from it because I use the minus V option So minus V is basically telling the system. Give me everything except this search. Keyword. All right. The next one is what If you want to combine the keyword with other text processes commands that we have learned previously, right? Yes, we could definitely do that. So let's say if I type grip Seinfeld or let me run the same commander last command group minus V I, Seinfeld and Seinfeld characters, right? All right. So what if I want to print from this output? I only wanted to print the first column. Then you could. What you could do is you could up arrow key. Pipe it right here, arc it. And dollar, by the way, chopped down the line. It is not actually putting into a new line. It's a continuation of the same line. If you make your window bigger, you will see it is coming up in one line. Let me show you real quick. You see, if I do it, this city went back. So print dollar one and curly braces and code close. And now it's giving me on Lee the first column off my mashed criteria. Now, what if I wanted to get only the 1st 3 letters off this output? Can you guess? What could that be? I'm sure you know how to do it, but if you forgot, that's fine. You hit apparel Keen. Now you could put another pipe and now that you could cut minus C for characters and you won the 1st 3 everyone minus 31 through three. Because you picking the range. And now you'll see it is giving you everything except the keyword line that matches Seinfeld. I Let's clear the screen. Let me make my window smaller and I'll move onto the next one, which is LS minus l. So grab does not Onley search for, um, a key word from a file. It actually searched for any keyword from any output off a command. So let's see if I have let me go to my home directory. So it's home. I absolve Seinfeld's will go one step back to CD dot dot will bring me back to my slash home lives. All directory now in here. When I do ls minus l you're going to see the listing off all the pause in directories. Now what in this? What if And this output? I only wanted to see the line that matched the file or directory desktop, so I hit a pair. Okey pipe it. And now I'll grow up it for desktop and let's say just for giggles, I'll use the lower case D and hit Enter and it's not gonna give me anything. Why? Because if you notice, the desktop has upper case D. So you could either do hit up a rookie and replace the upper lower case to use upper case or leave it as it and put minus high option to ignore the the case sensitive hit. Enter and you're gonna see that it is pulling on Lee That line that matched the word desktop, then the cool. All right now let me go into the group and igra functionality. Now you know, Grab Group works perfectly on every key word. Now the ECR up comes into play when you want to search two words from a file. So let's clear the screen. Let's go into the Seinfeld directory in Seinfeld directory. We have a file called Seinfeld. Let's catch that Seinfeld characters while hit Enter and you'll see this. These are the contents off that Well, now what if I want to get the list? Our lines that mashed not only Seinfeld but also Costanza. For that we was used the E group, which is a little powerful command and grew up, so it will be easy grip minus, I, of course. I want to ignore upper case or lower case. Here you put double coat the key word and the first key. What? I want to search for Seinfeld. Then for the second key word, you have to put a pipe in the middle and then put the second key where it would be cost tends. Ah, close with the double coats and of course, specified a file name for him. From where you are trying to search you had entered. And now you will see it is picking up who make this bigger soul and hit the up arrow key. So you know what, exactly the up. Now you see it's giving me Steri, Seinfeld, George Costanza, Frank Constanza, Estelle Costanza and more decide. So all the lines that marriage, Seinfeld and Costanza's are there. So again, if you wanted to talk it out Second column If you wanted to cut it out for certain characters, you could definitely do that by putting pipe after one another. So this is this lecture is all about grab and eat grip and again, I want you to try man on grab and try different options that are available to you like these are the different options. Try it if you have time. Otherwise, the ones I showed you these are more than enough for you to perform your every day daily task while you are at the job.
60. Sortuniq Text Processors Commands: all right, let's move into sword and unique commands again. They are still part of the text processing commands, so less will see what exactly are sort and unique commands soared command sorts in alphabetical order at as the words is a self description off itself as it sorts down the file, the content of the file or the output in alphabetical ordering from A to Z, whereas unique command filters out the repeated or duplicate lines. So if you have a file that has to similar words in two different lines, it will eliminate one of those lines to show Onley once I will remove duplicates. All right, let's try a few of our commands in our lyrics machine and the first commands, as always, to check the version and check to help. So I am logged in to my machine as myself. My host name is my my first next machine, and I am logged into my home directory Perfect plead the screen and tried shorting to the version, getting the sort worsen hears the word gin. Let's try the help command and you'll get all the help with all the different options that is available to you. and always are tell you, do man on soared to get more information about sort or unique command art. Next command is short file. So let's go into our scientist directory. And we have, ah, file their Seinfeld characters. Cat, the Seinfeld characters. And this is the content off the Seinfeld characters, of course, all the characters, pretty much all the characters with the Seinfeld show. Now, if I wanted to short this, as you could see right now, it is not sorted because Jerry is J and C is for Cosmo. Is should be up. Ah, before Jerry. So if I wanted to short all of this, the entire list by the by the in alphabetical order than I would simply have to do is Swart Seinfeld characters or the file name Hit. Enter and you will see. Now it's sorting by alphabetical order. Elton Bennis babes caused more David Alleyne and all the way down is on Khalil because Uncle Leo is start is you, by the way, on cold, spelling is not correct. That's fine. It's just a matter explaining how short works. Anyway, that's you sort out. Ah, file. Next one is if you want to sort in reverse order. So if you do sort, Seinfeld will give you a ah lines that starts with a or the first off a better goal in the first line. If you want to reverse it, you do sort minus are and, of course, the name of the file, and it will give you unclear the top Elton Venice at the bottom if you wanted to, short by that feel number. So let's say by default when you just type short by default, it actress are soaring from the first, um, letter or the first column. What if you want to short by the second column or the second field? Then you specify that field by typing sword minus cave and number two meaning we wanted to . He wanted to short by the second field and then the name off the file. Now it is sorting by the second fields, Kenny Banya and Elton. Now Elton should be up, but since we're doing with the second column, you'll see Banya is the one that comes in the first as going through the alphabetical order . If you had that, if you have three columns or three fields or four fields and you could always pick that field and put it in here and change it with that order anywhere. We don't have that. That's why by default is picking the 1st 1 Moving on a unique command. Let's find the unique command off course it removes the duplicate. So if you type just simply unique, um, by the way, before I go to unique we we worked on the cat in the file. But how about we do ls minus. L let me go to my home directory, pwd And this my home direct. You know, if I typed ls minus l You're going to see the list of all the contents. So sorry. All the files in directories in my home directory. Now, if I wanted to see them in the alphabetical order, I'll just do ls Marcel. Pipe it to sword and it will sort in alphabetical order. See, it will go. Always go Starts with the first letter and first letters is how I have decided he always comes first and why? But while going through the D, Then I'll go to the second column. I've saw all the way down to the name off the second to all the way and column. What if I wanted to short by the last column and we know when we do? Ls minus l. The last column is this one, which is number nine. If I do short head up Arrow key code command that we run and just type minus nine. Of course you have to do ls myself first. Now do less menace. El Pipe Short K minus nine. Now you're telling it to shorted by the last column or the nine column in this case is this column. So as you know, D, there's no A If there was a, it would have been on the top. So that's how you do on the output of a command as well. Now let's go to unique. I want to clear the screen and go to Seinfeld directory. I have a signed characters file, and if I do unique on it and do Seinfeld characters, I'll still get the same list. Why? Because I do not have any repeated, um, lines in my, um in my Seinfeld characters file. So in order for for to to show you how is unique works, I am going to add at line to this file that is a duplicate lines I'll do at Go, and I'll put Jerry Seinfeld one more time into so double coat to upend it to the file and then the file name. Seinfeld Characters hit, enter and now do cat on Seinfeld characters. You're going to see there is one Jerry here, and there's one Jerry Seinfeld here. Perfect. Now, if you do sort and Seinfeld characters, you're going to see Jerry Seinfeld right here, coming up and right after another. Perfect. That's what the sort does. Now. If you just try to do unique on Seinfeld, you're gonna notice that Seinfeld Jerry Seinfeld is the top right here and a Jerry Seinfeld bottom here. It still did not remove the duplicates. Why? Because here's a rule of thumb guys. Every time you need to run as unique on any of the output or content of a file always run short. So that's why I have a hair sort filed and then unique all the sort first, before using unique their line numbers and the line numbers, of course. So if I do sort Seinfeld's hit enter now, it has arranged it for me. You see it has arranged the Jerry Seinfeld Jerry Seinfeld right next to each other. Now, if I hit up Arrow key and pipe it to unique now, you will see that duplicate will be gone. Had enter. You see, there's only one Jerry Seinfeld left. That is why it very important that you do sword first on any file or output before you run Unique. Next one is sort, file and unique. See meaning short, first and unique. Enlist the count. So hit up Arrow Key and just Type C will give you that. All of them have 1111111 except Jerry Seinfeld, which has two. That's what I wanted to know. That's why I ran this command, meaning Give me the unique removed the duplicates. But I still wanted to know how many times that don't get showed up. And it's saying the duplicate showed up twice. Beautiful. Okay, the next one is short, unique minus T show only repeated lines, meaning I only wanted to see the one that are repeated. So I will do unique minus D and hit enter. And now it is on Lee showing me the line that has been repeated, or that is a duplicate line. All right, now, since we did the shorting on the far less do on the output meaning you run any command I am picking ls minus. Lt are so don't get stuck stuck on ls minus lt. Or you could pick any command that you like. Even if you do, that's a PWD, and you could do unique on a short or anything you like. But anyway, when you do, Peter pleaded. Evil always gives you one line, and that was a bad example. Anyway, so I'll go into ls minus. L. And it is in my sinful directory will get out one step back And now I lose ls minus l Because it will give you give me a lot of directories and files. So I would like to play with this one. So if I do ls minus l and then I will do short and then I'll lose unique. It's still not gonna give me anything because every line here is unique. That's why it did not give me. So the point is, you could use sword and unique on files as well as the output off any command
61. Wc Text Processors Commands: Now it's time to look at the last command, which is W. C. It is one of the last command for text processors that in our lectures of you are going to cover of W. C stands for word count and what exactly it does. The command reads either standard input or a list of Foz and generates new line count, word count and bide count. So if you just run W C on a file, it will give you these three output. Now let's get into our looks machine and I have the first commanders you all know is to check the version and to get the help. So when I get to my next machine and again I'm logged into the party and you guys know what we have to run, have to run on his user name and the host name and which director of urine and pretty much once we confirm perfectly of the screen and now do A W. C. And I'm gonna skip version. I know all of you guys know this already. By now, these are the few options that it is. It supports. And then ah, one of the one of the most used one that I used as well, and a lot of people use is minus l visual core in a few. So now let's get into the next command, which is W C file. Name is clear the screen. I'm going to go to my sign file directory, and in there I have my Seinfeld characters. Let's cat out and these are the contents. This is the content on my Seinfeld characters. Well, perfect. Now, if I do is clear the screen again. If I do W. C. Seinfeld characters hit, Enter, you're going to see it will tell me exactly what's inside, meaning it has 17 lines, has 34 words and 236 bites. So if I wanted to know on Lee, the line numbers that inside a Seinfeld character, I could simply do wc word count or sometime people referred to as Walker Dash L and Seinfeld characters you're going to see it will get me on Lee the number of lines that is 17. Similarly, I could do either W or B to get the word count and of the bite counts. For the word I will see, give me 34 for the bite count I'll replace it. Would be, um is it a by count? Why? It's not giving me the information. Invalid option minus B for the by count. Mm. That's new. Okay, let me check wise that W c dash dash, help and we'll see. Ah, for the bite is actually see. See, that's why it's so important for you to run a WC taxed as help to find out there right option or but so the one. The big one man W C. Which will also give you a lot of information about that Pacific command. Anyway, my slide is showing minus B. That is okay. You could ignore it. I will go back and fix it later. But for now, for this lecture will go continue a wc minus c for, um bite size. Also, a lot of people confuse this with the minus C meaning characters. It's not a character's exactly a bite size. So the finally would be signed ful. Usually you saw a bites and characters are somewhat similar. Maybe a few. Um, not exactly. Few. Two or three numbers up and down, but anyway, focus on WC minus C. If you wanted to get the bite size. All right, The next command. I have the WC directory, which is not allowed. So if you're trying to do the WC on a directory, So let's say inside of my, um, Seinfeld director, there's no directories. I'll go one step back and to a less minus l to see which directories are there, and now I will do WC on Seinfeld Directory had entered. It will say WC Seinfeld is a directory. So it's not giving going to give me any information that I'm looking for regarding lines. Ah, ward count or bites Anyway, clear the screen. Let's go to the next one and which is the LS minus l command, which we will run and that will give us the list of output again. This is a command one. Before we were talking about reading from the file. Now this is reading from the output off a command. So if you wanted to see how many files that you have, let's say your boss comes to you and says, Hey, listen, I need the list of Foz we have in this user's home directory. Give me the number, you go in and you quickly run ls minus l and W C minus l And you come back to him and or her and tell Tell your boss hate We got 15 files. All right. W C is working perfectly here, and it is giving you the count off every line. But in fact, you do not have for 15 files or directors. You have 14. Why? Because you see this total 280 here. This is something that it is also counting. So always remember when you do at Ellis my cell and WC minus l whatever the results that you get always minus it with one a. So So now you could say that I have 14 powers and directors altogether. What if I wanted to know on Lee the list of directories in my, um in my home directory? So to do that, you know, to list the directories, you have to run the command, I think ls minus. L d or ls minus l d slash homes. Suchai of soul. Okay, it is giving me all Okay, so this is another right coming. Anyway, I will look it up, But what is the right command? However, I could still use another trick. See, that's what Lennox is so powerful. And you do Alice, my cell. You noticed that every directory starts with D. So what I'm gonna do is I'm gonna do ls minus l and grow for D r w because all of them, if you notice starts with D r w d or w So just get me all the directory. So by default now I have all the directories anyway. So now if I want to know how many directors I have hit up arrow key into a WC minus l So it is telling me that I have 11 directories now. It is not giving me the total right here. You notice because the total will only give you when you only run ls minus l. As soon as you run ls minus l and pipe it that total will go away And then you will just grab for D r W because you're Onley groping for anything that starts with D. R W and the total does not start with drw anyway, as as an exercise for you. Go ahead and find out the command off ls minus l. D or whatever the command is and find out which command will give you only the directors. I use the crap. It works for me. Perfect. But anyway, there is. I'm definitely sure there's a command, and I'm sorry yet, and I didn't know that. Anyway, that's for you to find out. So that's how you know the number of files in your or directories in your home directory. And then the last commander you'll run is to grab for keyword enough in a file and then get a list off it. So I'll go back to my Seinfeld directory in the Seinfeld directory. I have a file Seinfeld, as everybody know. So I'll do Cat Seinfeld. And here I will grow up for Seinfeld. So grew up, Sign felled in my Seinfeld characters file, and you notice there are three people with this last name Seinfeld. Now, if I want If I had, let's say 20 or 30 or 1000 of those name that match my criteria, then how would I know how many were there? So simply do pipe it W. C. And minus selling will tell you there are three instances off your search criteria. Works perfect. I hope you understand. Now, all the text processing commands. I have explained it in very detailed Please, please do try them with different options and different scenarios and see which ones works for you and which ones give you more fun to work with.
62. Compare Files: we're gonna compare to files how that is done. There are two very basic commands that that are used in Lenox. The 1st 1 is the diff, which is going to compare to Farr's line by line. And the 2nd 1 is CMP compared and it does bite by bite. We're gonna look at thes two commands by logging into our system will use a party session. And if you remember the police station, um, we would need the i p address off our machine. If you don't remember the i p address, you could go back into your, um, consul. You log in and you do you do if config pipe it more because we don't want to see the information going too fast. So I'm piping it to war and you'll see the I P addresses right here. You could put that I p address in your body and you will be able to connect to it. So let's minimize this. And let's see, we are sorry. Who am I? This directory on men? Women home. What's inside my Derek tria. Want to go into the directory Superman and see what's inside in Superman? I have I removed this fall I created earlier Is that this way it will be easier for you doing the same and recreated so removed. So Okay, so I am in this Derek tree home. I have sold Superman and I want you create a fall, um, called Superman characters. So let's do touch. Sorry. Not touch Echo, um, and the first character of Clark Kent and put it into Superman characters. Find Steer. Yes, it's here. And then go Lois Lane. Double Superman Characters Co. And Superman does do cat, and you'll see it has three lines. Clark, Lois Lane and generals are I want you to create another file. Call it character because women characters to so a barrel key Go back to the first while And this time I want to do same things him and do character to hit Enter. Then you'll do the same thing Don't sought to. And I know it was Lois Lee. Yes, listening character, too. And the last one is Jones are. But this time I don't want you do something so I don't want you, John Peter and enter. Let's check the Superman too. Okay? You see, the Superman two has your own Peter and the Superman, um, dash characters has general saw. Now let's do comparison. If you want to compare, Two Falls will do the 1st 1 with death and Superman characters would supermen characters to It's gonna tell you the first file right here has the generals are on it, and the 2nd 1 has your Peter. What if want to compare it? Superman. So, for men to again, you could do just tab or complete, and it will tell you the last, relying that 3 30 bites a testified difference. So that's what the to dip commands that we use in the next two. Compared to files, there is not an easy way to compare two Falls and Windows. So that's why, again, this gives us a huge advantage to do file tax manipulation. Lennox Again, I want you to do man command on both commands and camp and just learned different options that are available
63. Compress and uncompress: next lesson we have compressing and un compressing files. There are a few different commands that be used to compressing and compressed files. But first of all, there is a command that is used commonly in Lenox, and that command is called tar. What does tar do? Well, Tart takes a bunch of foz together and put it in one container or one file. You could say it's just like in Windows. You have a bunch of files and you sit them together. So most likely, the Tar Falls does not compress as much as the actuals Jesup command that Jesus is the command is actually compresses a vial. And then there is a command Jesup minus D or gun zip. These two commands are used to un compress. Ah, file. So let's get to a question. Our favorite question. Why do we need these commands anyway? It's a very good question off course up to answer this question this way is what happened to system crashes. It's OK. You try to resolve the issue, but you cannot. There is. You tried everything, but you cannot find the issue. You cannot get to the point where you know Ah, that's the problem. So what do you do? Are you gonna sit there and just, you know, try your endless outward to resolve it? No. What are you going to do? Is you're gonna call the support you're gonna called Red Hat or the operating system support. If you are running Santo s, then most likely you are out of luck because most of the center s has no support. So I hope you're running red hat in your corporate environment. When you are running red hat, you will get a support. So you pick up the phone, you call them, then what happens? They will tell you to send the files or logs to their websites. And sometimes they're so maney logs so many files that they ask you, you have to put them together into one file or one container, and you make put them all of them in one container. That is, when you doing tar or in lyrics language you could say tarring. You put everything together. All right. So everything is together now. Now that the file sizes huge, it will take so long to transfer. So what do you do? We actually compress it once we compress it. The file size becomes a lot less than its actual size. So we'll try all these commands in our Lennox environment one by one. And this way you will understand how these commands work. All right, Um, I am in my home directory and someone has asked me that. Send me all your contents off your home directory. So in my home directory, I have directories and files and maybe links and directories subdirectories in suburbs within subject. Is there more directors? So how do you would put everything in? One is we use a command tar and the option that I used to see the f you could look it up CVS option by running man. But I've been using these three option letters for a long time, and I know it will talk. It will compress it a little and put everything into a file. Then I would have to specify the name of the file that everything will come into. So I just put myself because this is my home directory. I'll just put, I absolve, I'll just put tarred the end. Why? Because this will identify that this is a tar file and What are what am I tarring? I'm tiring this entire directory so I could do home. I have solved this will tar everything in that. Or I could simply do the relative path, which is dot dot means tar everything or put everything that you see right now into Ah, file call. I absolved Qatar and I run it. You see all that messages come up on the screen, some off the message that you'll see tar file is archived. Non. Don't forget that. Don't worry about it because it's trying to tar itself. That's where you are getting their message. But anyway, when you get all that message when you run at X minus, lt are and you will see right here I have so Tor. Perfect. Yes. So now everything All the contents, desktop templates, public. All these files and pictures I have are all putting into this file. How am I going toe untargeted? Well, I don't wanna untargeted and the same directory Would all the fathers already exists? So what I will do? I will create a directory m k d i r. And I'll call it block, blah, blah. Whatever. Okay, the file, the deckchairs created. I'm gonna move this. I absolved a tar file in tube Law Directory. It's moved. Yes, it is moves. I don't see it. I will go into blah directory now. I'm in blood. Right tree. Just make sure to run Pwd. Yes. Home. I was all block. Perfect. Is the file there? Yes, it is there now. How, Antar? Meaning? Taking all the contents from this file and putting in this blood directory. There's a command tar, same thing. But this time out on X, the F extract everything. And this is the name of the file. While Ron it had enter. It will come through all these untiring falls. And now when I do, I am in home. I have solved block. And now when I do ls myself to you, What should I see? Well, I should see the exact same contents I have in my home. I absolved. I should see the same contents here. That it's confirmed. Bingo! Yes, I do see everything, right? Burfict. So I don't want all those contents in there. I'll go one step back and I'll do it. That's my salty are again here and you'll see I have the same thing here. Why do we need to keep two copies? But of course, was just a matter off explaining you. So let's go back in to block. And this time you'll see I have this file. I absolved. A target has everything. Now the size off it is to 72 58880 But it's huge. I want to compress it. So let's compress it with Jesus. Jesup IVs all dot are simple. Is that hit? Enter? You see, it took a little longer, but it did compress it. Just look at the size right here. Remember the size to 725880 Unless release my cell tr you see the file size went down a 018298 It means it has humming to just two for 67 This one has to 46 and eight. So, of course, this one was The size was a lot huge than this one. So it means it is compressed. Then the next command we have is G zip minus D or gun zip. What this does is basically un compress it. No toe. Do un compress. You do G zip minus D or again guns. If which is right here G zip or gun zip, I'll just use G zip and I absolve dot tar dot gz hit Enter now the father's side should come back to the same one we have right here. This is the original file size, remember? And yes, we did get original policy wise, so we have tar file VG zip, diddly compressed it the un compress. It will go back to our home directory. And we do have this blood directory and will simply get rid of this blood directory which is removed. Mines are for removing directory or rmd ir to promote blood. Director is not empty. So what we'll do, we'll do minus F to force it. I think my rmd ir myself does not work here, so I'll do our A minus R f This definitely work here. Yes, it does. It's gone. Director is gone. So this is how the tar is explained in simple words. I want you to try the tar fall to tar your own home directory, Jesup ing it or and then unzipping it. Or you could even simply take any fire that you like and Jesup it and see if it's file size reduces. And again, the purpose off these commands is if you went, if you have to transfer files from one computer to another or to send it to someone, the file size are huge and the trash will take a lot longer, and that is why we put them together into tar and compress it so it become a smaller and smaller, and the transfer becomes easier.
64. Truncate File Size (truncate): Let's look at truncating file size using the command truncate. Now the legs truncate command is often used to shrink or extend this size of a file to a specified size. Now remember one thing, truncate is not the same command as if you wanted to compress a follower GZ profile, which will reduce or shrink the size of a file. Truncate, On the other hand, will actually chop the file into the specified size. So if your file size is, let's say a 100 bytes and you use the command truncate and shrink it down to 50, then it will actually chop the file and you will lose the data or the content of a file. And whenever you do cat to the file, you will see half of your data is gone if you are chopping using the command truncate. So the command that you will need to use to run it, its truncate minus S as first size, which is the option. Ten, is the actual integer to the specified file, whichever file that you watch truncate to. So this is the size option is everything is there. So now let's go into our Linux machine and we will try our command, the truncate command over there. Okay, so we are in our Linux machine to practice our truncate command or to go over it. I will create a file call. By the way, I am in my home directory and I'm logged in as myself. And my host name is my Linux machine, of course. Okay, and now I want you to create a file called Touch and call it Seinfeld. Words. The file is created. You could verify by doing ls minus l and the name of the file and hit enter. You'll see the file is there. It has 0 bytes and is owned by me and the permission and all that stuff. Now I do echo and type the famous characters of signed or sorry, the famous words that you could think of, that of Seinfeld. But if you don't know, then just follow my lead and just keep typing. Like the first word is per fishery. Second word is giddy up. Their word is yada, yada, Kevorkian. Serenity now. And last one, let's say festive assess and. Put that to our Seinfeld file. So let's make it a little bigger so you see all in one line. So I'm actually echoing out these words and I am putting it to the file name, the file that we just created. Hit enter. Now go ahead and do cat on Seinfeld words. And you will see all of these words inside of that file. Now, do ls minus l and do Seinfeld. And you'll see the size of the file is now 57. Now if you want to shrink that file using the command truncate, then you will have to use command truncate minus S as an option space, the size that you want to specify, a DUI to shrink it to. So right now is 57. Now let's make it 40. And the name of the files and hit enter. Now do ls minus l two Seinfeld again, and you will see the size has been reduced to 40 bytes. Now let's see the content of the file now. Seinfeld words. Ok, you see the content right now when I did kat, It says fissured giddy up yada, yada, yada, and SERT up to here, that's it. It did not complete the entire word Serenity Now C right here, as I have right here, is for every now and then, it actually removed Festivals as well. So it actually, then I do cat again, Seinfeld. You see right here it actually remove the last few letters. Why? Because it has to chop it down. That's why we would use the truncate command if I wanted to chop the file. Now remember, truncate command does not, is not used to actually compress or make it size, make it smaller while keeping the same content. So be very careful. Anyway. So this is the lesson where I wanted to cover the truncate command. You could use this or you could also use the truncate to extend or make the file bigger. So if I do truncate, hit up arrow key and I put it back to, let's say 60 and hit enter. And now do ls minus l Seinfeld. You see the size is 60. Now does it mean that we're gonna get our whole word Serenity Now and festivals back in that file. No. That's checklist where if I do cat Seinfeld's word and you see it's not there. It's still giving me the only the size that has all those words because it does not have the information, whatever the Vive loss well, we did the truncate to shrink it. So it did extend it. But now where is that extension thing that it's been added? Where did it go? As just empty letters that it actually the truncated has added to this file. It is at letter signs too, just to make it bigger. Right now we do not know how to use VI editor. So by the time we will use the VI editor, you will know how to VI, but for now just to show you, we could do VI Seinfeld and hit enter. And you'll see right here all these add signs. These all add signs were added because when we extended the file, so operating system said now you're extending, I have to put something in there, right. But I don't know what it had before, but I'm going to add something so make it bigger. So that's why you see it anyway. So if you are using the eye right now and you want to get out, hit escape, shift colon q, bang, which is right above number one, and hit enter and you will get out of v. So anyway, don't get into EI right now. If you're not familiar with it, we'll cover it later on. So anyway, I wanted to cover this truncate. I hope you understand how truncate works now tried out there with different different files, different contents in a file, and see if you get familiar with it.
65. Combining and Splitting Files: next topic we have is combining and splitting files. You could combine multiple files into one, and you could combine one file so you could split one file into multiple files, like just an example right here. And you cat it for or three files you could up. Put the cat output off all those files into 1/4 file, which is you call it Filed four. So what will happen is whatever is inside, whatever the contents off those files 123 there will be combined. And they were pushed out two word file for So that's how you combine it. So how do you split it, and why do we need to split it? Okay, well, there are certain times when you do have big, huge files and you do need toe either compress it. If the compressing is not an option than what you could do is you could split it, meaning your chop that file into different files. And the reason you do that is because sometimes you have to send files across one computer to another or to 1/3 party winder, or, if it's a log file, that they have to check that the check and it's huge. It's huge. So the only way to do and your only friend is out there is the split. So you split it, chop it, whichever the number of files that you want to do and boom, you will have it. So let's look at this file that we have, Um and we will create some files. And in this example, you see, I have a file and ah, I'm splitting the file in 300 lines per file and putting it into ah, file called child file. Let's look at our Lennox machine and I will explain it to you much better while they're doing it through the command line. Okay, this is our legs terminal, which you guys are very familiar with. Okay, we are in our home directory. Just confirmed that, so we don't have to put all the practice files or the stuffs that are not belong to other directories. So we know we are in the right directory now. I want you to create a file that's called it, um, countries are, you know, continents. That's called country. That's fine. The file is created, and I am using the I. So the first line I'm gonna create is England. This is just a country. 2nd 1 is U S C. 3rd 1 is Canada and so on. But if you don't know how to use the I at this point you will be learning the I later on. But if you don't know how to use V I at this point so what you could do is echo. Let's remove the country's file, then do echo. But USA into countries cat it and you will see Yes, it's there. Next one, you put an echo u K and U I'll put but to redirects to countries, make sure it's there. Yes, we have two countries. We will keep doing that until we have some text in it. So u k u a e and um can and ah and for us on. And so it's land. I will stop here. Japan. So just do that. Confirmed that you have all those contents in there. So right now, how maney lines we have will do. We have seven, So I'm gonna make split them into split and just check the option is minus spell. Endless split two lines each off countries and I'm gonna put them in a file called Separate . Just sip and I'm gonna hit. Enter now let's see what we have. So you see, automatically Lennox knows that once I'm gonna create file Sepp, Of course, I requested to create two in each file. It has automatically appended with names like a a B a c a d. So let's look at what's in our A file. We have USA and UK BB. Sorry, A B you a in Canada a C. France since is the land and the last one is Japan. Okay, so every file has two entries wide. We don't have two entries in the last file. Think about it. I'm gonna give you a couple of seconds, Okay? I hope you guessed it right, because we do not have. If you go to countries fall, we do not have the exact numbers meaning we don't have eight lines. So that's why it took the first to put it in one first to second file first to third file. And since we didn't have anyone, Japan was the only one left alone. So our Japan and that's why it went just into one line to that file. That's how combining file and splitting files work. Um, this is a helpful tool. Then you have to split large, long, huge files and you have to transfer from one computer to another.
66. Linux vs Windows Commands: the next war Sick Windows Command. Why do we care about windows? Are near learning Lennox, right? Hell, certain times you do have to get into Windows to work or to perform certain task that will trash falls from one location to another or to run certain commands. So certain things that you would have to do eventually to work with Windows. But of course, mostly Windows is all going, but I think it's good that you should know certain differences off between the Knicks and Windows. I will log into my lyrics machine as well as I will bring up the Windows Command line as well. What? Zilin just come in line. Uh huh. Yes, there is. There's a Windows Command line, but, um, it is not purely used, just like as Lennox is used. But there are certain commands that we will run in Windows that does some off the functions that let next us. Here are the few commands that you will see that are pretty much works the same way as it works in the Knicks, but their the name off the command is different. So let's think of a file or directory in Lennox is less. My cell in Windows is de ir to rename a file. It's movin Lennox in R E n in Windows, copy simply straight copies. You'll P. Y and his copy CP Move and move CLS and Clear DEL, which is to the removal file or more Directory and R M in Lenox FC is to compare two files D I. F. S to do compared to files. Fine is to find something inside off. Ah, file there as grab does that, Lennox To get some help in the next you get man in to get some help and windows, you run command slash question, Mark. Sorry. And then we have display your location and file system. You do PWD. And in linen is change. D i r or C h d I r. I don't know how it is pronounced and the last one we have date and time. Of course, the commands do not stop here there many other commands. But I'm just giving you examples off you off them that there are some command lines and windows have put up over the years to compete with lyrics. But everybody knows that when those is primarily used because it's Gui based, and the Knicks is primarily used in clinics because terminal or command line based and when you have a command line is opposed to GWI, Greed takes a lot of CPU, a lot of memory and little command line does not said that's why is so much faster and then also with the command lines. You could do so many things as opposed to Windows. So I'm gonna belong into my next machine. Run few commands. And when I highlighted just to, um, get to the lessons, Uh, and just to get to make you understand what exactly the differences. So this is my command line in the Knicks, and I'm gonna go over some off. The ones that I have here is C. L. And in the next, when I do Alice myself, tr its message, come up on a type clear, it clears the screen in Windows. I have this terminal open. If I type anything like this hit, enter, enter, enter or I could just see ls. And it clears the screen as well. Then I have other commands, such as move the cursor such as help command Slash. So if I have a command that I'm running, let's say, D I r Then I will hit slash and question Mark. See, it is giving me exactly, not exactly, but pretty much the same way as Lennox does. And I do. Man on Ellis, This gives me the same help Windows have actually catching up a lot of things in the command line, just like for Lennox. And the reason they do that. They know that system administrator engineers who are really dealing with something very Pacific or something more robust or they wanted to get the result right away. They want to get into the command line, so too good to do compete in the market. That's why they came up these command lines. The next one I have CHD ir, which tells me which directory I am, and in Lenox, what that command is, PWD, which directory I am, then the last one is time and in linen is date and it's time or there. I want you to run it yourself. Um, if you I think I should run it because there's one thing I do want to tell you that when you run time, it does give you a time and then it prompts you to enter new time. Well, you don't have to worry about it. So you just control see out of it just like that, you control, see out of Lennox Machine. So these are few thinks that you should know. Um, if you are getting into Lennox job on UNIX environment, it does not mean that you just gonna forget everything about Windows. Windows has been there for a while. It's ah, I would say it's a very good operating system in terms off desktop users who use it every day. And, of course, most off the desktop market eyes captured by when does. We should not forget that we should give that credit toe Microsoft, of course, but in server environment and corporate environment, where the higher level application runs, then, of course, Lennox wants Alright, guys.
67. WELCOME TO MODULE 5:
68. Linux File Editor vi: Hello, everyone. In this lesson, we will cover the Lennox File Editor and editor is a program which enables you to create and manipulate data or text Analytics fall. There are several standard Texan editors available on most Lennix systems. You could use V i e d e x e Max PICO and women, which is a van. Them is the advanced version of the I. In our lesson, we will focus on V I. Why? Because V I is available in almost every Linux distribution, regardless of which Olynyk system you log in it. Whether it's a bun to Soucy Red Santo s, you're gonna find me I everywhere. Plus, it's very easy to learn. The V I editor actually supplies commands for inserting or deleting text, replacing text, moving around the file, finding substitutes, strings and cutting and pasting text inside. So that's what we I does when you have to write to a file, the most common keys are I, which is to concert escape, replace before our Defense league and quit without saving and quit. Right, but safe. So let's look at our Lennox machine, and at this time you will log into our Lennox machine the Linux virtual machine through our police station. Okay, um, that cd my and wished Eritrea in in this derek tree, I want you to create your first file. So call it the I, which is a command space. Uh, my first added to her or just save my first. Well, how's that? Much easier hit. Enter now. When you hit enter, you are still in command mode. You're not an insert mode, so there are two different modes. Once you are in the V, I his first more is to when you run the command. Second mode is when you inside of the V I, and you start typing it. If you want to get out of that typing mode, you have this escape. So now let's start. Let's see if I want to type into this file. You hit I or insert lower case I As soon as you hit I you see at the bottom it say's insert . It means we are an insert mode now. Already limits commands won't work are because we are an insert, more so that he could type something like Hello world. This is my first lesson to learn, be I and you could hit. Enter again, um, so excited about. So it's just simple as if you're trying award document now if you wanted to exit out off it . If you want to save this wall, all you have to do is hit escape right here. And once you hit escape, you'll see the insert mode is calm. Now how do you save this file? You could do through two different ways. One. You hit shift is easy, the twice, and it will save the file. Let's see if you do cat again and do my first file, you'll see it's there another way to save a far. Let's go back in the file, my first ball and let's say you want type something, um, hit insert again and then high space. And now you want to exit out and save his escape. And this time, instead of shipped, is easy. You type shift calling, right. Quit and exclamation point, which is also referred to as bag you had. How do you wear file? You read the father my first file, and there you go. The file is there. So this is these are two modes is once you get out And once you get in now, I want you to go back into your fault and it be I and my first file, and I want you to replace, um hi. No, I want you to delete high and leave their as is now. How do you go? Move around inside off the file. And you're already India editor. You could use up bottom left, right keys on your keyboard to move around. But remember, you cannot use thes keys if you are an insert mode. So let's say if you are hit I and you know in insert more and now you do a left right key. It can work, but it most likely it will break your command. So it's better you had escaped and go back and then you do d on your keyboard d This will delete the entire line I wanted to delete on Lee the Ford High. So how do I get back? My last line that I deleted. So you hit you just simple you and it brings back your last line. Now, if you wanted to remove the high just type X once which will remove one character Type X again was to remove another character. Now you have a space hit X again. Now you don't have a space Now what? If you want to save now again, do shift ZZ twice and it saves it. How do you wear a fight? You do, cat my 1st 5 And it is there. Now let's go back in again. And let's practice the replace command the I my first Well, I wanted to replace. I am so excited about it. I wanted to replace the word excited with the word happy. So how do we do it? We cannot hit I right now because we don't want to get into the insert mode. So we will use our arrow keys to go down to the word excited so I could do our once I hit our I could do h It only replaced one letter if I wanted to do again. The second letter You move your cursor to the right it are and then do a and so forth. But I would prefer that you do escape out of it and then do x x x expects and then you hit I and then PP why you escape again. So you can move around, You could go up. It could go it down If you want to move around now, if What If you want to go to the end of this file and now you want to create a new line right below it before I am so happy about it. You had Oh, this will create a new line for you. And also, it would automatically put you into insert mode so you could type anything like LA Law. The law? Well, you just noticed that you just type j by mistake. Now, how do you remove Jay? You type X, Remember, If you're gonna type X, it will write X instead of deleting it. Look, See it typing the X So I want to delete that character. How do I delete that, captain is because you cannot delete why? Because you are in insert mold. How do I get out of insert more You hit? You're saving life saving key which is escape as soon as you hit escape. You see, the insert mode is gone. Now when you hit x x, it deletes those two characters that you added by mistake. It was a typo that you added Same way. If you want to go up, you could if you wanted to write something right here. And if you type, I you notice it. Start writing right in the middle. Hello. Hi C without giving a space. So let's do escape again. His ex Move the cursor to the left and x Okay. And now you have that space in the middle. Now, how do I write? By putting a space in the middle? I do a so able automatically advance to the next space. So hello. Hi. By space world. Okay. Now you still insert more. What? If you want to save it before you save it again, get out off Uncertain. More beheading escape and do shift z z this safe cure while cat My first, uh, and it is saving your first file now. What if I wanted to delete the line blah, blah, blah the third line. So I'll go back into my file, be I my first file. Move your cursor down to blah, blah, blah and hit d d twice. 12 They It removes the line that you added that wherever you want to go, if you want to. Oh, usual Moved it by mistake. No problem that you will bring it back again. You could save it through ships. Easy for you could save it through common right, Quit and bank. You could hit and and that's how you saved the ball. Now let's go back into the fall one more time. The I might first file and I want to. Let's say I have a file which is huge, and I wanted to search for a Pacific word in a file. Let's say I wanted to search for a lesson. I wanted to search for l so you could do search for it two ways. I hope you remember the command corrupt. And then you search for lesson from where my first file and it will Onley bring that one line that has the word lesson. But if you are in the eye mode, you could also do that same search. And now you could just simply make sure you're not an insert mode. Simply hit slash and type L E s s on lesson it into and there it will bring you to exactly the word that you want to change. Perhaps. Are you looking for so These are the few commands that we have about creating a file using the I. We do have many different commands or keys that we could use in V I I have included in this lecture. I have included all those keys in and Azan Handout. So please look into those and try every single key. I really want you to be very familiar with this and become eventually become an exporter venue typing in something in your text fall. You know exactly which key you're gonna work into or which exactly key you gonna use. Ah, one common mistake that everybody is gonna make is when you are an insert mode, you're probably gonna have to get out of it. You can. You typing ex this and that. But you cannot. So your lifesaver is You do colon. No. First Sorry. First his escape. Colon que Now this time don't write w the w will write your changes. The file. You don't want to make change it. So just to quit cold and quit bang, hit, enter verify it. They go See now you don't have that garbage that you were gonna write your file into. So this is another way. You get out and change your father. So please practice man also give you different options to use it. There's again. There's another editor if you like to use, which is them which, um, Anat vast version off the I. You could use that to, which is also available. Most of the links distribution, whichever you like, But please do practice practice as much as you can. And I will recommend that you create files many files in your home directories or within your subdirectories creature files and write whatever you want to ABC or write a story or whatever and change your text. This is this is gonna allow you to practice v i editor.
69. Difference between vi and vim Editor: I love folks. We have learned V I editor. And now it's time to look at the difference between Via and via manager. As far as the functionality is concerned, both editors work in the same manner Which editor you choose is a matter of your personal choice. Some people recommend learning the same editor instead of the V I. A teacher. Now, of course, the due to its added, featured the learning. And using them editor is much easier than the via editor. Now, if it is easier than why he was using the I in the first place, the reason we were using V I in the first place is because the I was the 1st 1 that was introduced when the Lennox or UNIX was born. Now, a lot of times you're gonna find you're gonna find, um, supporting an operating system, maybe like older version off operating system. Maybe it's Solara. Sorry. I asked HP UX type off, older UNIX type of offering system That probably not gonna have them. Then you have to use V I now the difference can I do I have to learn them as completely new commander. New tools. Absolutely not What if you have learned V I then you have learned them as well, but you probably not have learned its enhanced feature. That is why it say's that if you have learned of emphasis, which has a lot of new features, and then you go the I, that means you have to go back to via all right. Next one is a sense of the them is based on the V I. So when you learn how to use them editor, you will automatically learn how to use via editors. Just that simple has explained it earlier. Them has all the features as V I with some excellent addition, and it there. There's also a comprehensive help system and a lot of customization options available and the VEM editor. Now, let's look at the difference between a V. I. N g m editor. The main difference. Now I got this picture in which is very information picture from all line. So let's look at a few things that V I has to offer today. It is installed on a lot of places. It has a shorter name, and it is simply to use and the combine feature for V I and them. Let's look at them both. Our small boat are a big Quintus, meaning that both are available pretty much on a lot of offering system. Intuitive command language. It has a learning curve and a powerful once you learn it. So one way or the other, whether you learn V I or them, you will have the power once you learn it. Now, if you wanted to learn of Emma's, you're gonna find a lot of new features that are listed on the right hand side. And one of them is the completion, which is that you could auto complete your command or your word, or or as if you were typing in bash who had tab it. Auto completes pretty much the same way. Then you have spell check. Beautiful. So if you are typing of word and you want to put a spell, check it will. It is available now in V, Iet was not available. But, um, it's good that the spell check is there, But I do not find ah like a strong reason to doing a spell. Check the reason because we do a lot off, um, configuration file changes. So in configuration file. A lot of words don't even even make sense. But anyway, it's good to have a spellcheck and every via editor comparison. Ah, merging Unique owed them def. Regular expression. Scripting language supports many different ones. Plug ins. It has a gooey folding and a syntax highlighting a lot of these new feet features. Now, if I go into each one off them, it's gonna take me a lot longer. But I want you to go ahead and explore it yourself. But what I could do here is I could give you some of the information that will help you to understand and learn them. Editor in all its new features that it has to offer, let me give you the interactive learning tool. But of course you could go up, you could go online and you could find a lot of tools. You type the vim, them editor tutorials, you're gonna find tons of resource. Even people have written books and them and you're gonna find even a single entire course, maybe 10 20 hours just on them. So the more you wanted to learn, the more you are diggin. It's pretty much the same as I said. I would always recommend that you use a basic basic, um, way off using them or V I. Let's get into those tools there, many website that all for free, them interactive training. And these websites are, of course, these are free, and people have done an amazing job when they actually have built those interactive tools for people to actually learn that. Now one of the my favorite is the dubbed Upped up dot open of m dot com. This this upside has interactive tool, which helps you learn of em, or V isa a lot faster. And I would definitely recommend you to please go ahead and try it out, and you're gonna find it a lot easier, then actually going through, um, document or going through a tutorial or a video. Next one is a vem genius dot com of which also has, ah, good interactive tool that you could learn from. And last one is very good ash adventures dot com, which actually teaches you the editor through the games. If you're into games, you could play games as well as you could learn them editor as well. So let me go into the open Wim first so I could show you how it works. So go to the browser and right here I have opened. When already enter, I'm just gonna refresh it and it's going to start the introduction and you see on top, this is the interactive screen for you. And the bottom is the keyboard is gonna prompt you to enter the highlighted keys at it's gonna ask you to type it on the screen. So let me read it. The first time you're gonna log in, it's going to say hello. I am an interactive in my tutorial. I will teach you what room is about without hassle. Perfect. Nobody wants hassle. If you are in a hurry, press any key to go to fast forward. What it means is, if you wanted to goes directly into these different lectures or interactive sessions, then you could just hit the space bar. Are so sorry. Any key to fast forward. But I would not recommend you. You go to it, Just spend some time and believe me, it's not gonna take you longer to go through the first introduction section to practice. You have made you learn tryout practice page it has contest sensitive and reference for command. Now let me introduce you to the basic of them. Now see, it's highlighting or in blinking the enter key. So what it's asking you to do? Is it hit? Enter Once you hit, Enter says them has two basic motor. One is insert mode in which you write text. And if, in a normal lacks editor Uh huh, excuse me. And another is normal mold, which provides you efficient way to navigate eminent Playtex. So we already know that your type I to get into the interactive. Moreover, you type it in and you would escape to get out of that. So now the fit line says, Let's try it out. First changed to insert more to It's asking me to hit high guard and high on your keyboard . Good. You are now in the insert mode, right? Something and change back to normal. Okay. Hello. And I wrote that and lead. I'm gonna hit, escape good, or let's move on to another section. Beautiful. Let's head enter. In contrast, a relic regulate to regular text editor usual skis, H J. Kate and L. Instead of arrow keys to move Kerson. No as I explained that earlier as well. Ah, try not to use the left up, down and right keys. I would suggest and definitely strongly recommend that you use H i j k l keys to navigate a left. Right. So basically here, it's actually teaching you how you could use thes interactive keys again, as you could see. Ah, we're already on the third interactive session. All you have to do is go to up to 19. The last one is 1/20. And try that out. It's not gonna take you longer. And you're gonna find it so easy to learn of them. Editor. Right here on this on this interactive tool, the 2nd 1 I explained you is the vim genius. So if you go to of ingenious dot com and is going to say become of ingenious click start now, I'm a beginner. I'm experience. Um, if you work beginner picked the 1st 1 or the 2nd 1 If you have some experience already Now , before you start, Um um, this is what it's telling you about those main keys. Nvr them editors to go ahead and start level one. And now it say's move cursor to left. Look at this. Top left is the HQ. So when I do a J, it says H is correct. Press enter or click next to continue insert at beginning off line. So inserted the beginning off line as I or is it I o r o. So I think upend the cursor. So, um, so it's giving me the next line. Anyway, I was thinking, I hit Enter. So a pendant cursor is usually a so hit a Ennis's A is correct press entered or click to next, so upend at end off line. So it's gonna keep asking you these questions and you're gonna have to press the keys on your keyboard. And the 3rd 1 is, I said, I'd never used it. It's actually learning them while playing a game so you could actually saves press any key . So I'm gonna hit enter and is going to say h k L g as my navigating keys up left, right and bottom and you could go left right bottom. This is your cursor, and you could learn as you go through it. So I never used to try it out. And if you like it, let me know and provide your feedback on that. Anyway, um, this is all about the them interactive learning tool. I hope you find this. Um I hope you find this lecture valuable. And you could use thes open, free tools online to learn of him. If you have any questions, I'm always here. Asked me. Send me a message. Send me Ah, message to view to me or send me an email. Thank you. And good luck.
70. Sed Command: Hello, everyone and welcome again to Ardell. Newer Lesson said Command said command is a substitute command which replaces our substitute a text with another texts or manipulate your file. It is a very, very powerful command. So what are the few things that said commanders? It replaces a string enough file with another string. So our string is a word. Ah, sentence text message or any kind off text message inside off your file and that you want to replace it finds and deletes a line. So if a line has ABC and you want to get rid of that line in that text file, well, you could go in and use the set command and delete that line that contains ABC. Now, wait a second, Imron. Hey, why can't I do the same thing when I goto v I and find the line and deleted? Yes, you could definitely do that. But what if you have ah, file that has, let's say, a 1,000,000 lines and in those 1,000,000 lines, you probably have at least 1000 lines that has ABC. Are you going to go into the file and delete or place that string one by one you think that is efficient? Not at all. So that's why I said command is so powerful that allows us to manipulate the text inside a file. Another example that we'll learn is how to remove empty lines from a file. If they are more than one empty lines, how can you get rid off it? Yes, of course. It going back to the same thing that you could go into the V I and D D and remove it. But again, this is not productive. Remove the first line or number of lines in a file to replace tabs. But space is these air. The few very few examples offset commands that I'm gonna go over and substitute within V I editor. So if you are already in B I and you want to replace a text X y Z or TXT or anything with another, um, text or another word you could also do by going straight into the V I. But again, um, am I, uh, negating my statement? What I said before, No, because when you are going to the eye and you you when you look for one word and then you replace it again it's a manual process. But there is another way in B I that you could just find that text one time and replaces it everywhere in one shot. And there is so much mawr and mawr, That is, um, that said commands has to offer. So I'm gonna log into my linens machine. I'm gonna log in as a putty client, and I will show you a few examples off How Said command works. Um, I'm logged in as myself. I am in my home directory. Um, I have a file in my home directory that is called this duelist myself. Your that is called Seinfeld characters. So if you do cat on Seinfeld characters, you will see all these characters off Seinfeld. Um, again, it's just a list off all the characters that played in Seinfeld. If you do not have that file or if you did not create that file previously, then go ahead and you could just pause it right here and create that file. But all those names that I have or if you want to use a different ball, a different names, that's fine. It's just example that I'm gonna be using to explain how said. Command works. So I already have this file now The first thing I want to do. Let's say what if I wanted to replace Ah, one of the word with a different word. Let's say I wanted to replace Kenny. There's a character named Kenny Banya. How about if I want to replace his name from Kenny to Lenny? You would use the command said single code s for substitute Kenny with Lenny to slash Lenny and slash again. And if you if there are more than one Kenny, then you could type G because this G is stands for global Every replace the entire file wherever you have the word Kenny. So by default, I always juice G. You should also get into the habit of G if you want to replace it everywhere. So you you you close the single coat and then you type the name off the file where you are trying to replace the board. Kenny hit, enter. And now you will see at the bottom. It is replaced with Lenny. Now another thing. Um, I do want to mention that this is going to display the change on Lee on the screen. It is not actually going to make a change in the file. So if you get out the file, you will see the name Kenny still there, but didn't be just replacing Lenny. Yes, we did. But it did not make the change inside the file. It on Lee makes the change to the screen. And if you wanted to have that output to another file, you could do that. And that change will be reflected in the newer file. But if you want to make a change to the existing file, then what do you have to do is you come back to the same command by hitting up arrow key and you type minus I. That is to insert the changes into the file the same command and you hit Enter. Now, when you do cat Seinfeld characters, you'll see the name has changed. Two Lenny permanently. So this is how you replace Kenny? Will any and save the file. Now, let's see. What if you, um, wants to replace um, the word Costanza? So it works the same way. So you do said substitute Costanza. And this time you just don't want to replace anything. You just want to remove that word. So you just put Costanza and don't put anything in there, G and the name of the fall characters. You see any anyone who had the last name? Constanza That is gone. She were here. Frack. Costanza's going Stell, Costanza's gone. Another consents. I have. The bottom is gone. George Costanza is gone. But again, this has gone on Lee on the screen. And if you want to make a changes to the file, you have to use the minus. I option. I don't want to use the minus I option this time because I want to show you how the set work. So this way the file won't change. So just that's just confirmed. Our file has all the correct names that I want to have them in it. So it does have it next. One I wanted to show you is how to find a string off line and remove it. If you see, um, this is the 2nd 1 in our slide, Find and delete. So what if I want to delete every line that has the word Seinfeld took for the command to do that is said Seinfeld. And this time type de de is to delete any character or any word that comes up the matches Seinfeld. That line will be deleted. So I am not using my eyes. I option because it will actually see make the changes to my father and save it. I just want to show you. So I just I'll just run it and you will see all the lines that had the Seinfeld are gone. See none off. This has the word Seinfeld's in it. So that's how you replace or delete a line that matches a key word or award. The next thing I wanted to show you is how you could, um, remove Mt. Lines from a file. So if I have empty line, let's make them T line. I'll go into Seinfeld characters and I'm gonna make empty lines. So I have four empty lines, right? I'll just make one empty line right here as well. Five empty lines. Now I'm gonna save that file cat Seinfeld characters, and you will see right here I have five empty lines. I wanted to get rid of these five empty lines. The command to do that, IHS said. Stash cap caps shows that anything that starts, which is right above number six and dollar. Anything that ends but dollar, meaning nothing. Then just delete that sign. Sorry, Seinfeld characters. So anything that is starting or anything that is ending has nothing in the middle. Which is the empty fall, of course, right? So whatever that finds, please go ahead and delete it. So hit, enter and you will see everything is gone. But now, if you do Seinfeld character again, you'll see you'll still have the line. Why? Because we did not specify the minus I option, and I want you to go ahead and specify minus I option. Do a Seinfeld characters and you'll see all the empty lines are gone. Now what if I want to remove the first line in our file? Ah, I just wanted removed Jerry Seinfeld, which is the first line off the file. So I will do, said coat one D coat. Close the name of the file and you'll see the first line was searched very sinful. That is gone now, of course, again, I'm keep saying it is not going to affect our file because we did not use mind's eye option . Um, now what if you want to remove 1st 2 lines will hit up Arrow Key and just type one comma two, and it will delete the 1st 2 lines. That's how you delete 23 or four more lines. Now what if you have, um, tabs in your, um, and your file and you want to remove those tabs with spaces? So if I do V I on Seinfeld characters and instead of, um, space is I'll just put tabs, tabs and tabs Save the file. You could do cat Seinfeld character. You see, three lines have tab. I wanted to remove all the tabs inside the file with space, So the command to do that is said substitute slash. You have to use backslash and T that tells the operating system for the show that this is a tab. Anywhere you find Tab, please remove it with space and apply it globally. Seinfeld characters, You see, um, cope Didn't like something. Um, one second. Oh, my mistake. I used backs last year, so I have to use force. Slash is here because this slash right here and this slash right here in the middle right here is to string that we're trying to replace. We're trying to replace that string with what would 70 line. So now that should work. And there it is. It did work, but it is so good not going to impact our file. I'm gonna use that command of minus I option. So it will make the change to my file and bring it back to this original content. Okay, so now that's how you actually replaced tabs with spaces. If you want to do the same thing, replace spaces. The tabs. You could do the same thing, but just switch. Ah, backslash tea with the with the second a space holder. So you move this thing to here so it will remove everywhere that let's say you want. If you want to try it t and hear any spaces that it's in their please replace it with Tab. And I have to this year. Okay, So I believe sign fell characters. And there you have all the taps in there. I did not want to make the changes. That's why when I was checking it, it was not coming up anyway. I wanted to bring it back, bring it back around the earlier command which is this replaced habit spaces and hit enter and now do Seinfeld characters, and you'll see my format is back the way I want. Okay, now, what if I wanted to, um, a show on ley lines from 12 to 18 from a file. So I just wanted to view 12 to 18. So 123456789 10 11 12. So I wanted to see all the lines starting with J. Peterman all the way to the end, which is the 18th line. I don't want to view any of these lines. So for natural use, the command said again with minus an option 12 from 12 to 18 p is the option that you have to pick and you hit. Enter and you will see right here. It's giving me from line 12 to 18 now. What if you want to view? Ah, the opposite way. Meaning you want to be everything except line a 12 to 18. Then you will run. The command said Now, don't use minus end Jews 12 18 de this time and Seinfeld characters and you'll seal. You have all the results from the top except starting line 12 to 18. Now. What if you wanted to, um, put a put a space in your, um, and your file? Like every name. There should be a space. There should be, Ah, empty line. Um, after each character. So you will do said just G Seinfeld characters. And you see, every line has a space empty line, then the name empty line, then the name. This is how you add it. But of course, it's not going to impact our file. You could you could have that changes by putting in mind's eye option. Okay. Now, um, what if you wanted to replace, um um, like, let's say, if I have Seinfeld character and I wanted to replace Seinfeld with s or any other name, but I do not want to replace number line eight. So 1234 by 678 I wanted to replace Seinfeld with s except the eighth sign. Fill. So you do said single coat. Do not do eight and substitute Seinfeld with s do it globally. Seinfeld characters. Okay, See it. Um, the change one second may see No, um, let's see. So if I just type eight, just subject sign of A s, so it is still not doing it. Am I doing something wrong? Ah, yes. I am doing something wrong. See, sometimes just a tiny bit of a mistake Makes a huge difference if you notice there is no such word. A sign fled. I put signed. Fled. All right. It's a good exercise. Um, it enter. You see, every Seinfeld, uh, text award has been changed with s. But now let's go back to our original question. I don't want to replace number eight. Fix my spelling. Enter and you will see all of them have changed extent except line number eight. Now, the last one I talked about substitute while you are in B I editor. So go ahead and type V I the name of the file. And now you are India editor. Now what? If you wanted to replace every cycle character while you are in B I so you'll do. Colon percent sign success for substitute slash. Sign filled to Peter. Right. You want to replace every one of them and slash hit, enter and you'll see every Seinfeld has been replaced with the word Peter. That's how you make the change while you are nbr editor. No, I want you to go ahead and try it out. I have also, um, on article mentioned here in this lesson that you could view that article and try all the different commands. Ah, against said, command is very powerful if you really know inside out. So I will encourage you to try many different ways. Go ahead. And do, um, do your google go online and search for anything that you wanted to do? What said And I promise you, every time you will type something, make sure you type like how to replace a string and said, command, make sure you put in said command. And I'm telling you, you're gonna find tons of article out of their people again. Um, have done amazing job who have helped people. And you could look at their article and see how things are done. You could learn on that. All right, um, if you have any question about said command, you could just simply send me an email or Ah, message me. Um all right. Good luck.
71. User Account Management: Hello, everyone, and welcome to a new lesson. User account management. In this lesson, we will learn how can be manage user account and Lennox in Lenox file system. There are, ah, few commands that we use to manage user account. The 1st 1 is user at is to create a new user group add to create a new group, use a delete delete, delete a user that is already created, group the lead to delete it group and use Ahmad, which is to modify a user. No. Whenever we create ah, a new user, those user management are created. Their record is maintained in three different files. The 1st 1 is at sea password 2nd 1 is at Sea Group and the 3rd 1 is at sea shadow. Now remember, etc. Password is not a complete word. Password is just past wt example. To run. A user command, which includes all the parameters that you have to define, is has fallen, goes with user add minus even option to add a group minus. As to option two. Give ah shell environment minus C to define the user description minus M minus T to define the user's home directory and the use itself and their use a home director itself and the name of the user. Now let's look at our Lennox machine and you'll practice thes commands and learn these command mawr into detail of log in to, uh, my Lennox, um Horschel Council. It's more this little to the side. So we could see what are the command that we will be using? Okay. Um, always first thing first. You need to find out who you are. You yourself, are you. You are in your home directory. Perfect. And what's inside of your home directory just to confirm you are in the right place. Yes, you are. When you have confirmed this just to clear screen, Um, now we gonna create a user call. Ah, that's a Spiderman. Before I create a user, I wanted to add that user to a group. Um, that is let's call it superheroes. So in orderto use thes command, you have to be route, so become route as she space by stash. Okay. The first command that we will run is user bad space. Spider Man, You hit. Enter. It gives you the prompt back, which means it did create. You are use your Spiderman. How do we verify if the if the user is created? There's a command to check if users create is called I D. It's fighter men and I'll tell you that there's idea signed to the users by the man, and the group is created called Spiderman and the group's I deeds so on. You could also verify about going to the home directory, So home if you notice that it created right here the Spiderman, the next command that we want to learn. Aziz Group AD. I wanted to create a group, a new group, to come on the command to that a new group, this group bad and I wanted to name it superheroes. It adds a group. Um, we could verified by looking at the group file, which will cover in a little little bit. But if you wanted to see if you could just a cat at sea groups and at the bottom, you'll see it created this group named superheroes. Now I want to delete the user I created Spiderman to the command to delete is user delete. Now, if you want to delete the home directory off Spiderman, which is right here you run the command user delete, but minds are as well. So it would delete the the directory as well. So it deleted the user. And let's check if it deleted the home directory. Yes, it did delete the home directory as well. So believe that I created and ah user before just called Spider just for testing purposes. As you could see it here, the next commander you have to do is, of course, the group delete. So let's try to delete the group. Uh, that's not the lead. Our group, your superheroes were created New group and with the leader just for training purposes. Let's create group bad. Um, known you good. Let's call us in your group that compares Created We verified by going to profile and see the bottom says no new group. That's new group idea. We could delete the new no new group group, delete no new So and it's deleted. We could verify again at the bottom. See, it's gone. The next commander we have to learn is user mod. This command is used to modify the users. You go run, man on. Use Ahmad to see what it does it modifies as user account. If you notice a appends it as a user to supplementary group, see the new Value User Password D changed the home directory. So these other things, if you want to do after you create ah user so we will use this command to ad our user Spider Spiderman. Let's see if he have Spider Man first or we delete aspirants. So let's create despite men again. User, add Spiderman As soon as you add the user user at Spiderman, it automatically creates its group as well. If you don't specify, it creates a group with the same name as user ID's. Now I wanted to add Spider Man to a different group as well, which is a superhero. So how do we do that? User mod minus G, which was the name of the group Super Heroes and the name off the user that I want to add a Spiderman enter and it is added. How do we verify it? You do cat at sea, but instead of doing the cat and viewing the whole file, huh? Bobby used group command and just type Spider Man from at Sea Group oil and a go, you will see, this is the Super User Group, and Spiderman is also part of that group. This is the Spire Man's own group Name an own group I D. So it Spider Man has its own group, and it's also belongs to a group called Superheroes as well. If you notice one here when you do Alice myself to your the group of Spiderman right here is still Spider Man. Why didn't change to suit superheroes? Because it's actual group as Spiderman, but always remains biderman. It is part off the other group as well, which is super heroes. If you want this to change, then you have to run the command change group and then you specify superheroes and then you specify Spider Men. And remember, we have to use minus our option to cascade this permission off the group to every folder off the Spiderman. So let's run this command. And now see if a changes from Spider Man is superheroes. Yes. See, now the user Spider Man, the group of superheroes. So that's how you use these five different commands. User add user group at use it Elite group delete. And he was a modification. And the files that it creates this information is, is the 1st 1 is etc. Password. Let's look at the etc password Cat at sea password and you'll see at the bottom as you add a new user to the Lenox system. It adds the information of the user at the bottom that pens at the bomb Spiderman and despite ER, the one I created earlier both heart in there. The first column tells you the name. The 2nd 1 tells you the password, which is encrypted. It's just give you the X 2nd 1 tell you the user i d. And then the group I D. And right here in between these two Coghlan's. We didn't specify the description, so it's empty. And then here it's a home directory of the Spider Man. And then at the end, it's the shell, the Spider Man it's using. So that's the description off the etc. Password. Let's look at the description off at Si Group, the Nazi group you have. The first is group group by name and then the group password, which is the same password that is used for anyone within that group and then the Group I d . The last column that you see here for the few off them, that means that these other users are also pour off the group. Then the last file will look at is a sensi shadow. Let's see Shadow, while is strictly for passwords off users that we create. This does not mean the password right here, right here is actually password. It's just encrypted, so we don't see it. However, it does have some other parameters, like the password does not expire. And these many days their password lent restrictions and so on. You could view that in man command, off creating uses, you'll get more information about etc. Shadow far again If you are Pacific above one user, let's say you just want to know the information about Spiderman in at Sea Password. You do script. It's biderman at sea Password, and you will only get the information about your matching criteria, which is Spiderman line. Now we look at the last example, which is the example that is mostly used in the corporate environment that they were run one big command that will take you off all parameters, so that's creating a new your user ad minus G to specify the group, which is we already have a group, Super heroes. And it's look at on its minimize. This city could move up and view our command. Okay. Okay. Superheroes minus s means the shell that you want to give. They're different shells. There been bashed corn shell will cover that later. Minus C is the description. You have to specify the description. Superheroes you want to create Iron Mental, Byron man care. They're just a description. Anything more than that, then minus m minus D and specify the Home Directory, which is home Byron Man Space Byron Men. This will create a user iron man with all the parameters we have specified. And how do you verify your just to I d men? And you'll see that Iron Man is there is part of the group superheroes and you could also view it in NC password file on you see at the bottom it's there now, one thing that we do have to cover. Every time you have to create a user, make sure you create its password. So the command to create a password it's just simple password Byron, man. And to specify the password and the password that have specified it says password feels the dictionary check. It is based on a dictionary. Um, you could ignore that as long as you're running as root. But if you're not rooted in, it's gonna force you to change the password that is not based on dictionary. But again, you're route. You could do anything. So this concludes our lesson for user account management. Um, the main the basic commands are these five commands and files that are used to manages is etc. Pastor Group in Shadow.
72. Switch Users and Sudo: since we know how to manage his account now it's time to learn about how do we switch users and how to be allows suitable access to user. What is a pseudo access? It's basically ah, command which allows are an ordinary user to run root level commands. The commands that you go on to such from one user to another is simply s you. It's based Dash based is using name and then it will ask you for the user name password you into that and you become that user. Next comment is the Sioux do command. This is how you run the command if you do not have root privileges or you cannot become route But you still need to run certain commands than you were on pseudo, followed by the command And then the last command is V I sue Do be I pseudo edits the ETS etc. Suit war file which is a configuration file that allows user to add or remove the rights to run certain commands. And the file is at sea. Sueur, Um, if you remember the beginning, we talked about file structure and be talked about the etc again at sea is the is the folder or a directory in Lenox where all the configuration files are stored. Now, let's look at these commands one white one by logging into our Lennox machine. And this time you will log into our Lennox machine through the party. First, we need to find out what is the I P address off our legs machine? If he don't know, just log in. Um, clear this out and the command to check the I P. Address off your lending machine is if config you had enter and the I P address is right here. This This is the primary interface that is used to communicate with the computers. This is the local interface. You ignore that and this is another individual ignored. That is for private communication. So focus on this one. Open up your plate terminal and type in the I P. Address. One I to 1 68 $56.101 Enter put in the user name isn't password. Once we're logged. And because simply minimize this Kancil ex ists now we will be using the putty. Make this a little bigger. Okay, so, um, we logged in as herself Now What if he wanted to become, um, another user? So you do s you dash Spiderman. I will ask you for the password and then you become Spiderman. Let's exit. I'll go back to our account. What if you want to become root simply to s you dash which we have covered many times into the past Word and you become brute when you are route. And from this level, you wanted to switch to a different user. This is vitamin. Then it will not ask you for the password. Because super user, a root account is very powerful. That does not need any other password to be authenticated. We are your Spiderman. Let's go back. We are now route that school One step back, exit out and we are your horse ill. Let's clear this out. Next command, you'll learn a pseudo sudo is The commander is used to run different commands that is, Onley owned or only has permissions by route to run them. For example one of the command his d m. I decode you were on that that will give you permission denied because we cannot run that command. Another command would be, for example, F disk to chest. Check the disc size. It will give you the permission denied as well. Because we do not have the right again. Who am I? Your ourselves. So how do we get the permission without becoming looked? While only route can allow that I could become route here and run the command Till s you to root and it and to know I'm route and the commanded of Iran to add a group to at sea Suroor file is V I s C zoo for hair. You need to look for the group named Veal. Veal is the group that is automatically by default Added to this file, We go down, we're coming down. Remember to come down When you are in V I mode, you come down, you use your upkeep, right? Keep bottom key and they go said This is the veal and it tells you this group allows people in group real to run all commands. So all we need to do is to add I have solved into the veal group and it will allow all users who ever in real group to run all commands. So it's already added there. We don't have to modify the etc suit. Or if you wanted to add a new group or if you want to add a new user, then you would change that to allow run all the commands. Let's say if you want, if you want to add, I absolved to run all youse a command. Then you would put it right here. Who put? I have solved, uh, that oh tap. And then you run pseudo command and you could become route, uh, rights to run any command. But we don't want to go at the user level. We want we will stay at the group level. So what I'll do, I'll delete this line to delete a line is DD and then save the pile. Now we know that we need to add user to feel groups to add a user issues ERM odd minus G and the command is the rich group is veal and the user is so enter. How do you verify your group deal from that's he grew up because group is the file. The man just that user manages all the groups and you'll see right here. Now I am part off the group real so if I become myself at sea absolved my myself. So if I become myself now, if I run Sue d m. I decode it will ask me for the first time Password. Um Okay, so the command that I typed was wrong, so d m by not d e m. I decode. Sorry about that. There you go. See? No, the command is running. What if you run this command just fiddle, Sue, it's not gonna run. You have to run the command pseudo followed by the d M I. D. Code. And that's how it will run. You can also run the second command Sue do, um F disc, which will tell you the size of your disk. And here it will tell you your size of the disk is 10.7 gig and all the petition information all that. You can only view that information on lee if you're route. So this is how we do switch user from one user to another and be at a user to become a powerful user or run powerful command that Onley owned by route
73. Monitor Users: that's monitor user's. We have created them. Now we have to manage them because that's one of the basic job for any system administrators or engineer or a systems guy to monitor that uses what they are doing in our system. Some of the commands to mind those users are who who tells you who is in log in the two system. Blast W Finger and I. D. These are the few commands. There are many other commands as well. But these air the few basic commands that are mostly used in Lenox Environment, where you could monitor user's Let's look at our links machine by going into our Lennox Consul and run these commands to practice them. Cave your den. Let's clear our screen and see we are good of yourself and your in our directory. And of course, now you should know to type host name, and our host name is is the name off system. It's clear this the first command is who who is going to tell you which, how many people are logged in and end User I d. The terminal I D. And the time they were law then. So I have locked in and my concert my gooey. But with Colin zero and I have open up a terminal right here tells me the Pts s the terminal. So actually there and the time I opened it up if I wanted to open up another window so you do right. Click on open terminal so you'd open up another terminal. Now, when you type who it should show you three. The return mills that is owned by us. If so, what if I log in as, um Spiderman? So let's go to our party terminal and put in our I p address. I believe it's 1 80 to 1 68 $56 1 A one. It's $56 1 one. You could check that by again running the command if convicted, they said. So we'll open that now. This time you log into law Guinness Spiderman. Okay. And now it's clear this green and check. You see, we have four 123 war and the 4th 1 is used by Spiderman. So this is the main function or main purpose off the command. Who? Ah, the reason we run this command who all the time or most of the time is when there is a very high load in the system and you want to see how many people are logged into the system. Next, next command we're gonna learn is last. It's closed. The one in the back Last Command tells you all the details of every uses that been logged in from since the day once of a new type last had enter. You see, everything comes up in the screen so fast, I wanted to see one page at a time. Then how do I do that? You do last pipe it and more it. And this will tell you the last time they used the logged in his Spiderman off course. But this is the name. This is the use of that law been, and this is the time I loved. And it's telling you it is still logged in, and it tells you every user that's been logged in and every user been logged and rebooted the system and whatever happened to the system. So let's say if your system reboots or shuts down or crashes unexpectedly and you suspect someone was logged in and you want to see what time they logged in which I p. They used to log into what date and time the logged in all the information is here. If you wanted to, you have If you wanted to see the first column off your output off last, this is your last right last and you run that and you want to see only the first column, all the user names only. And what commend you would run? This is a kind of pop quiz. You do last. Pipe it on dollar one and you get the 1st 1 Now you just wanted to remove the duplicates than what do you do? You do short. That's what's so and you type unique. And then you will see only these other uses that been logged in. I've saw Reboot that. So that's also a protocol that is used to log in Spider Man. And there's another user, W T. M P. Another command that we learned as W W. Works pretty much the same as who, but it will give you a little more information than who gives you the log in time, the idle time and what this process is being run by. What user gives you a little more detail. The next one, his finger. When you run finger, um, now Finger command is the commander is that is added to your system. So it's not. It does not come with your distribution. You have to add it. It's a program. It's a very powerful program. Is it's basically does the trace off your user where coming from, what kind of particle is using? So you could you need to install that, so we will leave that out for now. The next one is I D. And you had I d e. Without the use of name, it will give you the information about your own self. Use the name, your group I D and what part of other groups you are. If you run, I d and you do Spiderman, then it will give you the information about the other users. So there you have a few commands to monitor the users. I hope you will remember them, and I hope you will practice them again. The way to practice is to run them different options. And how do you find the options is by running man and do who, and you will find different options. And I would highly urge you to please use different options just for practice
74. Talking to Users: talking to users. The users are the ones that are logged into your system, and our some of them have their applications running. Some of them have databases running those other users that log in to the clinic system, and they're often times you do need to talk to them when I say is, talk to them, not like face to face. But you do need to communicate to them that if you need to bring down your learning system or if there's a maintenance or if there any commands or any application that they're running that causing stress on the system, you do need to identify them. Command to find out is just typing uses. Then there is a command called Wall Wall is the command that is broadcast your message to everyone who is long into the linen system. And then there is a last command, which is right, right? Command is dedicated to a user, one Pacific user. It does not go out or your message does not broadcasted toe. Everyone is just one user to another, so we log into our learning system and we will try all these commands one where one by one else you will see how we could talk to other users 1/2 my limits machine up and running. And I am logged in as myself. And I could also see here I'm logged in as myself. The first command that I have is wall. So before I go into this first command Sorry. First command is user. Let's find out who is logged into the system. But what I was going to say is, before we run this command, I will log into, um, through another terminal as a different user. So to log into through another terminal, which would be the party terminal, I would need the i p address off this Lennox machine. Let's check the I P address. You guys know that, right? Yes. We could run if config And the reason I put him or I'm sure you know that, so I could see that Put one page of the time I see my I p right here is 1 90 to 1 68 1 dot Well, I will take that I, p and I will put it into my putty session when I to 1 68.1 dot 12. You hit. Enter it will prompt you for the server. Ssh. Keys that you wanted to say that you just say click? Yes. And now this time I want you to log in as a different user. The user that I created earlier I called it Spider and put in the passport for the spider. Now I'm logged in as a spider. If you logged in as yourself on your terminal, you clog out. Are you Open up another party terminal and log into a different user. And those users are the ones that we created earlier. You could pick any user. It doesn't really matter Now we will see how many users are logged into our system. The command to see is just type Sorry uses and you'll see there are three users logged in to off them are the ones sessions that are used by myself. And the 3rd 1 is the spider. Spider is the one is this one that I just loved into. Now I'm here right now in this session I am logged and has myself in this session. I've logged in a spider, So if I want to reboot this machine or I want to shut it down for some kind of maintenance . Then I have to let everyone know who is logged into my machine that you know I am shutting down this machine. So please save your work if you are, you know, editing a file, whatever that you're doing, log off the system. It's like re booted. And how do I broadcast that? Will just type the command wall I'll hit enter and to one more time If you want put a space and then you go type whatever the message that you want to type here, I'll type Please log off. This system is coming down for maintains in long this message. And once you have that, then you type control d as soon as your type control the you see on the left hand side. The message came up right away. Please log off. The system is coming down for maintenance. So this message is not on Lee directed towards Spider The use of spider it is doctor toe. Anyone who is locked inside will go to everyone's terminal. And you you see that message And now you notice you don't have a prompt. You just Ah, you're just inside of your message you simply hit. Enter. You'll get your prom back now. What if I want to write a message to a Pacific user? So in this case, who are the users right now? I see that two sessions being used by IVs all and one session is used by Spider. I want to send a message to a spider saying, Hey, spider, you are using some off. The resource is, um, through this script, are through your application. Can you please stop the application because it's causing stress on the system? These are the type of messages you have to send it to the user and you become a system administrator or you have a root privileges, so to right to use their you just simply type of right, and they use the name Spider. Then you hit. Enter as soon as you hit. Enter, you'll see on the left hand side. The spider is getting the message right away from you. I'll put Hi, Spider. You're the Web is getting bigger. Please stop spreading your web. It's just example of funny sentence. So I have written this. All had enter As soon as I hit. Enter. You'll see on the left hand side, high spider you've ever is getting bigger. Please stop spreading your Web. This message is not directed toward everyone who has longed in its on Lee going to the use of Spider. And if you see right here, it's saying message from I of salts. It means it's coming from this user from this machine. Perfect type, right? I absolved and right here I see. Okay, I'm Ron. I will try my best Thanks, Spider, and then controlled. That's it. That's how you communicate with each users, and I have communicated through. I absolved, of course. And most of the time that communication takes place through the user. Root Root is the one who sends those messages because route has three highest level off permissions higher level to reboot the system to bring it down to perform the maintenance. That's why we run these commands so again uses wall, right? You can log into three different sessions, try these command. It's gonna be fun writing back and forth. And if you have, um, if you're already in an environment where you working with the corporate, you could type these write messages to other uses just to try out just for fun.
75. User Directory Authentication: now here we will look at the Lenox account. Authentication. What? What does it really mean is that you create local accounts right on your local computer. In this case, we have our Lennix machine recreated a local accounts. We just learned that, right? So what if you have the thousands of fuses? So then how can you manage all those users? How can you change your password? So then that's the problem comes in when you have to actually add multiple uses to off course multiple servers as well. So what will happen if if a user joins a company and or a system administrator or Newser joins a company and you have to create his or her account to, let's say, 1000 servers? Are you gonna log into every server and creators user account? Well, that's not efficient. And usually the companies don't work that way, and they don't actually create user accounts, um, individually to eat server. So what they do is in Windows environment. They add some kind of directory, service or directory server where user could log in having the authentication through a difference, a room. So how it works. So let's see what type of accounts there are. So there are basically two type of accounts that you have one account that is sitting local to your machine, meaning that you created your account in the next machine by running a command user, add, and then you add it to the group or give permissions and so on. So most of the limits accounts we created locally and the reason they create most of the limits accounts because Lennox is not like a user environment where user log in and perform different tasks, it is basically used for systems, administration purposes or for to run major applications anyway. So if you need to create a local years account, we already learned that. Now the question comes in. What if you have to create a juicer, counter 10,000 different servers, then you have to have a domain or our directory accounts on a server. So how it works is you have all users account under one database. So look at this picture. So you have a client which is a server, which is your the next machine, any links machine that you have installed, and then you have another server, which is in our case. We call it a directory server. So a director server as user try to log in to the client and at the account authentication goes against the server. So the server checks to see if that account exists. And if the account exists, it will reply back, saying the user has been authenticated and it's okay for user to go ahead and log. And and that's how and a user that is created on the directory structure will log in. Now remember, this is not for those users that are created locally. This is this authentication process only works with the client and the server. So there's a server out there in Windows. There's active directory that gets authenticated, comes back, and that's how you get it authenticated. So in Windows now Windows has this product Active Directory, which is called Microsoft Active Directory, which is awesome product. It works so good it works so efficiently for the users. So how how it works is you go into the Windows Active Directory server, you create an account on the active directory and then it gets authenticated and then you go log in to the client. So now remember how this works. This goes into the server and what protocol is uses. If you need to log into server what particle you use, you use Ssh, Right. So if you want to log onto the server using active directory or some kind off ah, directly service, you will use a pearl called called L Dap. So the question is the next ESL infuses held up. Now remember, one thing, guys Elder is a it's it's a political. It's not a directory that you get authenticated for Lennox uses. A lot of people have this misconception. So please clear that misconception that L dap is not used for Lennox. L DAP is just a protocol that is used for Windows for linens or any server or any even Mac . They used this protocol to authenticate against a directory. So what does held up is so why a lot of people say is, well, l'd abuse elder for Lennox. Well, that's not a real case. So in my next lesson, I will tell you exactly the difference between LDA active directory and all other different directory servers that are out there that you could use for Lennox authentication or even for Windows indication. Not necessarily. Windows needs to use an active directory. There are other products people use so active directors, native to Windows. That's how people use it and most mostly used in a corporate environment. But in Lenox, I'm telling you again, there is no such thing called l'Abbe. People says a go ahead use Elder. No held up again. It's, Ah, protocol. You could look it up. It's called Light Way Directory. Um, assistant protocol or director? Something. Poor girl. You could look it up. So anyway said, That's a parole call that is used so I'll go over to the next lesson. I'll explain you the difference between every doctor services.
76. Difference AD, openLDAP, WinBind etc: the difference between active directory elder I. D. M. Went by and open Elder. What are all these directory services are? What are the protocols? I'm so confused. Please help me. Which director to use for my system? If I have Lennox would would use active directory where use LDA, which is not actually a director service. So a lot of people have that confusion. So I have added this lesson specifically for those people who want to learn more about directory services so I could help them, they would be able to implement in their environment. So the 1st 1 and the top one, I would say which I really like is the active directory is for Microsoft. Microsoft is the is the owner and who has build this product. When you have thousands off Windows computers, you do need accounts being vindicated against active directory server so they have implemented are built on active directory product. So why it is so important in Windows is compared to Linux. As I explained it before, Lennox is mostly used in corporate environment for only system administrators or developers , or cure people very few limited people and the users who actually need to log, and they used the application to log in. So let's look at example, for example, let's say you go to Facebook. You have your account right now. Do you think venue? Log into account, by the way. Facebook behind the scene. Running Lennox. So when you log into Facebook and you log into user, your email address your password. Do you think that account information is saved in your Lennox? No, it is saves in some kind of database and that database. It's communicating with your client with your you are decline under the side so you log in , it gets authenticated to another machine. It's not Olynyk local account. It's some kind of active directory or directive services that they are running. It gets it vindicated. And that's how you are able to log in same way in Windows, works for the active directory and juiced and built by Microsoft. Then we have I D. M. Now. OK, so active directory is used in vendors environment. What about Lennox? Well, not to worry about it. Red Hat, which is, as explained before, is a corporate level operating system enterprise level. They have to come up with something else to to maintain their users Now, M Ron, you just said there you don't really need users in Lenox. Then why do we need idea? I said that, But what about the bigger companies? What about those companies who have, like, let's say, 100 system and ministers working for them? Then of course, you want to create user accounts on a separate active directories type off way. Right? So for that red hat, build this product hall I d m. Which is also which is a nebulae shin Poor identity manager. This is, um is it available in Santo s? I think it is, but I'm not 100% sure, but I'll look it up so it is definitely available in red hat. Now also, another thing that some off the i d. I didn t manager, um, features are available in Cento Is that I know, but completely it ah complete product. I'm not 100% show and he would look it up. Go google it and see how identity manage it works. Then we have when bind. Now what is of in bind is a directory service. Is there some kind of directly out there? That's called wind bind? No. So what happened is samba. You guys probably have heard of samba, right? Samba came up with this. Ah, add on, teacher. Or you call a component in Lennox that allows the Lennox users to get authenticated against when those active directory food. What did I just say? Okay, I'll explain it in a in a simpler way. If you have active directory users and they wanted to log into Lennox machine, they cannot, because windows only talkto windows. So how can I log into Lennox machine? Well, then you need some kind off. Ah, communicator, messenger in the middle. So samba, Of course, it's open source samba created. This product will win bind, which allows Windows users or Windows active directory users to log in to Lennox machines using been bind. How does it work? You could just go into your links machine you installed, download when bind and configure it. And there are few things that you have to make changes to your machine and it will sticks are getting authenticated, too. Active directory. Is it a long process? No, it's not. If you read the documentation there so many documentation online that you could use Ah to configure your linens machine to get been buying. Working that will get authenticated for your users from actor director Microsoft. Then we have open eld up, huh? Ldf I know what is open held up. Now you guys need to make a difference between elders and open elder Once again, I'm going to say that again. L dap is a protocol again. It stands for ah, lightweight directory access protocol. But in Lennox we need some kind of open source Open elder because I d. M is a product for by red had that you need to buy. What if I don't want to buy it? What if I just wanted to test it? Then there is a protocol. Open eld up. You could simply download and install or jum install open held up. By the way, I will cower open elder installation in Lenox in my module seven because in module seven we are going to enable Lennox for Internet access And that's how we will download all the packages. Will do package management, all that stuff. So I have put this open held up a lesson in that module, So Ah, remember, if you need to come back to this lesson to relate to that module. Seven lesson. You could do that so again, going back to my point open held up is a directory services just like active directory. Just like idea. It's open source, and it is specifically used for Linux or UNIX. Type off in warm. Then we have IBM directory services. So there is, um, product by IBM. It's ah, it's their own proprietary pork product, which they sell to the customers. So if your company is looking to buy, um, or looking to implemented directory services to your environment, um, you could also look into the I p. M. I never heard. Sorry, I never used IBM before, but I heard many good things about it. So you tried. Look it up online. Also, there's another one jump cloud, which is also serves as a like a directory. As a service, you could look it up, and at the end, I put it in eld up. I am reemphasizing right here. Guys held up is not a directory services, just a protocol, so don't confuse that it stands for lightweight directory ex pro coal. If you are downloading any off the above directory, service or director structure in your Lennox or Windows, you need a protocol to communicate to it. And that protocol is called L dap. So once again, I'm gonna add that that I will be installing open held up in my module. Seven. So you could, um Right now, you could just wait on it or make a note. And once you get to module seven, then you'll see the open held up installation downloaded insulation. So anyway, hopefully this has cleared up a lot of confusion for those people who actually confusing, Um, active directory. Al's happened when buying an idea. If you have any question, of course, feel free to send me an email or message me. I'm always here to help.
77. System Utility Commands: system utility commands. These are very basic commands that are being used in Lenox environment. Some off those commands are just like and windows. We have time. You have a calendar. Now Windows is a qui environment. You could view those time and calculators and stuff like that by going to the accessories. Bunin Lennix. It's not possible. So So that's why they are commands that are being built to tell you to the date. The up time information. The host name you name about the opening system, which means where the commands are located. Their calculators. Sorry, the calendar and the B C is binary calculators. Now let's look at our Lennox machine anger on these commands one by one in Lenox Machine. When you logged into the gooey to the consul, you'll see the time here. You also have the option to go into the applications and pull up a calendar, and you see all the information that are automatically viewed. Vidal running any command. But what if you are logging in through the putty or the terminal client? And as I said before 98% of the time, you will be logging in to the party client to the terminal where you're not gonna be able to see all those qui environment. So let's look at the view through the party again. We'll put in our I p addresses 1 90 to 1 68 $56.1 a one and I remembered by now. And if you don't, you just simply go back to your consul and type. If config enter and the top right here, this is I p address you punch in that I p address right hair and click on open terminal A little pin up your log in as yourself put in the past and you are locked in. Once you clear the screen and you will see here there is nothing but the black terminal. So and you wanted to run and you wanted to find out what time is it or what dated it? It is just type date. Tell you. Today is Tuesday, March 13 the time and the seconds and Eastern Daylight Saving time and the year. So that's what the date command is used for. It's very simple, and sometimes that they commend is used to combine with the script so script will wake up checks the date and they will run. Certain scripts will cover that in our scripting session. Ah, the next one is up. Time up. Time simply tells you along. Been the system up for And how many users have been logged into the system and the load average the next one. It tells us about the host name. Uh, right here the host name. Let's move this little to the side. First name. We could go back to our council. They could do the coast name and you'll see this is the host name off our links machine. And host name is one of the important command that I would recommend you to run every time you log into the system shoe. So you would know you are not logging in to the wrong system and you're not running very critical commands on the wrong system. Clear the screen. The next one we have you name and you type you name. It would tell you it's a limits machine again. The Lennox machine. You do need to run this command because sometimes in an environmentally have Lennox you have Solaris. You have X many different links. UNIX flavours. So it's good to run your name. If you want to know more details about your name, you type you name minus a ever give you a lot more detail than just let me give you the host named the kernel version the time it was built and other architecture information. The next command we need to learn is which. Which command tells you the location off your command that you run? Let's say you run the command PWD right? Andi tells you that the command is telling you which director you are in. So where is that command located? Of course. Every command is a file itself and is located located somewhere to find out your type which pwd And it tells you this command PWD is located and Jews Erben P W d. If you wanted to know more attributes about this command, you're on ls minus l user been pwd and you will see right here. This is the script. Actually, the command itself is a script. The script itself is a text file that has been written by developers and it tells you right here it is owned by route and the group is owned by route and that These are the permissions off this file. Everybody has the right to execute it. If I take this bit out than I cannot run or nobody else can run this command. So this is what which command does? Let's clear this out. If you want to know where is date command located it. Command is also located, and use have been date. So as you can see, most of the commands are located in user. Been. Can you do ls minus l and you see whole bunch off commands. If you want to view one page at a time, you could do more. And you could see all these commands that we have their lunch of commands that Lennox has. What if I wanted to know how many total commands are in Lenox? Very simple. You do? Ls minus l. And if you remember you, Piper, you do board count minus tell. This would give me the total number of all these lines. That coming up is telling me there are 597 commands that are inside off this latest machine . Moving on. Um what if I wanted to know the calendar? If I just typed Cal, it was Give me the calendar off this month and this year. Ah, what if I wanted to know the month now when I was born? Let's say for for training I'll do Cal September 18 1977. So all types of number 99 start September, which is the month 1977 and it will give me I could look at its Sept 18 Waas Sunday so you could type any a month followed by the calendar. If you just wanted to know all the months in the year 2016. So you just have Cal to gone in 60 and I'll give you all those months, uh, starting with, of course, January ending with December. That's what the cow of command is used for. Next Commander, you have as clear this B c B. C stands for binary calculator. If you want to do the calculation, of course, you could go in here and bring the calculator, but you don't want to bring the country and going more. You are in terminal mode. So you want to use a calculator than what you do. You type again. D c it enter? No, If you wanted to plus to enter give you four. What it from 2 56 times. Greed 21. That's the answer. So this is this the basic help? Later? You could do division multiplication, anything that you want. If you want to quit out, if it just type, quit and you will be at If it's that these air fuse system utility commands, Um, and you could run that these are fun commands. Come up with the different options. Enough great, of course, to look at the options you could do man on every command and run with few options.
78. Processes and Jobs: processes and jobs. Before we get into this lesson, I want you to understand what exactly each term means in Lenox environment. Well, first, we have applications, but you are also a four to a service on application or service is like a program that runs in your computer, and then application could be anything like in Windows. You have Microsoft Word Power Point, and then it's You have programs or applications like NTP, NFS, Apache and whole bunch of different programs. So that is an application and service that runs on your computer. Then you have a script. What exactly a script is. A script is something that is written in a file and then packaged it to in a way that it will execute. So any application that is running in your computer, for example, a podgy you would have to run that as a script, and that will run in the background. So that's actually a script, and also all those different commands that we run in our Lennox environment. All of them are also refer to a script. Then we have a process. What is a process when you run an application or when you start up an application. It actually generates process. With this process, I d. Now processes could be one associated to that application, or it could be multiple processes. Then we have Damon. The demon is, I could tell you when I compare it with the process is something that continuously runs in the background or doesn't stops. So when you run a Damon, which is also process, but it keeps on running the background and it keeps listening to the incoming traffic or outgoing traffic, then there is a thread or threads. Every process could have multiple threads associated with it, an application that is running in your background. Let's say an F s. When you run that application in your next machine, it could have many multiple threats. If a machine a remote machine, tried to connect to you through an FS, it will generate one threat for it, and it will generate a second threat or third threat for other computers at attaching to it . Then we have a job. A job is something that is created by scheduler, like a work order to run those application and services in process and service commands. We have a first command this system. CTL This command is now used in Red Hat seven and it is being replaced. Sorry There. The old command that was running in all your version off Red Hat or Cento as its service service is now being replaced with a newer command system, CTL Then we have a P s command. This command allows you to see what are the process is running in your Lennox system. You could used different options with that to find out exactly the process that you are looking for. Then you have a top command. Now, when you run the top command, you will see all your processes running in your system, depending on which process you want to see first based on its load. And it also tells use your memory information, CPU information that is being used by that process. Then we have a kill command. The kill command kills the process. It kills by the process, name or kills by the process. I d. So when you start an application again going back to our example of Apache when you run an application, Http which associated with Apache it has a process. I d to it. You could stop that process by running system. CTL Stop http. D or you could simply kill followed by the process, Name or process. I d will cover kill command later in this lesson. And we have Cron Tell Cron TAP command is used to schedule these. These applications are these process or D services for you In your system, you run Cron tabs minus E to edit it and there are different options of all cover with the Krahn tab. So when that Cron tab in that, uh, process or application is scheduled in contact, that becomes a job and the last Commander will koa is act at command is just like Cron Tabs on Lee Difference between At and Cron Tap is at a schedule as one time basis or as an add a hawk process. We'll look into our Lennox machine and will go or the processes and some of those commands that's locking our screen CD check where we are. We are And what is the host Ning Good. Clear all these commands that we will be running Most of these commands need route. The village is so we could either become route on this terminal or you could use a ferry terminal, whichever the terminal that you before. For this, we will stay on the console, so become route. Okay, Um, let's clear this out. Now. System C t l is the command to start an application or stop an application. It also is the command that is used to list or sorry to enable an application to start or stop at the boot time. Meaning every time of your computer starts up, you need certain applications to run. So to start on application that, say, I wanted to start an application call NTP. NTP is a Damon that runs all the time but stands for network time protocol, which syncs your time to other clocks. So system see Thiel restart and T p d. The DVR putting into because it telling it it's a demon you had enter and you get your prom back. The reason you get your prom bags because it did start it. That and P service. Now, how do we check if that services running? You do p this and the option that I used my favorite is Hi pin or dash E f. You could use other options. Here's my ZF you hit? Enter When you hit enter, you're going to see all bunch of processes that are running in your system. Do you really want to look into all these processes? No. You are looking for only one process which you just started. So you do PS minus cf Pipe it corrupt it and t p d. And it will tell you yes, the process is running or the application is running. That's right here. You could also use the same command system CTL Status Command to view if the process is running. They're tells you right here that never time protocol. That's a service. And it's loaded and it's active and it's running. And it's running since the time and it gives you a lot of foot. Other details Now what if you wanted to stop this process, you could do a system C t ill stop anti PD and it stopped. See if it still exists. PS minus Lee, If I grew up aunty P. D. It does not exist if it doesn't exist and why we are getting this line. Well, if you pay very close attention, this is telling you that the command that you just ran PS minus e f. When you run this the Linux system, the opening system is so fast and so sure that it gets you the same command that you running. You see, it's giving you the script that I ran this group and if and descript is also considered as a process itself within itself. So that's why it's giving you. You always going to get this grip it whenever you run this gripped command. So this is about P s system CTL command. And if you want to enable an application, you could just thrown system CTL enable and t p d. And this will enable seats is created symbolic link. It has created symbolic link in in the etc configuration file. So now every time my computer, my linens machine is going to start, it will start the NTP demon with it. Another example of different process is send mail or RCIs log. Let's see horses log is another application or process their runs, which collects your locks. So let's see if it's running. Yes, you see it is running, and if you wanted to check the status, you could also do to some CTL status our CIS log and it will tell you this active. Then it is running. So that's how you find out about all the processes. Now, what if you want to kill that process? Um, sorry. Let's take one step back and we'll run. Top command Top Command is one of the favorite command for many system administrators because, um, this will tell you about the system. Resource is also one of the favourite question by an interviewer who was going to interview you. They will ask you Tell me about how do you monitor the system? This is where you could tell them. You run the top command and the top command will give you There are total number off total task 171 is running one in 69 Sleeping. What? The CPU usage Is it too high? Is a too low. What is the memory usage? What Issa Swaths based. And then right here it is listing every process that is running in our Lennox environment with the process I d. Who the user is and what is the memory being used? What is the CPI of being used? How long is it running for and What is the command association associated with that process ? So this has so much information that I cannot co were in this lecture, so I would encourage you to do is do man on it or read a lot more about it in different documentation. I will also include some documentation that will explain top command and detail. You could also feel free to Google it. You could view top, but you should spend some time quite a bit time to look into the output of this command. Now what if you wanted to get out off it? This simply type Q. Wants your type Cube. You will get your problem back Now we'll go to the command kill If you remember, we used PS minus e f to check which processes are running quip And I wanted to, uh to NTP de NTP is not running. Let's start it first. So we'll do, uh, system CTL restart or start doesn't matter. And TPD it has started. Let's check again. PS minus CF Group and TPD. It is running now. I wanted to kill this process. There are two ways to do it. One is if you do, um, system see Thiel and do stop this command. Or you could simply do kill, kill will kill the process regardless off that is gonna go down gracefully or not. So which process we gonna kill right here? This is a process I d so kill simply. 120 to seventh the process I d enter now let's verify if it killed it. Yes, See, it's gone because we are killing the process i d the same way which ever process that you have. You could just do kill a PS minus cf and then more Because you want to see all the process of tons of processes that are running on your system. Any process that is young, you could kill it. And how do you know it is hung? You could type top command and you will see here under memory or CPU if any of the processes using that's in 99% of CPU or 99% of memory. That's definitely one of the candidates to use the kill command to kill it to free up. The resource is system administrators use this commend many times to keep their system up and running and healthy. Next we will learn Cron tab. Let's exit out and we will become ourselves. Cron tab allows you to schedule. Oh, are scripts are our commands which everywhere you want to schedule. So let's say I want to schedule to create a file that has some kind of upward at a certain time. First, let's check the date. My date is Tuesday. Wash their team 12. 19. This clock is one hour off. I want to set this clock first have become route sit this clock and I'll due date minds as to set. And it will be, I think I have it said here. Yes, it will be their teen March $2.18 um, the hour time the second and hit enter and then you do date and it sets the correct eight. Now let's will go back to our self who my and we ourself play of the screen. Now let's do contact. Contact is a command self. You have to do quantum minus E to edit the content and specify whatever that you're trying to schedule. Enter the first once you run. Sorry. Once you were in contact minus e, it will bring you to a V i editor mode the same as if you're on bi. I followed by the fire lane. So you were in their head I to insert the 1st 1 is the minute. So we want to scare you something At 22 2nd 1 hour 13 then the day of the month off. Put every day which it has direct month is three, which is march. They have the vehicle do every day. Okay, so we schedule the time now. What do we want to do? We want to do Echo. This is my first Kron tab entry, and I wanted to put that to a file Cron Teoh bash file. Oh, Cron tab entry. So if you notice that the time has quickly changed already become 1 22 So I'm just gonna change 23. It escaped, right? Quit and hit. Enter. Now the time is 21. It's still have 43. So the me just took quickly to said this would be Don't lose time. Date 53. Let's say, do we have the file created yet? Yet? This is the 1st 1 I had it before. That's flying date 22. Perfect. So let's see did it created? There you go. My first file. Sorry. Not my first fire. It's my cell tr Cron tabs entry because we are doing contact unless l it created Cron tab entry in the contest entry is Cat Ron Temer's entry. This is my first Cron tap. So it did create it so But it created itself, so I schedule it. That's why it created, um to do a quick comparison off our commands that we learn with our Windows environment is the 1st 1 system CTL When you when you and your Windows environment right click on your start Task Manager. You see all these applications? These are the application you could stop and start using the system CTL in Lenox. These air the processes that run that associated with all those processes. And many of them are Damon processes like service host, host process for Windows. Many of these run as the process. These air the services that you could shut down with system CTL on the performance. Remember, we ran the top command. The top command tells you about your CPU memory. Exactly. This is what you're looking at. The when the vendors task manager on this one gives you the never accuse it and, of course, the use itself. So this is a quick comparison between Windows and Lennox, and I hope you will run all these commands one by one to learn more about them.
79. Processes, Jobs and Scheduling: Processes and jobs. Before we get into this lesson, I want you to understand what exactly each term means and Linux environment. Well, first we have applications which are also referred to as service. An application or a service is like a program that runs in your computer. And then application could be anything like in Windows, you have Microsoft, Word, PowerPoint, and Linux. You have a programs or applications like NTP, NFS, Apache, and whole bunch of different programs. So that as an application and service that runs on your computer, then you have a script. What exactly a script is? A script is something that is written in a file and then packaged it to in a way that it will execute. So any application that is running in your computer, for example, Apache, you will have to run that as a script. And I will run in the background. So that's actually a script. And also all those different commands that we run in our Linux environment. All of them are also referred to as scripts. Then we have a process. What does a process? When you run an application or a new start up an application, it actually generates process, whether it's process ID. Now processes could be one associated to that application or it could be multiple processes. Then we have daemon. The daemon is, I could tell you when I compare it with the process is something that continuously runs in the background or it doesn't stops. So when you run a daemon, which is also a process, but it keeps on running the background and it keeps listening to the incoming traffic or outgoing traffic. Then there's a thread or threads. Every process could have multiple threads associated with it. An application that is running in your background, let's say NFS. When you run that application in your Linux machine, it could have many multiple threads. If a machine or remote machine tried to connect to you through NFS, it will generate one thread for it, and it will generate a second thread or third thread for other computers that are attaching to it. Then we have what job? Our job as something that is created by scheduler, a work order to run those applications and services. In process and service commands. The first command, a system CTL. This command is now used in Red Hat and it's being replaced. Sorry, they're all command that was running an earlier version of Red Hat or cento as a service. Service is now being replaced with newer command system CTL. Then we have a ps command. This command allows you to see what are the processes running in your Linux system. You could use different options, but that to find out exactly the process that you are looking for, then you have a top command. Now when you run the top command, you will see all your processes running on your system, depending on which process you want to see first, based on its load. And it also tells you your memory information, CPU information that is being used by that process. Then we have a kill command. The kill command kills the process. It kills by the process name, or killed by the process ID. So when you start an application, again, going back to our example of Apache, when you run an application http, which are associated with the patchy, it has a process ID to it. You could start that process by running system CTL, stop HTTPD, or you could simply kill, followed by the process name or process ID. We'll cover kill command later in this lesson. Then we have crontab. Crontab command is used to schedule these these applications are these process of these services for you in your system. You will run crontab at minus e to edit it. And there are different options that we'll cover with the crontab. So when that crontab, when that process or application is scheduled in crontab, that becomes a job. And the last command that we'll cover is add. Add command is just like crontab. The only difference between add and crontab is add a schedule as one time basis or as an ad hoc process.
80. Systemctl command: Hey folks, In this video we are going to talk about system CTL command. We will run that command in our Linux environment. This command is also pronounced as system control command. It is used to start your application. So in Windows, when you have an icon, you could double-click on that icon to start that application. But in Linux, there is no GUI environment or most of the time who is not used. So then how do you start an application? You start using the system CTL command. All right, so this command is a new tool to control system services. And those system services are all Linux system services or also third party services as well. It is available in version 7 or later of Red Hat or CentOS, and it replaces an older command which is R, which was service to control the service management. All right, so let's take a look at the usage of this command. The very basic usage is running system CTL. And the options you have to give either start, stop, or status of the service name. Now, I'm going to use our firewall D, which is a pre-installed package in our Linux environment. And we will use this firewall the as an example to stop, start or manage that service. Then another example would be enable a service, meaning if you want that service or application to start, when your Linux machine starts at boot, then you want them Service to start as well. Then you could enable that service. Also, you could restart, reload that service if you are or if you have made any configuration changes and that service, then you could, after making the configuration changes, you could just go and reload or restart that service. Also system CTL, you can run with the list units. By the way, every service within the system CTL management refers to add units. So if you wanted to see what are the list of all the service or units that are available to you? Then you can run a list units and that will give you all the units that are enabled. But if you wanted to list all of the units or all of the services that are enabled or not enabled, then you run the option. All right? So when you run a list, the units, you will get an output and that output will list or in columns. First column will be unit. Second load, active sub and description. What are those? I will tell you when we'll log into the system. All right. So without any further ado, I'm going to go ahead and log into our Linux machine on logging in as myself. Let's do. Who am I? I'm logged in as myself. Which directory I'm in, I'm in my home directory, and which well as my host name, my host him in my purse, Linux, VM. So we confirmed we are in the right system where we are at this point. All right, good. So to, to manage or to run that command, you have to be root or you could be sudo command as long if you are in as sued WAR file, by the way, which is to command or how to be part of pseudo executions. That will something we'll cover later on. But for now let's become root and a password. All right, good. Clear the screen. Now run system CTL. Let's first check the status of firewall. Firewall D, which is the demon and service. All right, so when you run it, it will tell you right away that the service is loaded, meaning the configuration file of that service is loaded. The system D or system CTL and knows that it can reach its configuration file. And by the way, that's where it's getting its configuration file. And it is enabled, meaning when you start or when you restart a Linux machine, this service will be active automatically. Right now the current status is active and it's running. It's documentation can be found. Man firewall D, it's process ID right now as this state is 750, one task to see group, where are the other groups enabled for it? And this is a quick log information of that service. Now, if you want to stop that service, because simply hit up arrow key or type it again, system CTL, stop. Firewall, dot service. Okay. It is stopped. Let's check the status now if it is stop or not, so simply up arrow key and status. And right here you'll see it says the configuration file is loaded, however. The service itself is inactive, meaning it is not running good. So if I want to disable the service to start at boot time, then I have to do system CTL. Disable. Enable is to enable it to start at boot and disabled to stop and boot firewall. The right, it says it has removed all the links that are needed to have it start at boot time. Now let's check the status for Aldi. And right here you see is, you see the service configuration file is known where it is and it is disabled. Beautiful. Alright, so now let's run the next command, which is, let's say if you are, if you have made changes to configuration file, then you could use a restart or read load of the service, which will restart the service. If you wanted to know what are the list of services that are available to you, then you run system CTL, list units. So units, okay, here it will give you all the loaded and active. See right here, active service. So the first one is the unit which is the name of the service. Second one is load. Load means I have it right here. Again, whether the unit configuration file has been parsed by system D, the configuration file loaded units are kept in memory. Active, a summary state above whether the unit is active, sub, this is a lower level stay there indicates more detailed information about the unit and description. A short textual description of what the unit is or does. Alright, so this one, as I said, if you don't type dash, dash all, then it will give you all the active ones. But if you wanted to list all the system services that are enabled active or inactive, then you run less unit, dash, dash all. And it will give you a active enact a whatever the state is. It'll give you everything. See right here it says active. If you keep going down. So right here it says enacted, the service is dead. So you can make it active, you can restart the service by the way, you have all those services here. Moving on to the next one is the other command to add a service under system CTL management. Meaning if you have a third party application and you want that application or service to be managed by system CTL command. All you have to do is to create that service or junit file in a C system D system directory. And it has to be named by service, name dot service. And it has a certain pattern or format of the configuration file, which you could go in and check. Then you could also control your entire Linux system with system CTL command. Yes. How you can run system CTL power off. This willpower off your entire system just like halt. And you can also reboot your entire Linux machine by running system. So let's try the last one. System, CTL reboot, and this is going to reboot your entire machine. There you go, See it is rebooting my entire machine. So anyway, this is how you use the system CTL command to manage all the services or applications inside up your Linux machine. I'll see you in the next lecture.
81. ps command: Hey folks, In this video we are going to cover the PS command. The PS command stands for process status, and it displays all the currently running processes in your Linux system. So an example would be by just running the PS command, which will show you the processes of the current shell. So if you logged in into your Linux machine and your shell environment is Bash for example, then I will show you the process status of that shell. So when you run the ps command and the output will be enough for different columns. Been would be paired up here, process ID, TTY time and cmd. And what E stands for you have that in front of you. But let's go into our Linux machine. Run the command, run the ps command. So we are right here. Who are we logged in as we run? Who am I? Myself, which directory we are in, and which host are logged in. So we have confirmed beautiful, we know that we are now logged into the wrong machine. So that's great. Let's clear the screen. Now just simply run the ps command. And for the PS command, your own need to be root. So when you hit Enter, you'll see you get the four columns. First one is process ID. This is a unique process ID of the process that you're running. And this example, when you run ps command, the bash is your process, that is the environment that you have to log in. The second column is the TTY, which is telling you the terminal type that the user logged in to the terminal right here. It's actually the console login and that we have logged in right here in our terminal. Then we have time. This is the amount of time, I'm sorry, amount of CPU and minutes and seconds that the process has been running. And by the way, if you see right here, 0000, 0000, It means the CPU hasn't done anything to process anything or any requests from this shell. That's why you see 000, 000, 000, 000. Then the last column is the command. It is the name of the commands. If you're running ps command, let's say to get the status of your terminal, you will see that it is also getting the status of its own command because Linux is so fast that it will go and check the, all the processes running by that user and a crept or it got you the PS command itself. All right, so let's move on. The other examples of the ps command is PS II, which shows all the running processes that you have and the Linux system. Let's clear the screen and run ps minus E. And you will see all these different processes with this process ID and TTY, the terminal, the time and the commands. All these processes are running in this environment. Then you have a PS AUX, which shows all the running processes in BSD format. Now BSD is a Berkeley systems description. It is something that was used initially when the Unix was became the operating system. So anyway, Not to worry about and let's not go too much detail into BSE. Let's run PS AUX. And you will see a lot more columns now, instead of just those four columns, it also tells you the user, the username, the process ID, the CPUs usage, the memory usage, the star times stop time, and commands a lot of information. A lot of system administrator run this command as well. Then the next command, that's one of my favorite command. Every time I need to know or check the status of any process or all the process and my Linux environment, I run ps dash EF. Ef is shows all the running process and pull format listing. So if I run ps minus EF and hit Enter, you'll see it will give you all the information that you're looking for. And as I said, this is one of my favorite commands. And I've seen a lot of system administrators, engineers are used to using this command and these options it gives you the user ID paid parent ID command right here. And the time the TTI session, the session time itself. Moving on to ps minus a IU username, this command will show you all the processes by the username. So let's say if you wanted to see all the processes just by root, you will run ps minus Jiu and your type of root. And I'll give you all the processes that are being managed or running by root. If I wanted to do the same thing for myself, I'll do ps minus u. I have solved, and I'll give you all the processes that are running by my user. All right, So let's clear the screen and now let's do a quick comparison of this command in our Windows environment. So if I wanted to see all the processes running in a Windows environment will pretty much go to a task manager. Right-click and click your task manager. And right here you'll see all these processes, the, the, all the applications running. If you wanted to see all the services, all the processes that are running just like ps command or ps minus E F command. Then you'll see all these are the processes that are listed, the process ID, the description with status, and the group name. So that's how you could get the comparison. And another thing is previously we learned the system CTL command, right? So if I do system CTL status, firewall D, you will see that it's giving me the status which is active, the process ID. You could get some of the information from the ps command as well. So if I do ps minus e, f, and grep for that process ID, which is what? 750, right? So let's type 750. Oops, right here, 7500 enter. And right here it is, grepping that process. C or a wall D. This is the process. You can also do the same thing by running ps minus EF and grip for firewall D. And it will give you the same information as a pet. So you could get the information of a specific process by running system CTL. And if you do not know the name or the process name, then you could run ps command and you can specify, like let's say just fire. If you don't remember that the complete name, then you could just specifier. And it will give you all the matching services that are running in your Linux and more. I'll see you in the next lecture.
82. top command: Hey folks, let's look at one of the favorites command of a system administrator or an engineer to manage the system, which is top. Top command is used to show the Linux processes and it provides a real-time you authored a running system. This command shows the summary information of the system and the list of processes or threads which are currently managed by the Linux kernel. Now when you run the top command or when it is executed, it actually goes into an interactive mode. And you can run the commands within that interactive mode. Now if you wanted to get out of the interactive mode, then you have to hit Q on your keyboard to get out of it. Now, the usage of this command is simply by running the command top. You don't have to be a root user. But if you wanted to kill a process that is owned by root or any of the process within the interactive mode of top, then you have to be the root user. So here is a list of column that are displayed when you run the command tab. And let's go over one by one. But before we do that, let's log in or go into our Linux machine. And we will run the command top together. All right, I am already logged into the Linux machine. It's confirmed who am I, where I am and which machine I'm logged into. Beautiful but clear that. Now let's go ahead and simply run the command down. All right, so right here is the output of the command. So starting from the top, it tells you the system up time, the usual logged in and load average in terms of a minute, five minutes, and 15 minutes. Then it tells you the total number of task are running in the system. Total 193, only one or two running to see it changes. A 181 are sleeping, 0 stopped. Eurozone be zeros, Omby or zombie. Just itself means like, say, if a process has a parent process and the parent process is dead or been killed, then that child process becomes a zombie process. Then we have the CPU information of the system. Then these two last lines are about the actual physical memory and the swap, which is a virtual memory, its usage, how much freebie have, how much use, how much in buffer or cash. So this is what you have the top five rows information. Now let's get into the columns. The first column is the pediment shows the task unique process ID. So everything that you run in Linux environment has when you run application, it will generate processes or services. So basically we are looking at those processes and services through this top command. And a process ID is assigned to every process that is running or executed within a Linux. And it is just like a Windows system as well. When you run a process and Windows, Windows operating system will assign a process ID as well. Then the second column is the user who is running that process or who's running that program. Then we have p, or this field shows the scheduling priority of the process. Then N i represents a nice value of the task. So if you could see from the left-hand side, you see represents a nice value of a task. A negative value implies higher priority and positive nice value means a lower priority. And you have a virtual are the total virtual memory used by the task. So if you wanted to know specific command, a process uses your virtual machine, or sorry, of a virtual memory. It is showing right here. And this is the memory consumed by the process into RAM. This is for the shared memory that I represents the amount of shared memory using task. This single digits, this field shows a process state in the single letter form. All right, so then we have the CPU represents a CPU usage, of course, this represents the physical memory usage of that process. The time, the CPU time, that time, the same time, but reflecting more granularity through 100 of a second. So it goes deep down into the time. And the last one is the command or the process that actually running. And everything else on the left-hand side are the associated values to that process or that task. All right, so you could actually get out of this interactive mode. You see when you run it, you don't see your prompt. So if you wanted to get your prompt back, simply hit Q and you will get out of that interactive mode. All right, moving on. The other commands that we could use with the command is top minus u, I absolve, or the username. This will show task process owned by a user. So when I go to the Linux machine and a pyre on top minus u with my name. And you will see it will only show the processes that are owned by me or running button by my user. See you are here, you don't see root here. If you wanted to view the same thing for route, you could do top minus u root and you will see all the processes that are being executed by the user root. Our beautiful, moving on to the next one. When you run top, then you could press a C While you are in the interactive mode. This will show you the absolute path of that command. So let's go into our Linux machine right here. And it's clear the screen and just simply run top. And right here, when you are in an interactive mode, all you have to do is hit C on your keyboard. And you'll see right here, it is giving you the absolute path of every command or the process is running. And this will tell you where exactly it is running from. All right, so let's you out of it again and let's see what's the next one? Top press K. This will kill a process by process ID within the top session. Oh, okay, This is very good. It's so let's run top again. And let's say if I wanted to kill a process which is using up a lot of resources in my Linux environment. I could go and run the kill command, which we will cover later on. But for now, if you wanted to use it, if you wanted to kill a process right here, then all you have to do is K, hit K on this session. And then it's going to ask you what process ID do you want to kill? So I wanted to kill this, for example, this top command that I'm running, which is 52 16. So simply specify the process ID five to 16 and hit Enter and confirm, and boom, it's killed. That's why we are out of that top interactive mode. All right, moving on to the next one. You could run top and then uppercase M and P to sort all Linux running processes by memory usage. Okay, so let's do top. Now. Hit Shift M for uppercase M, and then Shift P for process. So to run or to sort all the running processes, memory use it. This is going to tell you which processes are the ones that are using most of your memory in the system. And this way you could go in, if your system is running slow, you could go in and simply kill that process. Okay, one important note is the top command refreshes the information every 30 seconds. Yes. So if you look closely, you're going to see every three seconds it refreshes the data or information that is being displayed. You could change that as well. There's a setting within that tab that you could change it to display or to refresh every 10 seconds, 15 seconds, every 1 second. Okay, so this is all about the top command. Please, please make a note of everything that we covered in the top command because you will be using this top command and every day of your life in the system administration capacity and when you are managing a Linux system because this will save you a lot of headache when you are troubleshooting issues. I'll see you in the next lecture.
83. kill command: Hey folks, In this video we are going to cover the kill command. Kill command is used to terminate process manually. It sends a signal which ultimately terminates or kills a particular process or a group or process. We use a system CTL command to stop a service. And sometimes when we are trying to stop a service that has many processes associated with it, then somehow it just wouldn't stop. In that case, the kill command comes to your rescue. You could use the kill with different options or signals to let the process know what to do. The simple usage of a kill command is kill, then option, and the process ID, yes, you need a process ID to kill a process. So the option in this case is the signal name or ID, which is a telling or asking the process what to do. And the process ID, which we already covered, is actually the process ID of the process. By the way, if you are thinking where am I going to get the process ID? Then of course you could get the process ID either by running the command top or you can run the ps minus E F command to get the process ID. And then you could use kill the option and the PID. You can actually skip the option and simply type kill and process ID, which is a default behavior, which is the signal name, sigma term, which will kill the process. All right, so moving down, kill minus L is the command that you need to get the list of all signal names or signal numbers. Yes, let's clear the screen and if we run kill minus l, you will see there are 60 for a signal names or signal num numbers. These signals once again are telling the process what do whether to restart, to stop or stop gracefully or two, just stop forcefully. They are the most commonly signals that are used by the system administrators are kill just by process ID, not specifying any signal name or similar number. Then kill minus L, which will restart a process, kill minus 2, which would interrupt from the keyboard. It is just like as if you are typing Control C to get your prom back, kill minus nine. And this is many times used by system administrator, which is forcefully killing the process. And then kill minus 15, which is killing a process gracefully. All right, before we go onto this other commands, Let's try some of the commands that you learn. So let's go back here and let's try a few of them one-by-one. So let's say if you have a process that we wanted to kill so we can check system CTL status, firewall D or firewall dot service. It is telling you that it is running and it's process ID is 750. Now you can stop this process or this service by doing system CTL, stop our wall day. But what if you try and get in, it's just not listening to you. Then what you could do is you could do kill the process ID 750. Okay. I'm getting the messaging operation now permitted. Why? Because I am not rude. Yes, let's become root as is, and enter the password. Clear the screen. And now just simply do kill. And what was the process ID? 7500 for? Firewall D hit Enter. It should be killed. Now let's check the status again. System CTL, status wall, the end right here, it's telling you it's inactive and it is that a C, You could stop it from here, or you could stop it by using the kill command. You can also do minus one or to restart that. So if I do kill, so I would need a process ID to restart, of course. So right now if I wanted to do, let's say for firewall D, I can't because that process is already. So let's start the process. Start firewall D. Okay, it has started. Let's check the status to see what is the process. Id it now it is given 6290. Let's clear the screen. 600, 900 killed minus 16290. Let's check the status. And right here it says it's running. Why? Because it's actually reloaded for you, meaning with restarted that service for you. Okay? Kill minus nine. If you are trying with just kill and process ID or kill minus 2 or something like that, or click Kill minus 15. And somehow that process is not dying, then you have to use kill minus nine forcefully. This will forcefully kill the process regardless if it is waiting on any other process. Alright, so let's use that. Let's say if I am running, let me open up another terminal. In the other terminal, I'm going to run the command sleep command. Sleep command is just a command which will run based on the specified number of seconds. So let's say if I wanted to run sleep command 450 seconds, all right, it is running. Now let's check the process by running the command ps minus EF and grep for sleep. All right, you can see I have that sleep 50 right here, and the process ID is 65 70. So I could do kill minus 965766576? Yes. Killed right away. It says completed. And if you go back to the terminal behind it, and you will see you've got your prompt back and it's telling it, it is killed. See how it works now. Now this is the actual example that you could have. You could also run the top command here. And you could see if any of your processes are running high on CPU or memory. And you cannot actually find its parent process or the main service and name of that process, then you could simply get its ID, come back to your terminal and simply type kill, followed by the process ID. Right? In the next slide, I have other similar commands that can be used. For example, kill all, this is going to kill all the process and it's all related or child processes. Then the second one is the p kill Peak Hill allows you to kill by the process name. So let's say if you do not have a process ID, then you could actually simply use peak kill to kill a process by its name. Now, as a comparison to Windows environment, if you go to task manager and right here you have process. If you want to kill it, you could just simply right-click and you could do ended task. This will kill the process or application. If you wanted to kill a specific process within that application, we could do the same thing, right-click, and you could do start or stop. So right now it is already stopped. So let's see the one that is running right here. This is one is running. You could right-click and stop. So this is as if you are trying to use the command kill and Windows environment. I'll see you in the next lecture.
84. crontab command: Hey folks, and welcome back. In this video we are going to learn crontab command. Crontab command is used to schedule tasks. So if you're a system administrator and you run certain commands almost every day and we're specific time, then you could actually go into the system, log in and run the command. But it would be a little tedious to login every day the same time to do the same thing. So why not use the crontab, which will let you schedule your task or your job and run it as a specified timings. So the usage of crontab, a very simple. You'll run crontab minus e to edit the crontab table. Anything that goes inside of the crontab, that is called table. It, because it is formatted in a way that it has columns and rows. Then you could run crontab minus L to list a crontab entries. You could do crontab minus R to remove the crontab. And the Cron d is actually the demon or the service that actually manages the scheduling. And you could actually stop and start or check the status of chron D by running our same command system, CTL status cron D. And that is to manage the chronic the service. Now when we go in to the crontab table by specifying the minus EA option, you will have to enter your entry and specific way or format because that is how it is. It is red it by the crontab, if you make a mistake, it will not execute your command for that specific time. So the very first column in your crontab entry is for the minute. And then it runs from 0 to 59. And as you know, there are 60 minutes. The second column is for our third column is for day of the month. Fourth column, month 12, 12, fifth column as day of the week. And the last column is where you specify the command that you want it to schedule. And by the way, many times when you are interviewing for Linux job, this is one of the favorite questions the interviewer will ask you. Tell me all the different columns in a crontab entry. So definitely this is something you should remember. Each and every entry and what is it for? All right, so for this purpose, what we're gonna do is we're going to create a contact entry by scheduling a task. And that's scheduling a task. And simply we will do echo command. And that echo command is two and output. This is my first crontab entry. And that I'll put a wire to direct it to a file and the file name, I would give it crontab dash entry. All right, so let's go into my Linux machine. I haven't my Linux machine right here, I'm logged in as myself host name as my personal next VM and the path or the directory data and is home, I absorb to you the screen. Now let's simply run the crontab minus e. Now, before we run into crontab viewed, we need to know the scheduling Timing that we want to specify a task. Now for this purpose, I'm not going to specify something for tomorrow and future. Since I wanted to show it to you, I will specify something that will happen in the next minute. For me to do that, I would need to find out if there's a timing that is right now. When I run the date command, it gives me the time, the date, and month. So anyway, here is the hour and minutes. So it's 16th hour, which is 04:00 PM and 18. So I will specify the timing as six, 1620. So this would give me enough time to write the crontab entry as well. So let's do Cron tab minus e. So 21 is the minute, 16 is the hour and day of the month. I wanted to let say run every day. Month. This is the month of October. Let's say I just want to run it in October, so 10 day of the week, every day, that's fine. And now the command the command is echo. This is my first crontab entry. Okay, I wanted to output to a file called crontab entry. By the way, if you notice as soon as you hit crontab e. it actually gives you the Via editing mode, same way as if you are editing a file. All right, so right, quit to save and get out. Now, let's due date. It's 16, 20, and 21 seconds. So we have about 40 seconds until we see the result, whether our schedule command ran as per the schedule. So let's clear the screen. Type the date again. 39 seconds, 20 more seconds to go. As soon as this command runs right here, it will create a crontab entry in my home directory because I did not specify the full absolute path so that it will take the default path, which is my home directory right here. All right, let's do the date again. Are right, 1620 one. Now, I should see that crontab entry in my directory. So if I do ls minus LTR, and there you go, bingo, I see my crontab entry. And let's see. Sorry, not crontab entry. I see the file that is created as part of my crontab entry. Now, if I wanted to read that file, crontab entry, you'll see this is my first client have entry and this is exactly what I specified right here. Okay, So now if you wanted to see what is in your crontab entry, you could run Cron tab minus l. And this will tell you the entry that is inside of the crontab table. Now, if I wanted to remove everything from the crontab table, I would have run the command Cron tab minus r. And now if I do Crant have minus l, you will see there is no entry in my crontab. Alright, Regarding the system, the service, you can check the status of the Cron D is system CTL status, crime D. And you will see it is up and running. Now, if I stop the service, then I would still be able to create entries in the crontab. However, it is not going to execute them because the service is not there or it's dead. So that's how you schedule your future task or repetitive task using Cron tab. I'll see you in the next lecture.
85. at command: Hey everyone. In this video we are going to learn the app command. At command is like crontab, which allows you to schedule jobs but only once. And that's the main difference between crontab and add. When the command is run, it will enter into an interactive mode. And you could get out of that mode by pressing the Control D. So just like when you enter crontab minus e, you get into interactive of EI editing mode. You specify the time and you specify the command to be scheduled. Whereas enact command, you specify the ad followed by the time or the schedule when you want to run. As soon as you hit Enter, then you enter your command. All right, So the usage of that command is simply by running the command add, followed by the hour, the minute. And if it's PM or AM, because that act command, it's smart enough to understand a lot of functionality that are used or like in regular English language dictionary. So to simply schedule a job, you could specify our minute and AM and PM. And then to check the listing or all the jobs that are in the Add Entry table you are on at Q2 list them entries. Then to remove any of the future entries from the list, you can run a at r m and the number, every entry in the table would be given or assigned a number. You can remove that by eight at RM followed by the number. Then there is a demon or just like Cron tab, there is a demon call cron D. So in AD we have a demon call at D, which actually manages that scheduling. And you could of course manage that at a disservice through the system CTL command. All right, so in this video we will create an entry by scheduling a task at, let's say, for example, for forty-five pm. And we will hit Enter and we will specify echoed. This is my first at entry, and we will output that to add dash entry file. Once I'm done, I could just simply do control D to get out of that. Now, of course, depending on what time I'm making this video, the time can differ. So let's go to my Linux machine. The very first thing to do is check the time right now. What time is it? It is 17 over 3, which is 5 5 PM. So I will schedule the job around that time. So let's do at now we need to specify the time. Now if you wanted to put PM, then there is no need to put the military time. You could simply do five like 0, sorry, five colon. And the minute now it is 003. I'll put 0 phi because by the time done, it will be 05 and PM. You could use uppercase or lowercase pm. It doesn't really matter. Hit Enter. Now it comes into interactive mode. This is where you specify echo. This is my first at entry. Okay. Close and directed to add entry file and enter and simply Control D to check which protect the entries just to add q. And you will see the entry is scheduled right here. Now, what time is it right now? It's 1704. And I have scheduled for 175. I scheduled for 505 PM, right? So what time is it going to do? It is going to run a PM. So right now is 1704. Okay, so we are good. Let's check if it is there. It's not there yet. Check the date. Okay. A few more seconds. So let's give it a few more seconds. And B should see that entry or they're scheduled running. Now if your schedule multiple jobs for future, of course you can schedule multiple onetime job, and all those jobs will be listed when you run at Q. All right. One more time. Check the date 59, we have 1 second left. All right. Now the entry should be there or the file should be there. Let's do ls minus l TR. And right here is our file beautiful and check to confirm the content we do at entry. This is the exact content we specified in our ad scheduling entry. All right, so check the to remove any of the entries. You can simply add our m. So for example, if I schedule a job, let's say six PM today, and I just want to do that. I wanna do echo world. And that's it. And out the next one, I'll do the same thing seven PM today. And here I wanted to echo. Hello, world, Control D. Now if I do add q, you will see two entries. First entry has a number for, the second entry has the number five. If I wanted to remove, for example, entry number five, I would do at RM simply 5, it is removed. Now, if I do add q, you will see it is gone. Beautiful. All right, so to check the status of the demon, you do system CTL status at D and you will see it is up and running. Again. If you stop it, Are, you could still add the entry, but it, the entry, the demon is now going to run that command at that time because your services down. All right, Very good. Now let's move on to the next slide. And there are other scheduling commands for futures that the format that I'll show you. Let's say if you want to schedule a job to run on October 16th, 2021 at 245 am. Now all you have to do is add space to 45 AM. You could have a space or no space doesn't matter. And then attend as October 16 is the month and 21 is the year. If you want to schedule a job at 04:00 PM, four days from now, you could do is simply add 04:00 PM plus four days is C. So easy in an ad reads like a regular English. All right, so next one is at now pi plus hours. I'm sure you know that scheduler job to run five hours from now? Yes. Now, what if you were to schedule something at eight AM on Sunday? You could just simply do eight AM on coming Sunday night. And the last one is, if you are to schedule a job ten AM next month, you'll do ten AM next month is just that simple. All right, very good. I hope you understand the add command. If you have more questions, if you wanted to learn more options of the add command, you can simply run man, followed by the add command and you'll get all the different options of the ad. I'll see you in the next lecture.
86. Additional Cronjobs: Hi everyone. In our previous lecture, we have learned how we could schedule jobs, tasks to cron job or agile. And we all know the agile is used for ad hoc task for one time use. And if you wanted to schedule jobs, especially repetitive job, you would use cron job or crown tab. Now, I want to cover some additional things about cron job. By default, there are four different types of cron job that is set for you. That is like out of the box, that operating system, the Linux operating system offers you. And those jobs are hourly job, daily jobs, weekly, and monthly. So anything any task that you want to run, hourly basis or weekly or monthly basis, you could do it two ways. One, you could do through the crontab minus E and specified over there. Or you could simply have the script added inside of the hourly, daily, weekly, monthly directories. Those directories are in, ETC, cron dot hourly, daily, weekly, or monthly. So you go into each of these directories and you put in your script that will run every hour or depending on how often do you want it to run and then you don't have to do anything about the crontab or anything, then the cron dot daily or hourly, depending which one you pick will do the job. Now the timing of each are set in ETC. And our cron tab, when you do cat, you will see that Anna cron tab has the timing when the daily, weekly, and monthly job will run except the hourly won the hourly one is defined, the one-time, uh, runs a defined in ETC, cron dot d 0, hourly. That's the file that defines when the hourly runs. So let me get into my Linux machine and we will see how these jobs are setup in each directory. So I have my terminal open, I am logged in as root. Now first thing I want you to do is go to CDs slash Etsy. In here. You do ls minus l cron dot an asteroid and you run. When you enter, you will see it will ever forget everything that starts with cron. So it's getting cron deny cron hourly. Sorry, right here. Directives we have is cron monthly, cron hourly. But the right way to show you is I will do is ls minus l grep for cron. So this way you will see the directories that, um, I wanted to go over four. So you see right here the cron dot daily, cron dot hourly, monthly, and weekly. And this is the crontab, the actual tab where you go in and specify manually if you don't wanna go into each daily or weekly. So let's say if I go into CD cron dot daily, and which directory I'm in, I'm in, ETC, cron dot daily to ls minus l. You will see it has three different cron, or the task, or the scripts that run daily. And these are the actual scripts that were run daily. If you have a script that you want to run daily, once a day, then you all you have to do is put your script more wood in this directory, which is cron, till. If you want to run your script hourly, then you go into one step back and you go into cry dot hourly. And then you add that into this directory. Your script moved as script into this directory. Similarly, if you wanted to add or run your script every month, then you could do cron dot monthly, go into this directory and do ls minus l. You will see there is nothing right now in that directory. So all you have to do is move your script to this directory and by default it will ruin every month. Now question is, how or when does the monthly runs or when daily runs? So that is specified in when you do cat at sea and our cron tab and hit enter. And you will see that timings that are set right here. So 15 cron dot Daly, That's the daily time. Our run, 725. It's the weekly. See period in days, 7, seventh day, days in minutes. Delays, delay minute and Java identifier. And command to this is a command it will run. So this is the timing that it is telling you. These are the timing that it will run your daily, weekly monthly jobs. Now, what about the hourly? The hourly is not specified here. To view the hourly scheduled time, you have to do cat at C and D, 0 hourly. And you will see 0 hourly scheduled to run at 01, which is 1201 at midnight every night. It runs anything that is specified in the hourly. Sorry, not midnight. That would be daily. It is scheduled to run every one minute after the hour, so it will run at 1201101201301. So every one past minute, every hour. If you define your script in the cron dot already. So anyway, this is what I wanted to cover. If you wanted to go over the cron details and you don't want to specify cron dot crontab minus E. You don't want it to right down into this cron, then you don't have to. You could simply go into each individual directory. And all you have to do is put your script end directory and let these directories or let the issue are run as they are scheduled to run.
87. Process Management: hello gain and now in this lesson, we are going to cover process management. What is a process management? Anything that has to do with the process, how we manage it, how the started, how we stop it and how we bring it in the foreground. How we bring it in the background. All that stuff is process management. Let's go over. All the commands are associated with managing processes. The 1st 1 or the set off commands that we have are putting a process in the background. So why do we need to put a process in the background? Let's talk about that first and you run a process on your terminal, meaning when you open up a council of and you open up a party terminal and you run a process on your terminal, it will run it and it will not give you your prompt back. So if you want to do certain of the task or you want to exit out of it, it will stop your process. So how do you run in the background? So the command is control Z. First you run the run, the process and type control Z it was stop the process. Then you type jobs to list what is being stopped, and then you tie BG, which is to put the process in the background. Then we have foreground. So if you are done with all other task that you're doing on your terminal and you want to bring the process that you had put in the background initially and you wanted to see the process self it, then you type F G for foreground. And that process will become live again on your concept to run a process even after you exit, meaning. If you exit or refuse, close your terminal while you're processes running. What will happen? It will stop the process it. So how do you prevent it? There's a command called No hop. It means don't send any kind off signal to stop it, to know up the process and swallowed by the sign and percent or and sign, which is on top off your number seven key on your keyboard. Another command for that is no. Help the process and redirect sign to definable and to redirect m percent one and an person again. What do we have all that stuff there? Because certain times when you run certain commands like Noah gives some kind of warning, some kind of information about the process. So you don't want to see that you want all that garbage t to go out to Definable. So Denel is kind of out playing to, ah, adore that You don't want to see the output for then to kill a process by name. You You guys already know how to kill a process by process I d right. So you kill followed by the process I d kills the process. What if you want to kill a process by its name? So let's say if you have a command if you have a process called top, right, So you you run the command top you kill. If you want to kill it by the name, you're just simply type He kill, followed by the name of the process, which is top process priority. Nice. There is a command called nice And why do we use it? Because if he wanted to privatize by different level off process meaning if a process is very important than the other, it has to be prior highs. Right? So the niceness scale goes from minus 22 19. The lower the number, the more priority that task gets Now. What do we really need to go with the priority of the task? Doesn't that processor CPU takes care of that, right? It does take care of it. But remember one thing. If you have one CPU in your computer, your laptop, it means it will process one program at a time. So think of it as a juggling. So if you have two hands and you have five bowls to throw it in the year, what will happen? Can you hold all 55 balls in your hands? No, right. So think off balls as programs that you need to process, so you would have to juggle it one after you the other. So what Nice does is nice tells hate this bowl or this process is important to me, so make sure this stays in the hand most often than any other balls. So that's what nice does. We'll talk about that when we open up our terminal session, Then how to monitor a processes by running the command top and how to list all the processes that you have running in your computer. The command is PS followed Bite, Of course. Many different options that you could use. So anyway, let's get into our lyrics machine. I haven't opened right here our consul. So I am logged in as myself. I want to become route. So the come route. Now I want to log into the pretty section as well. So this way I could run certain different programs one terminal and kill it on the other terminal. So for that to log in to the party what we need I need an I p address on my machine. The command is I p a d d r or its confed, whichever you prefer. But if you're running the latest version off Lennox, then you probably not gonna have it can fix a run. I p Command and I p address. You'll see, right here it says 19 to 1 68 56 1 a one. So go into your party terminal. I have my party terminal right here, and I'm gonna type it in my I P address, which is 1 to 1 68 50 61 1 hit. Enter log in as root. The first one's control Z. So I'm gonna run a command called sleep. Sleep is a command which will delay, uh, certain programs. Let's say if you're running a program, ABC and you wanted to run a second set of program, but you wanted to wait for 10 seconds. So you put it asleep, Command. That's what it does. It just waits for 10 seconds, and it goes to the next set of instructions. So if I type lets it if I time asleep fire, it will wait for five seconds until I got my prom back. You'll see. I'll give them a proxy. I got the prom backed by after five seconds. So that's what Slick does. Don't focus too much on sleep focused on what I'm gonna teach you about process management . So I'm gonna leverage this lesson on the command sleep so this will be easier to understand . So if I run the command sleep 100 what will happen? I will have to wait 100 seconds until I get my prom back. Right. So I wanted to run that process in the background. So I will do control Z. It has stopped the process. Now it's not running. Actually, in the background to run that in the background, you have to type the command BG, which is for background. But let's say if you if you are running multiple process and they are all of them, stopped something we're running. So the command to check what is what other process that are stopped right now. So you just typed commands jobs and you will see there is one process that thinks stopped by the command Control Z. If you want to run the process, bring it and and send it to the background, then you type B G. This will send this process in the background. See, it is running now, so when you type jobs, you'll see right here it's not Stop see it's running so but it is running in the background . You could also check by PS minus F command by typing sleep, and you will see right here sleep 100. The other sleeps 60. You could ignore that. This one's all the time. If you're running fortune machine anyway, sleep one. My 100 is still running. What if you want to bring it in the foreground to the new type F G? See, it's brought back that process in the foreground. And now you noticed I do not have my prom back. Why? Because it the process, It's still running. So what if I wanted to put it back in the background? Okay, so 100 seconds are done. I got my prom back. If I wanted to put it back in the background of that type Control Z. Okay, So now the next one we have is about know how process What is a no hope but no hub is effused. Run a process and then you close your terminal. You need this terminal. If I close it right now, that's it. If I'm running a command, sleep 100 it is gonna run or it's gonna wait for 100. If I go to my consul, it's clear the screen and I type ps minus. He f and do grab sleep well, see the sleep 100 is running, right? So if I wanted to ah, about this terminal s closest to him in a couple of times open. So if I close this and then do P s mercy of sleeps and now you will see both sleep, 100 are gone So every time you run a process, it attaches itself with that terminal. Now, how do we run a process without interrupting the process when we close a terminal? So let's go to are put decision again to run a process in the background. And but then when you closed the terminal, it won't impact it. You run no up and name of the process, which is sleep 100. Um, let's put asleep 75 just to differentiate it and 10%. So you hit, enter and you will see. Now it's running that process in the background. So when you do jobs and you'll see it is running, but it is not impacting your term, it's not attached to your terminal. So even at this time, if you close it, this process will still run. Now, what about this? No up Ignore input and a pending out but to no help that out. Well, every time you run a no hopped up, uh, no help command, it actually creates a file called No hope dot out. So what it has, it has all the information, all the things that you have type in there. It will just record everything. What if you just don't want to see that message comes up on the screen or many ties? When you run certain commands, it gives you a message that this command was created and this day and summon her stuff. So to get rid of that message, you could type no up asleep. 70 three, Mr. Differentiate again, Great and signed Stash stuff. Stash no to grid and sign and percent one and percent again hit, Enter. And now you will see you did not get all that stuff that you will get in get before because what we're saying is whatever that comes up on the screen, those are messages warning or those even information messages ascended to definable. Don't send it on the screen, so it send it in the back. Now what if you want to see what's running in the back were on jobs and you'll see this one process is running in the back in the background. Now again, what if you wanted to bring that process in the forefront in the foreground? Just type foreground and you'll see it is running and it is on the foreground and you will not get your Prabhat until it waits for 73 seconds. Once it's finished 73 seconds, then we'll get up problem back anyway. Let's control see out of it, but will completely stop because if you type jobs now, you won't see any jobs. The next lesson or sorry, the next topic off This lesson is about process priority, which means run a process with a certain priority, so you could just simply type nice space minus end and space. What's the priority? You want to give it minus 20 which is the highest one? No, I don't want to mess up my other processes in the system, so I'll just say simply say five and then I'll do sleep minus 10 I had entered. Now what is doing is it's telling CPU. Hey, CBU, I have this process. Sleep 10 and please give this process Priority five, which is not too high. Wish just not too low. It will get. Tell that to the CPU and CPU would process that according to the command off Nice. That's what nice is. If you want to run your process to be the top party, it is very important. Then I would say run nice months and minus 20 the name of the process that enter and CB will say, Hey, that said, I have nothing to do but to take care of this process right away. That's about the nice of the priority than the other ones we already covered, which is a process monitoring and, of course, the list of process to see what the process are available in the system.
88. System Monitoring Commands: system monitoring. Now we're getting deep into the system. Administration type off commands are the roles that you will be working on. If you really want to get a job and system administration, our systems engineering or Lennox related field, you do need to know all those system monitor commands. Some of them are top DF, The message i O stat Nets Dead Pre and CPU info and memory information. All these commands of list all the system resource is animals of Tell you how the systems is doing. How is it behaving whether it's running high or low. So let's look at them one by one by logging into our ranks machine log into our, um, VM Consul, the top command you could run without being route. So, um, if you notice in the top command once again it has CPU information, memory information. It tells you which process it's on, which users running on what command it's running. This is again one very powerful command, and you should really spend some time to look into every field. Andi, I will, uh, I would highly recommend you to go look for the documentation or Google it and find out more information about it if you want to get out of it. Cute. The next one we have DF DF gives you your disk petition information. You could run DF minus a man space DF, it tells you report while system disk usage Well, Ron DF again and it tells you the false system is mapped right here. It has this block. This is available. What percent is used now? The most common options that is used with DF is minus gauge. Age is easier. Is human readable. It's easy to understand. So now it tells you we have a disc size actor. Root level, which is eight gig and 3.4 giggles used and 4.6 is available and uses 43%. Also give Ian percentage. And so on is the memory, which is about two gig. And then we have a boot file system, which, when the system boots, everything is located in what to boot, which filed suit boot. Um, it has one gig and so one gig here. Eight Gig care. So nine gig and this, um, free memory, which is the swap or virtual memories about one gig that makes it 10 games. And if you remember, we created our virtual machine with 10 gig. And that's what it's telling you. The petition information, if your system is dead, has crashed. Um, one of the things you should look into it is DF minus H output once again DF minus h. And if the usage right here says 100% or any of the usage says 100% then definitely you are in trouble and you need to free up your dis space. And you need to find out how to free up this space. You need another command. That is you. Sorry, Do you? You could do man on, do you and learn more about it. It tells you the estimated file space usage. Which file is taking up all the space next command we have de message de message gives you the output off the system related warnings ever messages, failures or anything like that. And you run it? Of course. It throws a bunch off error messages, a bunch of information at you. And if you want to view that one page at a time, what do you do? You pipe it to more and you pipe it. Tomb or you will see it gives you the bios information. What? When the system initialized how it went to what? CPU. If there is any issues with the memory, it will report you right here if there is a memory leak. If there's issue with CPU, that's crashed Mother board. Issue anything related to your system, hardware will be listed here, and this is again one of the good things that you should look at if you are in system administration. If you are going for interview, the interview is gonna ask you give me the commands that use used to monitor your system. These are the commands. You shall list them right away. And I'm telling you, he or she will be impressed right away that you know your command. You know your system administration skills. The next command will learn is I o stat. I owe this stands for input and output statistics. What could what's coming in? What's going out? How we are communicating with our system, peripheral devices or system internal devices, even if it's a disk or network. When you run it, it's gonna give you the information right away that the disk is being used with the read per second right per second and a lot of different information. You could also run i o stat with space One which is telling it to refresh. Keep running it. But refresh it, everyone. Second said refresher refresher. Keep telling you, keep updating you to read and write. If it is doing any reading right, it will update it as it goes. You could quit out if it by simply typing. I think you have to do control. See to quit out of it. The next one we have Nets, stat. That's dead. Minds are envy is the option that I mostly used. If I want to find out my gateway information if I wanted to find out my subject mask and what interface it is going through, this is command apple juice. Um, there are other options that you could use with net stack just next at interview. Pipe it and you do mawr. You're gonna see a lot of information. What is connected to your system, what has been disconnected. Ah, what's the process? I d which processes it running and and the the name off the owner off the process so it does give you all the information once again, I apologize. I cannot cover every single detail. If I cover it, it's gonna take me hours and hours and days and days to do to cover every single command till I will. Um, my recommendation is to you is just so simply, man, Nets stack and you look into the description off this command and the option of this command. Now, please do remember, I've been doing the Lennox for a very long time. And trust me, I myself don't know every single options that a command has to offer. If I wanted to find out or if I wanted to look for a Pacific output, then yes, Then I will look into the options that is available. But it's completely understandable that not every person would needs to remember every command or every option associated with every command. The next command we have free free gives you the your physical memory and your swap space, which is a virtual memory utilization. Just sue usage and free. The next one we have. His cat cat is to read the file off CPU info. Every time your computer is started, it keeps all its system. Resource is information into files, and those files are located in Prak. This Prock is the directory where keeps us all system information so you could just do simply cat product info CPU and four. You will find your CPU information right here. If you want to know your memory information, you could do proxies system memory in full. Of course, it's throwing all the messages a lot. That's green multiple one chart, so you could just do simply pipe it and more it, in your view it one page at a time. So these are system monitoring commands. Um, you do need to remember these Pacific commands on top of your head if you are going for interview if you're going for a technical interview or even if you are a new to Linux environment and you want to learn more commands by monitoring the system, resource is you should look into these commands
89. System Log Monitoring: Hello and welcome to log monitoring. Lesson Another and most important way off system administration is logged. Monitors. Think of a lot of monitor in a way as if you have. If you have your person, physician or a doctor, every time you go to him, he or she has a chart on you, which the record of your medical history, which tells the doctor What are the problems you had in the past, whether you had any surgery, whether you're allergic to any medicine, said That is the way doctors keep logs on your physical health. Just like that, systems also have to keep logs and generate logs and record everything that goes on with the system. So in our log directory right here in our learning system, the primary log directory is war and slash long. All the logs that are generated on UNIX machines are mainly in warlock directory, unless specified or changed in the configuration file owner often application to change the law location. Um, a few off the logs of evil Kovar in this lesson are one number one is boot boot is the log . When your system boots up reboots, it generates this long and records everything that goes on to your system. How it cleans up the memory. What the process is starting up. If it hasn't, if it is having any issues, it will log everything in there. Then you have crony D, which is a newer version off. NTP has its own log. Cron may law secure logs. The next one we have the messages. Long messages is one of the important logs that every system in Mr uses to monitor system activities, everything that is a hardware wise application, wise or process wise, anything that has to do with the systems or even application wise, it goes into war long messages. Then at the last one we have http D, which is also an Apache application law. So without further do I log into my Lennox machine, I log it as myself. I already have an I p that I specified. Um, so once I log in, I will go into war slash log directory. When I am in slash lock directory, I could go on Ellis minus l command or simply wrong. Hell, l and you all the locks. And once again, when I run that it has so many logs, so many files, so many directories that I cannot view them all on one page. So I'll do this El Pipe it to more and you will see l l will list all the files by alphabetical orders. So the 1st 1 is our did audit Aziz. One of the files are directory that has all the other information. Then we have boot dot log. Let's look at book dot log When you do more on food, don't log. I get in message days permission denied. Why do I get that message? Because the Buddha log is owned by route and the group who owns that while is also route. So am I root. Who am I? I'm not route. OK, so if I'm not ruled to do I have the permission to read the file and as others I should have read permission right here, right last three bits. Or if I'm part of the group, I should be as you have access here. So neither group nor regular ordinary users has access. Read a file, so only root hasn't. So we will become route. Go back to our log and we'll do poop dot lock when I hit. Enter, you'll see on the left side. It is coming up with OK messages. While system is booting up every time there is an issue with the system booting up, it will come up with a message saying falls or error or alert. So you'll see. It is starting all the services one by one. It is starting all the processes. Welcome to Cento Islamic seven. It's going through each step off the spooks startup and when it starts up completely, it stops the log. When you reboot your system this file, which is let's find L Buddha log. This file gets over written, So if I reboot my machine right now, it will generate a newer file and it will rewrite the speak boot dot log. Okay, so the next one we have a Z Ronnie crony is a placement of NTP service, any type off changes that we make on the crony service. It actually generates that long and actually locks that information into the logs. Next one we have in the list is craun. If you look at it on the left hand side, I'm just going by what I have listed, there are many other files. And if you have time And if you are interested in learning all these different logs, then please be my guest. Try out every command. I'm sorry. Try of everybody and see what they are used for. Um, the next one I want to cover is the KRON, which is right here. You, whenever you're scheduled, a job or a process through a Cron tab entry, it generates some kind of activity. And that activity, that record is logged into this file so you could do Kron. And you will see all the information about the Koran. And by the way, whenever you open up a log while the first is the month, second is the date. Time the name off your host. Name the demon, which is crawling D and process. I d associated with that demon. Their user Who's running that and the command or the entry that has been associated with the Kronk moving on. Um, we have the next one we have quickly. There is a command called the message. Even you run this command. This one also gives you information about the hardware. If you do not want to run this command, you could simply to cat on the messages as well, which will give you the exact same information. The next one we have is may log. Male log has all the information about your send mill demon, which means every time you send an email out or every time in the email comes and all that activity is being recorded in this law, whenever you are troubleshooting issues with send mail service, this is one of the laws you would have to look into to see why you are where your service not able to send e mails moving on. Then we have secure log right here. Now, secure logs is the log that actually records all your logging in logging out activity. So when you doom or on secure, you'll see all the users that have been long then if they have failed logging in or if they from which machine there logging in all the information about the users. So I am. What I'm gonna do is I'm gonna do tail minus Steph now minus F is the option that will keep on sniffing the log. And every time a new record is updated to the log, that tail minus f will get that newest long at the bottom. So if I do tail minus f, um, secure and I'll keep running this command, this command is running. Now I'm gonna open up another session, another party session I have already saved. And if I log in as myself and I type in wrong password, let's say as soon as I type wrong password you see in the background, it stays right here. Failed a password for I assault. And I'm trying to log in from this machine one night, 1 61.8 If I log back in with the correct password, then I will get that additional record for my sessions in session open for user. I have solved. So this is about the secure disc, your log file and the next one is one of the most important log file that you should spend your time and is messages. Every time there's an issue with your machine, the first thing an administrator does they long into your machine and they will trace logs in messages while so you go into see you are logged and then you doom or messages. Now this file has again once again this while has all the hardware, information, all the software information, all the application information, all the processes, information everything is being logged into this log. So if I wanted to see how many lines this log file has, I could do cat messages and wc minus help will see, I have 7001 or three lines if I wanted to see if they are any error messages in this file. So the group minus I I is to ignore upper case, lower case from messages fall and you will see it actually grabbed every line inside of this log file that has a message called Error. So this way you could go in and see what's going on. Reduced system. What happened? Why it failed, what time it failed. So anyway, let's wrap up the lesson and again, spend some time in this war. Log messages go over all these log files, specifically the ones I have in this lesson and see what type of different laws there are. View them group for certain errors and get yourself familiar with them.
90. System Maintenance Commands: next lesson we have is about system maintenance commands. Maintenance commands are those that are used by system administrator to reward system, shut it down or bring it single mode or whatever the task they have to perform while others is. Other users are logged in or happen, lock off and then bring it to the single use a mode. The commands that are used to bring down Olynyk system is shut down in it now, and it has a different level off bringing the system down or rebuilding. It goes anywhere from 0 to 70 for simply shut down and six is to reboot and three is to bring it in in multi use M O. And there are many other options. Then we have a reboot command at its raids. Reboot is simply to reboot your linens machine, and then we have hauled command halt shuts down the computer, and if there are any processes that are running that needs some time to bring down other process, halt doesn't care. It just shuts down right away. It is as if you are pressing the button on your physical system, the power button and holding it, empowering it down. It's just like that. So now let's get into our Lennox lab server and you will try out few of these commands. I belong into the Lennox machine. By logging into the party. I'll open it up, log in myself and, of course who you are. You are self fish directly we are in. And which hosts are we on? Because every time you're ready to report the machine, this is definitely a command You need to run, which is host name to make sure which computer you are, on which lens machine you are. All So anyway, let's clear this screen and the first command is shut down. Of course, I don't want to shut down this machine right now because we're going to the training soldiers Quickly go through the man page of shutdown and you will see it tells you shut down halls power off reboot. The machine shutdown has different options. If you want to use thes different option with it and those options are listed as you go down. If you type shutdown minus upper case H, it will do exactly the same as if you would just type halt and people power off our for reboot age for equal into power off on this whole time specified. So you could view every single options that is available with shudder. Then we have the next one is in it, and it is assistant D service. There are different options associated with in it. Sorry with, uh, yes, but in it and those options, you could view them one by one. As a zay said, there are options 0 to 7. You could view those options and see what exactly they do. Then we have reboot. Um, reboot simply reboots your computer, shuts it down and power off and bring it back online. And the last one you have halt power off reboot hold power off. So pretty much all these commands, you could use any one of these commands except the reboot command and in it command. So let's say now we want to reboot our machine. In order to reboot your machine, you have to be route, so become route. And if I do reboot this center and you will see I have lost my putty session. And if you are logged into your consul, you'll see the system messages coming up. This system is going down, so we'll give it some time. I will. Fast forward from here. Okay, so now I got the prom back. This system has been rebooted. Like a log back in your party terminal will continue to try to connect to your system. If it's showdown, tries to connect it every second or every five second, depending on the setting that you have specified and you're putty options. So anyway, this is sweet and simple and straightforward lesson that we learn about four commands. Try them out and get familiar with it.
91. Changing hostname: changing linen system. Host Name Host Name is the name off your next machine that is assigned during the first install and often time Ah, machine is repurposed or decommissioned or use force something else Then you have to change its hose Name to change the host name The command at his use is host name C T L Dash Set dash host Name, space, new host name. This is the command. I believe there is no dash in the middle, but I'll try it out. Host names said Dash Ho's name. And, of course, the new horse Name the files that are used to save the new host name in Lenox. Seven OS version. It's etc. Host. Name the older version off Lenox, which was version six. The configuration file for host name was at Sea Sis Config and Network. So again, let's try are changing our host name off our Lennox machine in our lab in war mint on the next machine. And right now, when you type host name this is the name off our machine my first Linux os. Now I want to change this host name to a different host name because my company came up with the new standard. Now, every machine has to comply with the new standard requirement. So that's why I wanted to change it. So in order to change a host name, you have to first become root. Cause route is on Lee, the one who has the power to do that. Okay, well organised route. All right. And now I'm gonna run the command host name before I run this command. I just wanted to tell you the file that keeps your host name information is at sea. Post name It's for see when you when I can't. This father has my host name. I could go into this file directly and modify this host name and then reboot the system and at work. Or I could just simply run host name CDL Command set, host name and the new host name. So I'll put it the new host name. Um um, New York City host one, let's say, because my machine is located in New York City and it's a number one host, so I'm just, you know, making it up to comply with didn't standard my company came up with All right. Perfect. So once I have it. I run the command. It ran. So now when you do cat at sea host name, you should see the new host name there. Yes. You see that New York City host one. But when you type host name, it gives you the host name off your new machine. But if you notice here your prompt My first Lennox os has your prompt has the old horse name. Why is that? Because this shell that I'm logged into this shell has to be restarted or the whole system has to reboot in order to read the new host name that we created. So the only way to do that a simple reboot. I'll just run, reboot or another command for reboot is in its six to this time tolerant in it six and will wait for the system to come back online. Give it a couple of minutes. Got my login prompt a log in sometime. The virtual machine will take a little longer to come back online depending on your laptop speed. So I'm gonna go and right click open terminal and you'll see now it has the new host name. N Y c host one. So this is how you change the host name. Um, do you guys know how to change the host name and windows? Well, I think you might. If not, then you should look into it because as administrator, you will have to work a little bit off in the windows environment to you. Just go into your my computer, right Click on properties and change the host name. So it is simple and windows through the gooey. And Lennox is just running one command. It's simple here as well. So I'm gonna change it back to my original host name becoming route. So this will stay consistent. And this time I'll just modify that seahorse named Paul. My first Lennox Lewis, right? This is my original horseman. And then you run horse named this time it will still give you that. Because the process that does the host name changes. That process hasn't been restarted. The only way to do it is to restart like host, name the command every run before. But anyway, I'm just gonna simple go ahead and restart, reboot my computer again so the changes will take place and put my system back to my original post
92. Finding System Information: finding system information Every time you log into a Lennox machine, it is very important for everyone to know which system they're logged in. Terms off what operating system is running or what hardware it has underneath what's under the hood. There are few commands to find that out is if you cat out the etc Red had actually release file will give you the information but its opening system the unit minus a, which will also give you information about operating system and some colonel information. And the last was D M. I decode this command will also give you the information about processor memory, the hardware that's underneath the operating system. Let's look at either each of them one by one. And this time you log into our next machine toe council. Okay, let's clear this out. We are who? Um, I we are route. I want you to exit out if it and become yourself. Who? My, You're ourselves. Where are we? Home. Very create. Once inside of our Dre creep, the same listing of the files. Now, let's just make this a little bigger when you do Cat at sea. Red Hat release. This is the file. It's Ah, text file. It would tell you that we are running. Sent Os Lennox $7 4 and the update 1708 The next command we have that we're gonna learn as you name minus A This one tells you this is Lennox the host. Name off. Dull Minnix. This is the colonel. Worsen. This is a red 76 30 64 bet tells you the date and time. Um And when was the system actually was built? Is or package together and again? What's the architecture off it? It tells you all the information about the opening system and the last command is D M I D code. You will be able to run it on if you are a regular user. So see it say's permission denied. So what we do, we become fruit idea Roadless. Clear our screen. You want to have a d m I D code and enter. All right, so it through a lot of information. The screen If you notice very fast, see if you scroll up So we could I had to do the scroll up or what's the other way to do you do the M I decode Hit up barricades space, pipe it and do war cervical view the output one page at a time So he enter. And here you will see the BIOS information the virtual box What kind of computer it has underneath What's the wrong size? Um, we re created the memory information. The system information the manufacturer here, manufacturer information. Ah, baseboard information also appear we miss one thing has a serial number. The product name is virtual box. Remember, we were running on Oracle Wardrobe box that manufacturers Oracle Corporation. Chazz. He's not specified because there is no chassis and need and it's to give you some processor and some information about memory. So there you have a few three basic commands that I think a system administrator or engineer should know about which system they're locked into because the first thing every time whoever logs into the system, they should check. They should run the first commanders unit minus a which should give them the exact information about the operating system were locked in. Also, another good command is always one host name this name, and this will tell you which host name you're locked in. So the reason. I'm saying the host name is important because if you are a task to reboot a UNIX machine and your log into a different lengths machine by accident and you do Riboud the machine, then you could cause a lot of trouble. So just be careful, always log in in this type listening.
93. System Architecture: system architecture. There are two type of system. Are protectors. There are 32 bit and 64 bit, and they are depending on your CPU, the chip set that is installed inside off your computer. The chip set comes again as a 32 bit processor or 62 64 bit. The main difference between 32 64. Bed is divorced. That I highlighted in this paragraph, which say's a big difference between 32 bit processor and a 64 bit processor, is the number off calculation per second. They can perform the rest. Whatever is written, I want you to read it. But the primary difference is the one is highlighted and bold. So when you have a 32 bit system and then you have a 64 bit system, you could run 32 bit applications on a 64 bit system. However, you cannot run 64 bit applications on a 32 bit system. So when you are going on talking to your Wenders talking to your hardware manufacturers, you're gonna have to decide what kind of architecture that you want for your computer. And it also depends on the user who is requesting the compute to have the application installed on it. What kind of up? What kind of architecture they want in Lenox. The command. To find out whether it's a 32 bit system or 64 it's just by running a simple command a R C H Arc architecture in Windows, it's go to my computer right click and go to properties. You should be able to see if your computer is 32 bit or 64 so as it as an exercise for you right now. At this point, I want you to go on to your Windows machine and find out what is your architecture? What is your CPU? Chips said. Architecture is a 32 bit or is a 64 bit. I bet you most, if you will find out, find that out today. Let's run this command in our Lennox environment, and then we'll see how the upper comes out. It's all go into my Lennox lab machine. You don't have to be rude to run this command toe all simply room A R. C. H. And here it would tell you were the last two digit. It is 64 bit. You could also get this information from another command that we have learned is you name minus eight and unit minus a right here, somewhere in the middle or close to the end, you will see the architecture is showing as 64 bet operating system. The reason I have added a R C H command, which is very short, is because sometimes you do have to run certain scripts in your environment, and you need to find out information about your architecture by running simple command. So architecture is another thing that when you log into any of the machine, please run it. Tried what other architectures And also I will hire you, recommend you to go online and read a little more about the difference between 32 bit and 64 bit architectures. Thank you.
94. Terminal Ctrl Keys: terminal control keys. Several key combinations on your keyboard usually have a special effect on the terminal. Regardless, if you are logged in with the position or you logged into a terminal through within your counsel, these control which is controlled CTR is the key on your keyboard are accomplished by holding the control key while typing the second case, if you doing control, hold onto it and then type the second key. For example, control C means to hold the control key while you typed Letter C. The most common control keys are listed below that are used in the next. 1st 1 is control you, which raises everything you have typed on a command line. Control see, stops or kills a command control. Z suspends a command can control the exit from an interactive program. I will try of each of these keys one by one. Okay, we are route because we have found exit out of it. Clear it. CD. Go back to our home. Clear it again. The control key. That's it. If you were typing PS minus ear for up mark. Sorry. Um, oak print, dollar one. And you're typing a long command basically and you realize this is not the command you have to type, so you could hit back key and it'll goes a raise. Everything. One character at a time. Of course, it's gonna take a little longer. Or you could just simply type control and hit you. Ever raise everything you have typed? So that's what control you is useful. 2nd 1 is if you are in an interactive, um, program, let's say you running top. And now you see, you don't have your prompt back to get your prompt back. You could type control. See, So controlled C is one of the keys that you're gonna be using a lot more than other terminal control keys. Because every time you find yourself stuck and you cannot get out and you're not getting your prom back type control, see to get out, then you have control Z control. Z is if you are running a process and you stuck in that process, Control Z will kill that process, and it will get you out of it. In the last one, we have control de controlled the once again it does exist. You are from an interactive program as well, which is running. Let's see if you are running B C, which is a binary calculator. You plus you're doing two plus 10. Enter. You got to do quit to get out off it or you could just simply to control. The many of these interactive programs have their different ways to get out. Sometimes quit work sometimes simply key works. But control De is the one regardless off rich, interactive program. You're in that control, the will get you out. These are the few control the control keys that you should remember and Lennox environment will help here who are stuck in anywhere.
95. Terminal Commands: terminal commands. There are some terminal commands that are used to help you manage your terminal more efficiently. No number one command that I have listed here is a clear command. So clear commandment. You log into your terminal your own certain commands, you could just simply type clear to clear your screen. The next command we have is the exit command as it comment allows you to exit out of session a shell session. If you have gone into different shell terminals, you can exit out to come back to your roots sensation, or you go as it out of the terminal that you have opened up or you could exit out of user session. So if you have become a different user by switching it to s you to a different user, you could simply type exit to come. Come back to your own session, then The last one is the script. Script is very helpful. Command. It's a commander stores terminal activities in a log file that can be named by a user. You could run it and you could name anything that you want. When that name is not provided by the user than the default file name is used and that is typescript. The name of the file. So let's try all these three commands one by one in our Lennox machine. Okay, So when you run ls lt are who am I? And bunch of other stuff. Unless myself tr on the temp directory, all that stuff that comes up so you could hit, enter, enter, enter, enter to bring your clear up your screen or simply his type clear. This will clear your screen. And many times when people run scripts, the first thing they put it in the script is clear. So the so the output will clear up everything on just green and then start from a new line . Then you have the next command is exit exited simply when you type exit, it will exit out of your script if there is any script it was running before. So I'm just gonna clear that I'm gonna type exit again one more time. And there you go. It has exit out. I had a few scripts commands that were running previously. That's why I couldn't get it out earlier. But anyway, the last one got me out. I'll open up a terminal again. And this time I'm typing exit again to exit out of the terminal. So this will explain better how the exit works if you become a different user and that's a S u spider you put in the past board. Now you see you are logged in as spider. What? If you want to go back into your original session, which is I absolve you. Just type, simply exit, and you could be come back again to yourself. So this is what the exit Command is mostly used for and the last command, which I personally like, because it records everything that you do on your session. So what it does is when you run script, do you have to specify the name I will put in a transaction Or, you know what? Log file activity. Not Long and I had entered its His script started file is log dash activity dot law and that lock file is created but in the same ah directly that you are in. So and you run ls minus. Lt are. You'll see at the end it is. It has created a file called log activity. I just ran this command Ellis miner lt are this output off This command will be recorded in that. So if I go into other directors, let's say at sea slash Ah, cd, slash etc Run ls minus lt are clear My screen type history, command our type e w d. And whatever that I am doing in my session everything is recorded in my log file Right now you'll see if I do CD and if you go back to my home directory Thai pwd and I do ls minus. Lt are You see the lawful activity. The size is keep increasing because it is keep recording all the commands and all the output that's coming from those commands. So now if I wanted to be done with the script command all just simply type exit. Once I do exit, it will tell me Script done file is log while dash activity That law, it means now it is not recording anything. It has finished capturing the, uh, put off your session Now you could view it's clear the screen. You could view that log activity which is right here, and I do more on the file I had enter and you will see the first command when I ran after running the script Command was ls my cell tr It recorded the command, recorded the output off the command, keep going. And then I went to that seek of directory and I did ls my cell TRT reported everything I did see all the commands or everything that I did while I was running the commands after the script. The reason that I used the script command most of time is because when I am troubleshooting an issue or if I am creating some, uh, some tools or creating some scripts, this would record everything for me. So in case a month from now or a year from now, and I wanted to perform the same tasks, I don't have to look up the commands to execute that on the terminal. I could just simply go into my log file activity, and I will view that and remember Oh, yeah, these are the commands. Iran. Awesome. It's like a logbook recording. Ah, way. It records all your commands in a locked file
96. Recover Root Password: recovering root password. Every system administrator and his or her life faces this issue where they have to recover rule password. And why do they face? That is because they either have to comply with security standard to change. It would pass for every now and then they change it. But then they forget after a year or two. Or they fat fingered while change the root password, and now they can't recover it. So how do we change it? You have to restart your computer. Why? I could just simply type password followed by the rules and change it right? Well, no, because in order to run the command password space route, you have to be route. And to be route, you have to put in the password. It's like cash 22. So how do you solve that problem? Well, I would say it's not that simple. Why? Because you have to restart your entire computer and make sure you are in front of your computer. If you can't get Consul axis perfect. If not, then stay in front of the computer with a keyboard and monitor. Rebooted, added the group file, change the password and then rebooted again. We'll try that this procedure in our lab environment and you'll think that we don't remember root password will try to change it. Let's log into our the next machine. And this time, of course, we definitely want to go in through the council, not through the party session, because as soon as you reboot your machine, the party session will not allow you to see the reboot process. So now I have to re board. I have to run command re food. But remember one thing. I have super user rights on certain commands. That's why I was able to reboot. But if I was not able to reboot and it would have given me a message saying, You do not have permission to reboot, right? So in that case, you would have to go into a machine and type reset and then click on recent. But now, since I already rebooted, I'll go in. Here's and you have to be in this menu very quickly because it starts your computer within five seconds. So what's when you are in here? You could just select anyone. The 1st 1 is your actual operating system. 2nd 1 is just a rescue off your offering system. Select the 1st 1 Once you're selected the 1st 1 Then select E to edit it. You could also see at the bottom says press eat added the selected item. So I'm just gonna click d I'll come down to the parameters where I will C r o r o meaning read on Lee. The system mounts on the read only I want to mount the system and read Right, So I'll go to the line. You will see in a second. Where says are they'll be right here are Oh, right. So I'm gonna remove that. And I have a parameter that I'm gonna set that I haven't written. By the way, if you want to get out of this terminal type control key on the right side of your keyboard , not the left one right side to release your mouth. I have this parameters written down here that I'm gonna follow. Yes. Administrators do have to have follow some instructions. They have to write it down. Ah, good administrator. Always right down there. Troubleshooting instructions. Okay, so now I will do hard W c. My first line of my no pad ar w space in it. Equal slash cysts, root slash bin slash s h Once I have, type that in simply type control X. Remember, this is not the I that you have to use insert or any other keys of EI is just a simple typing. And once you type it, just hit control X. This will start your computer in single user mode. Okay, Now you simply type C H route. Tumultuous file system to sis route type password to change your password. All passwords had been changed. Tokens update. Perfect. Now exit out off that's cyst route that he did. We're out now. Simply do reboot and your system really whence the system comes back online, you will have the option to law again. You belong as root of yourself. And that's how you changed the root password. I want you to try it in your lab environment and pretend that you have lost your root password. And this is one of the things that you will have to face. I'm telling you, you will have to face when you become system administrator or take the job in that capacity
97. Sosreport: OK, now it's time to look at eso s report. What is S. O s report? Will S O s. It's actually unturned National code that is used by many, many people when they are in distress or they want to call out Made A So no one really knows exactly what they're really stand for. But if you like Google it or go online, you'll find that a few people says S. O s stands for, like, the save our soul or save our ship Anyway, So S O. S is something that is called when someone is in really deep trouble and needs help. So this based in the same idea Red Hat or sento, has created something called S O s report. It's a command and you run that command. It actually collects all the information about your files. Your logs put it into a package and it sends it out to them. So again, what's the purpose off this report? Collect and package diagnostic and support data. So the package name that has to be installed on your system is usually comes pre installed or pre package. When you are installing redhead or sent to us in your system and the packages S O s Dash and the version name depending on the which worsened you're running and the command that you will need toe run to collect all that data. All the files and directories is S O s report. So let's run that S o s report command and see how it works. Okay, so this is my next machine. I am locked in its myself. I want you to become route. Okay, Snow, I'm route now. Simply type eso s report. This is a command hit. Enter. It's gonna tell me the SS report version, which is 3.5 courses, changes as you upgrade or update your system. It's telling you right here this command will collect diagnostic and configuration information from this Cento Islamic system and installed application and the location off all the files that are collected or copied. Our will be under war slash temp and the file name. It will be a so s dot and so on. But the case number or the date and time also it ask you some information to confirm and press enter to continue a control, see to quit off if you do not. If you did not intend to run this command or don't want to share your configuration falls where threat had support or sento us. So you go ahead and hit. Enter and you'll see it will ask You ever prompt you to enter your first initial and last name? So put in your first initial last name then the next question is please enter the case. I d that you are generating this report for now. The case I d. Is something that is given to you when you open up a case with red hat. So you called up or you open up online. You said, Hey, I'm having issue with my system and so and so And they generate a case for you, right? So you will have to enter the case. I d here. So for this training purposes will pick on arbitrary numbers. Let's say 9000 900 hit, enter and now you will see it will collect all the configuration file that are located in slash, etc. It will collect all the logs. It will collect all the system information. So all that information has been packaged together into one fall or container, which will be a tar file, and it will be saved in your war slash temp directory. The reason we do that is because this way, the support do not have to come back to you to ask you to provide certain configuration file or some information back and forth, back and forth so they will have all that information beforehand. Before this started asking you some additional questions so you'll see. Right now it's running. It's at 72 out of 10 99 processor, so it's probably gonna take somewhere from one minute to five minutes. Of course, depending on your system. If your system is very heavy, beefed up resource is that it will take a little longer as well to give you some sometime. Okay, so the command completed successfully, and now you'll see right here. It's telling you your S. O s report has been generated and saved in a war temp, as so its report with my user, i d. And right here this is the case number that we entered. Of course, the case number will be different in your case, the date and time, and it's a tare fide and is compressed for because not that big. So what do you have to do? Is you Once you have that because you go to war Temple and then you do ls minus ltro and you'll see at the bottom this is the fall that has been generated. You could ignore the other MD 55 assists. Check some to make sure it has all the required follows that it was looking for. So once you have this while, what do you have to do now? You could just copied over to red Hat portal through FTP. If you have your communication open from your system to them or you could simply, um, ftp to your own desktop. And that's how you upload this file to. They will look at it and then they will diagnose what the issue is. So that's about S. O s report. It's very juice ful, and it's required every time you become, of course, a system administrator. You will be asked to write a report and you open about case with right
98. Environment Variable: environment variables. What are the environment? Variables. A regular definition are off the book definition of environment. Variable is an environment. Variable is a dynamic named value that can affect the way running process will behave on a computer. They are part off the environment in which a process runs. So in simple words. Environment Variables are set of definer rules and values to build an environment. So to make it more simpler, I will give you an example off in a house. We have our house, by the way. It's just a tall house. That's the only house that I could picked out from from one of the searching and that would depicts the data human bedroom anyway, So we have our house. Let's just taken example of our own house. The house that you live in that house has its own environment. What it means is it has a bedroom where you sleep. It has a dining room where you eat. Sorry, it has a kitchen where you cook in a dying where you eat and has a playroom where you play and so many different rooms for other purposes. Now those are the defined. A set of rules or, someone would say an unwritten rules. You cannot really sleep in a kitchen or you cannot really cook in the bedroom, right, because those places are built for that Pacific needs. So that's the environment off the how of your house. Similarly, and lyrics we have environment environment ing. When a user logs in, that user is given an environment by saying, Hey, your home directory. Is this your process or your show? Where you gonna run the script? Those pats ar thies This? These are the coloring you will get for all directory and listing and these air a few set of rules that you will get so they are inherit automatically through the global environment . Those environment by the user can also be changed by Pacific user as well. So to view all environment variable in Lenox environment, you have to run the command print E n. We sorry, By the way, it's not E V, and it's e n. We I should fix that. I and I will definitely will. And or you could just simply type e n we. So both commands are the same. Will give you the same results. If you want to list what is in your environment to view one Pacific environment variable. You could run a command like eco shell, so dollar shell. If you wanted to find out What is your shell? Usually the shell in the next it's given as bash um, been bash. That's a bash shell corn shell. SEASIA. Whichever your shell is. If you wanted to find out your show, you will. Pacific Lee do echo shell. If you want to find up specifically, is your your path. You'll do echo dollar path Anyway. I'll show you in a few minutes what I'm talking about to set then my mom variables on the fly, for example. You could export, um, test equal one and then do echo test. And when you type eco tests, you will get a result as one. If you want to sit the environment variable permanently, then you would have to modify that bash dot bash R C file. And there you will have to put in test equal single coat. 123 single coat. Why 123 Why not? One is just the numbers. I should have picked one anywhere to be consistent and then you type export test. But if you wanted to set the environment globally and you want to have it permanently, you have to modify the profile and Bashar see that are inside off etc. Now let me log into my limits machine and I will show you exactly what the shells are. So I am logged in and I'm logged in as myself. I of soul. And if I wanted to list the environment, I will type print E n v hit, enter and as you see it, showing me a lot of stuff and it's going straight up. I could do print environment and pipe it tome or so I could serve. You would one page at a time. And you will see you tell you my my termer, meaning the terminal that will be used to log in. That would be like a X term. My host name is my first Lennox PM This in my session i d which is automatically be assigned. This is my shell. Whenever I log in, a shell is given to me and a shell has been bashed the history size. Which is it? Whenever I Ron certain commands, those commands will be kept in history when you type history command By the way history committed something that I have covered in the later lectures. So history, command that is telling you it has to record upto 1000 line. So this is the environment. What does The S s s s h TT Why terminal that will be given What is the user? What comes in, of course, is my user. What are the different colors you see? Ls And the school colors When you run a less minus l you see a different color for directory. Different color for pile. Those are the colors you could change. Like any time. Every time you you put in a Jiff file, it will show up in the color code 01 Um, semi Colin 35. What? It really first. So I'm not sure you could google it. You will find out then going forward. What? Where my mail will go whenever someone sends me a male where it will go, it will go to ur spool male. I have solved So these air the set rules that define rules. Where's my path? Every time I run a command, the system, the operating system will go and and find the location of the the recommend. And if that location is not listed in one of these path, it will not find that command. My own bin directory will be home IVs all been my home directory. If I run, PWD would be home. I have soul the language that is set to utf Dash eight some history, history, control in my home directory My log in name I data Pat as a sage connection and couple of other things which I could go over in detail. But I don't want to take a lot of your time. So these are to set variables. That environment is given to you. You could do if you want to check which environment variable Ah, Pacific environment that you want to check, you'll do echo and you will do, for example, mail. You always have to start with dollar sign, by the way, because this way it will understand. Oh, this is a variable that I'm talking about. So all I'm trying to find out what is the path that is defined for my mail right here. You see, It says male equals war spool male. I absolve So if my shell is reading the correct environment variable I should get this back . So now if I do echo mail wash Bull male is perfect. Yes, I am getting that now If I wanted to do pass, I will do Echo dollar pat and it relist every directory where my path has defined just to like that the path is defined here. Um, if I wanted to do, um my home I will do an echo home and you will see this is my home directory right here. Home this in my home directory Also sometimes what people do it they if they are in one directory, let's say if if you are in at sea directory, you do P W d. You could simply do CD dollar home and it will take you home. Its resistance. That's how is your environment is defined as well. So if you want to set in an environment variable while you're logged into the system, let's say you want to do test equal one so you would type export test, which is variable equal one, and then you. When you do echo test a dollar test, you will see the value one. But of course, this is not permanently defined. If you log out off your system right now, this environment variable will go away. So if you want to set this environment variable permanently in your operating system, then you would have to actually v i o bash R c file. So you are in your home directory first, make sure then of a recommend that you copy your bash our sea fog, which is dot bash R c and make it bash R c dot or ridge to this way If you make a mistake, you go always You have worked back to this Now you ve i dot Bashar see and hit Enter now come all the way down and define your variable So I wanted to define my variable as test equal now This time I just wanted to 123 When you define a variable inside of the bashar see you put a coat single coat Then you hit Enter and then type export test Go ahead and save your file Now if you do test again echoed dollar test you will get one Why you getting one? Because it is still reading that export test equal one and then it is giving you that same value. You have to log out and log back in. So and for me, I could just go here and click on this little icon, appear and type in duplicate session for my party. I will do I have saw log in, hit, enter. And now when I do echo test, he will see it is giving me 123 Because this session I have a new session. And when I logged into a new session a retirement log into a new session My log in will read dot bash r c file this file and and you do ls minus l. And by that I should go up. You will see the dot Bashar C is not showing up because it is a hidden file. Any time you need to view ahead and file, you have to do ls minus. L a hit enter. And now you could go up and you will see your dot bash RC file right here. This is the one I modified. If you have modified as you could modify this file to set your environment and then make sure you log out and log back in or start a new session. If you want to have your wire meant variable take effect right away And the last one I have right here, I'll go ahead and close the session. Behind it is if I want to set globally environment permanently. Meaning? If I wanted to said Thies Environment not just for myself. A wire to set it for everyone else who logs into that system. Make sure you know what you're doing. First off also, I will not recommend you that you do it right now in your lab. However, I will explain you the files that you would need to modify. Those files are at sea profile. This is the file that you would have to modify. Or you can you have to modify at sea bash R C so you could modify these files and you will put in exactly the same way you put it in Endure dot Bashar See, But again as it said it, Please do not modify this because 11 warm and I don't want you to modify globally and it will cause problem and then you would know the route can log in or yourself cannot log in. But if you want to do it for your production wire meant or your corporate environment where you're working, I will recommend you. Do you do it in development first and then you tried in production. All right, good luck.
99. Special permissions with setuid, setgid and sticky bit: Hey folks, In this video we are going to learn the special permissions that can be set to files and directories using set UID, set group ID and sticky bit. Beyond law, permissions on a file or directory are referred to as bits. So when you do the listing of files and directories, you will see each file or directory has read, write, and executable permission. And all of them are in three different categories. The first set of bits, the three, are categorized for users, the person who's creating the file. The second one is for the group, and the third one is for others. Now, all of these are referred to as pets. And you could change these bits by running which command? Yes, By change mod command. Now there are three different additional permissions in Linux. First one is set UID. This is a bit that tells the Linux to run a program with the effective user ID of the owner instead of the executer. So for example, if you run a command as a regular user command password, you will see that command is actually being run by root because root has to update the ETC shadow file and a regular user does not have permissions to update the ETC. Shadow file. That is why that sticky bit, sorry that set UID is assigned to that program. Similarly, there's another one, set group ID, which tells the Linux to run a program but effective group ID of the owner instead of the executed. And the examples of couple of commands, our locate or wall command. If you do ls minus l on located or wall, you will see those bits assigned to these programs. Please note, these bits are present for only files which have executable permissions. And remember one thing, these set UID, set group ID, these are not the actual command that you would run it to set these bits, you will run the same command change mod to set the UID and group ID. Then the third one is sticky bit. This is a bit set on files and directories that allows only the owner or root to delete those files or directories. I moving on to assign special permissions at a user level. You could do change mod user plus S. This is to set user ID of a program to assign special permissions. At a group level, you would do the same thing, Change MOD, but use g plus S and the program to remove these special permissions at a user or group level, you will use minus sign at you or groups, or minus sign at the group to remove these set UID and the set group ID. To find all executable and Lenox set UID and set group ID permission. You can run the command find slash, slash 6 thousand dash type f. So let's go into our Linux machine. And I am logged in as myself. I am in my house to enrich directory I men, we have confirmed that. Now if I do which password, this is the command. You will see it is located in slash user bin directory. So when you do ls minus l slash users slash bin slash password, you will see that right here. You see this little S right here which is assigned at the user level. This is the set UID that is assigned to this command. So if you are running a command as I absolve, for example, if I run password command, it is running. Now. I'm going to open up another terminal in the background right here. And now, if I check the process of password command, you will see it is being run by root right here. By the way, the last one, you could just ignore it just for the color, but you'll see it is running by root. Even though it is run by a saw. That's why we set these set UID for users so it could run by the user who owns that command. All right, so I'm going to just do Control D out of it, Control C out of it, so I could stop the program. Now, if I wanted to find all the commands in Linux system that are set with these special permissions. I could become root. And I could do find slash, dash, perm, slash 6 thousand. These are the permissions, type f. This is just a command we'll run and it will give you all these commands in Linux that had the set UID and set group ID if you pick anyone. So let's say ls minus l and u du user then locate, you'll see right here this bet set to S, which is set as the, at the group level. Alright, moving on. So one more thing please note, very important, these bits work on C programming executables, not on Bash shell scripts. So if you, if you are creating a Bash shell script, these bits will not work on them. They will only work any program that is being written in C or C plus plus languages. All right, Now let's talk about the sticky bit is assigned to the last bit of permissions. So here we have our bits, read, write, execute. And you'll see the last one. See right here, t, that is the sticky bit assigned to that file or a directory. Now why do we need to assign the sticky bit? So for that, we will take an example of art slash temp directory. In our temp directory, if you do ls minus l on tmp, you will see there is a sticky bit assigned to it. So let's go to our Linux machine again. And let's clear the screen and we'll go into the temp direct, sorry, we go into the CD slash directory and we'll do ls minus l. And right here you will notice for you I hit this T. This T means there's a sticky bit assigned to temp directory because everyone, any user in Linux system can write to this directory, but that user, even though the user has the right permissions, cannot delete that directory. This is a way to protect that directory for accidental deletion from the system. All right, so let's do some lab exercise to go over are sticky bits. So first thing first will become root. So I already have a root right here. I'm logged in as root. Who am? I am root. I'm going to go into slash directory, and I'm going to create a directory MKDIR. And we created all in one. Move this a little to the right, you'll see right here. Hit Enter this, confirm the directories there. Yes, that directory is here. The next thing is assigned or read, write, and execute permission to that directory. Okay, to do that, we have to do Change MOD 777, flesh all in one directory. Now this directory should have read, write, and executable at all levels. Let's confirm that ls minus LTR. And you will see this has all the permissions that needs. Now become I assault and create a tree inside of that all in one directory. So I'll go into that. And I am logged in here as I have solved. So I'll go into all in one directory. And here I will create a directory called Enron DIR. That's my directory. All right, very good. Now, give all the permissions to that directory. So I'm giving permission to that directory, Change MOD 7, 7, 7 MRI directory. It means anyone can come in and write or create files or directories inside of this directory. Okay, now, next step is create three files in that directory. Okay, we'll create, let's go into the directory first and will create three files, a, B, and C. Let's verify those files are created. Beautiful. Yes, they are created. Now let's go into the next step, open another terminal and login as Spider-Man. Okay, So I have a terminal open right here. I'm logged in here as root. Okay, I'm Bill, become Spider Man. Spider-man. It's a user account that's been created on this Linux machine. If you do not have that account, you could go ahead and create it now. But I'm sure you have that account. Let's becomes bitumen. Let's confirm if you are logged in as I remember running, Who am I? Yes, we are. Now and the next step is go to all in one directory and delete Enron directory. Okay, so let's go into, sorry, right here, I'm Spider-Man right here, slash all in one directory. And I'm going to delete, remove our F MRI directory. Boehm, see it's gone. Now. Maybe the Spider Man did now want to delete that and accidentally deleted that. Now how do we avoid this to happen? Now for that, we had to, as I'm saying, you will see the directory, delete it. So now become root again and assign sticky bit too that all N1. Okay, great, Here I am who I am, my items by Roman. Let's exit out. And now who am I? I am Groot. Now go to slash directory, find out where that all in one. It's right here all the way at the bottom. Now we're going to assign the sticky bit to it. And to do that, we have to do change mod. And to assign a sticky bit, you have to run plus t simply that plus t two all in one. That's where if I, the sticky bit has assigned. Yes, we have verified. See right here this little t. This shows that it has to keep it assign. Beautiful. Moving on. Now become ions all and create a directory again in the same directory. And we will change MOD 2, 7, 7, 7 and create those three files. All right, so we'll go here. And first of all, we'll make sure we are logged in as I absolve, great. And we'll go into all in one directory. Here. I will create, make directory Enron DIR. I will change the permission to have all the rights executables are reading permissions to that directory. Beautiful. Let's confirm that. Yes. Now let's create three files inside of this. Let's go into the directory touch a, b, and c. Three files are created beautiful. Now let's go to the next step. Becomes Spider-Man user again. And now let's see if he could delete that directory. Since now it has the sticky bit aside. Here we are, we are root. Let's exit out of root. And now, sorry, let's become Spider-Man. So Spider Man. And to the password, beautiful. Now let's go to all in one directory. And this one has a directory called Enron directory that I created as myself. Now Let's see me as a Spider-Man at this time, if I could delete that directory, our F Enron directory, bone, see, it says operation permitted. That's why you actually assign the permissions. So if you do cd dot dot goal one step back and address my asset, even though you have given all the rights, read, write, execute subtables to this directory all in one. But anyone who tries to delete the contents inside of this directory, it will not be permitted. Why? Because we have assigned this sticky bit to it. That's the advantage of having a sticky bit. I'll see you in the next lecture.
100. WELCOME TO MODULE 6:
101. What is Kernel: the next Colonel. Do you know there is a kernel in every Lennox distribution or UNIX distribution? What, exactly a colonel is? It actually interfaces between your hardware and your software. So let's look at this diagram. Here, you will see you have at the bottom is the hardware and what others? Hardware hardware is like CPU memory, hard disk and any, um, outside hardware peripheral devices. Then you have Colonel. A kernel is a program that is stored inside off your operating system. It's like a program, a command that keeps on running. And what it does is it takes the commands from shell and shell. What is a shell shell? Is anything like a gooey Davey having windows or a gui in Lennox? Or if you don't have going Lennox, we have terminal that runs bash shell or sea shell, which will cover later on. So when we are in that bash of seashell terminal environment, the execute commands. The commands are being forwarded to a colonel, and it's kernels responsibility to talk to the hardware that's inside off your computer, and then you on top of that, you have a browser, send mail, all the application that we're only calculator, calendar office or any limits related applications. And, of course, on top of that is are the users and that is you. So Shell and Colonel together, that's offer built together in one package, and that is called operating system. And that operating system is any operating system like Lennox, UNIX, Mac or Windows. Every operating system has that little program that actually talks to your hardware and anything that is a shell, which is written in C programming languages. Well, that shell or that those applications are actually the software. So this is what the real colonel means, and we really need a colonel in any operating system to talkto our hardware.
102. What is Shell: shelter. What is a show in this lesson will cover about Shell Hollow shell works and how you grown command within the shelf or how the environment it's set up in a show. So what exactly is a show show is like a container like you know, you have, like a top aware in your home or any kind of containers that holds your environmental information inside off it, it's interfaces between users and colonels or offering systems. So you have built an operating system, and then it is provided a platform you to execute commands again. Ghulam Windows is one of the platform and and now have been is offering system. When you start up a gooey, you execute commands by running. But double clicking on a program so that go into face is your shell. In Lenox. When you don't have a gooey, you are given a terminal show or cli command that is your show. To find your show, you could Aronica man like eco dollars, dollar and zero that would tell you what shell you are in. And you could also get a listing off all your shells in your Lennox distribution by running the command cat at sea shells. Your shell is also inside off, etc. Password that is defined inside off the file you and windows. Gooey is a shell in Lenox, Katie Eglise a shell and let S h which is shelled Bash sector. All these are the show that is provided to a user again. We're looking at this diagram again, and we are second from the top. You'll see the application that talks to the shell and then shell talks to Colonel and Colonel is the one that is telling hardware what to do. Let's look, look at our Lennox machine and we'll see how we could find our show. Open up a terminal real quick and when you do cat. So when you do echo dollar zero, it tells you you are in bash So you could look at the available shell that is installed in your distribution by doing cat at sea shells and tell you all the shows that are available . And when you look at Etc Password, cat, that seat password and you'll see in my user name, which is right here. It tells the shell is all the way at the end that I have a defined show, which has been bashed. I could change the show if I want to tow a different show, but I try to keep it consistent with other users so that what the shell does, and we'll cover the later in the later lessons how we could talk to Shell to create scripts and other things to automate our tasks.
103. Type of Shells: Now let's talk about the different type off the Lennox shells that are available to us in our Lennox environment. When we have a Lennox machine running, what are the different shells of he could take advantage off? The 1st 1 is genome. If you don't know what genome is. Actually, genome is like a graphical environment that is in Lenox. Now. You must be thinking home isn't Lennox command line interface. It is most of the time, but there are people who actually install Lennox with the gooey and the gooey. While you were installing the gui or while you're going through the installation, you have the option to install Gui as well. And the two options that you have for Gui is genome, and the 2nd 1 is K D E. Both of these are the desktop gui environment, and they are the shells. So you log into those environment you are in the shell and then you run command. How you execute commands you to execute to your keyboard and through your mouse you click click, click, drag drop here and there. That's how the interact with the operating system through that show. Now, of course, let's go back to our main topic, which is the command line Chills. Now the command line shows the main one is shell is just s h shell. Of course, this is we are now talking about when we do not have a gooey We are in a command line and now we need to use a show. When you use the logs in, um, a user is given a shell a platform to work. That platform is assigned to the user when when the user account is created. So as I mentioned before, if you go toe etc pass where you will see or shell. So if you are, let's suppose are given bash shell by default and you want to switch to S h. You could do that by going to a different shell. How do you How can you do that? We'll cover that later. So show this just s h is a born show Call Sh r s H is one of the original in eggshells. It is developed by UNIX computers by Stephan Born. His name was actually born. That's why they picked the name born shell from he worked for AT and T Bell Labs in 1977. Those are one of the oldest days when actually Lennox wars or UNIX was being developed. It's a long history of use of means. Many software developers are familiar with it. It offers features such as input and output redirection shell scripting with string integer variables and condition testing and looping. And so many of the things which, of course, don't worry about it. All those the heavy words will cover them later in the lessons. Then we have Bash Bash. What is it now? The popularity off shell which was S h was so so much that you know, it made it. It actually motivated programmers who actually developed the results show that was compatible with it but with the several and has men. They added so many things to it. Lennox system still all for shell scripts. They came out with bash so they still have show. But now they came up national. What bash means it means born again shell. So if the shelves still exists and we're don't think that shell S H is gone now the newer shell is available, which is called Born Again shell. And in our entire course we will be using Born Again Shell. Why? Because it has a lot of enhanced features, and it is very user friendly. So maney, um, features of variables that we could use in that show. Then what? What their other shells there is. Seashell and T C. Shell developers have written large part of slings operating systems in C and C plus plus language is right, you know that using cease in Texas, a model Bill Joy, who was at Berkeley University, developed the seashell in, ah, believe 1977 or 78 then Ken Ken Greer. I think that was his last name. Working at Mellon University took seashell concept as a step forward, and when it took several what did he do? He came home to the New York show, which was T. C Shell and based on your system directory structure and follows. T. Shell does not run bash scripts. Eso If you are in a T shell and you want to run bash, it's not going to run it anyway. Most of the people don't you seashell and T shells, unless you really are proficient in C and C plus plus programming language. So my advice to you. You could stay away from it. If you are a beginner not to worry about these, then the last one we have is corn shell or K Shal David corn. OK, see, that's the name. So that's why the people came out with these shelves because they associate ID the name with it. So the person who came up with a corn shell his name was David Corn. He developed a corn shell on dumb. It was about the time like T. C. C. Shell was introduced. So corn shell is compatible with shell and bash l as well. Now core social improves on boring shelled by adding floating point thematic job control and so many of the things I don't want to confuse you right now. Um, in June, X environment most of time. Corn shell is used in Solaris where, as in Lenox environment most of the time, a bash Ellis used, as I mentioned again, If you need to know the list of shells that you have installed in your system, all you have to do is go into you, log into your linens machine and type cat s sea shells, and you will see all the list of shells. So this is what I wanted to cover. And I want you to be aware, these other different type of shells if you are creating a shell script and you need to get help on creating a shelves that, let's say, if you google it, maybe you will find some off the information or some of the US ah, scripting syntax in bash and some off them in corn shell. So you have to be very careful. They're probably not gonna work on one another. That's why you need to know the difference off different shells.
104. Shell Scripting: shell scripting, Let's get into some fun. Yes, everyone, that's it's time to get into some fun, very going to create our own scripts, our own commands to run and automate tasks. So what is a shell script? So basically a shell script is an execute herbal file containing multiple shell commands that are executed sequentially. So and every time you create a shell and you create, you have a first command, followed by 2nd 3rd and fourth. Always the first command will be executed, followed by the second and third and so on. So the file off a shell contains the first thing. The first line is the shell itself always defined the shell with pound bank slash bin slash bash In Lenox. Most of the time, the exclamation point is referred to as bank. So the first line off a shell script is always start with the shell. It's gonna run in most of the scripts. Every will cover are all gonna be and back scripting. Then we inside off a shell script. We also have comments where you could tell what this command or what this script does. Every time you put comments, we always start with hash pound sign followed by all the comments everyone to add. Then we have commands. Of course. What, exactly you want the script to do. And then we also have the statements which will tell the script if then while or do a four loop or all those different conditions that we will cover one by one. And those are different. Shell script ing's a shell script should have execute herbal permission. What? It means that when you created a script, of course, a script is just an empty file. Everything in linen are is just filed a flat file until you change it to an execute herbal or link or just a flat file. So if you go back, Teoh ah, execute herbal permission. Um, learning that you had jewels, remember that the third bit in a file is always execute Herbal, which is X and on the group is X and on the others as X. So, in order for a script to run, it has to has this X bit on it. A shell script has to be called from absolute path. It always has your harvest have to define the complete path off the shell, meaning in this case like home, your user directory and the name of the script. If it is not in absolute path, you could still run it. If you are in the current location, that you all have to do is put a dot, slash and the name off your script.
105. Basic Shell Scripts: shell scripts and basic shows scripts, and that is fun, fun and nothing but the fund. That's where we're gonna actually do, right? The shell scripts. And we're gonna run very small share script to get you started. And you will have your own little shell script on little commands that you go run some of the shell script that ricotta is, uh, like out putting to the screen. Using eco command, we could create tasks such as telling, what is your i d? Your current locations of files and directories and some of your system information. Another way we could creative a script that will create your files or directors for you. And then we could also dio output to a file within your script. And we could use some off the text processor through scripts and some of those those text processes are like cut off, grew up sword unique. All those different type of commands that we run on a daily basis. We could automate them to see our to get our desire result. So I'm gonna get into my lyrics machine. I'm gonna find out the I P address on my machine, which is one I to 1 68 56 1 a one. And I'm gonna log in through a party session, which I already have safe. I could also type it in. Once I'm in. I could just simply log in and I could minimize this, and I could focus on my putty session. Okay. In putty session, the first thing we're gonna do is create a directory in our home directory. So are we in our home directory? Let's check PWD. It tells us we are in our home directory, so I'm gonna create a direct G, but didn't my home directory, and I'm gonna call it my scripts, and then I'm gonna go into my script. But first, let's verify if it created. Yes, it did. And then I'm gonna go into my script called Mice. Crips. What's inside? Of course, there's nothing inside. I haven't created any fault. So now I want to create a foot script. The first grip is to create his weather. You could touch a file and then v i. But since we have to write a script, we always started the I and I wanted to do. I wanted to specify the name that would be output. I'll put screen just that or any name that you decide to pick and you had enter. It will bring you to the V I mode you had I to insert. And if it is a script, you always start with hash bang slash been bash. This is defining that. You gonna run the script under bash Shell environment. Now what do we want it to do? Is rewired to display something on the screen. So to display something on the screen, you corona command, go and then you could type hello, world. And once you're done, you could just simply escape and right, Quit out of this file and the file is created. You could verify that it has a content that you just added by doing cat output. And it tells you that it does have all those contents that you put it inside off this file . Now, can I run this file by doing Ellis by doing dot, slash output screen? No, I can, because it's not even telling me that there is anything that exists like that. And it's selling me. It's permission denied. Why? Because we do not have execute herbal permissions to our output. Dax Green fall. So we have to give it executed Permission to all execute. I'll put screen and now do ls minus ntr. And you will see It also has shamed the color. And it has given execute herbal right to everyone. Now, if you run this command, you gonna see always run the command. If you are already inside of the directory, you could run the command by dot, slash and output and you run it. It gives you Hello, world. Hello, world. This is your first script. And if you have this, if you have created this grip I'm telling you, you are already at the initial stage off being a programmer. So pat yourself in the back and you should be proud that you could write a script and you could execute it. And it works perfectly. So this is one of the scripts that we did. Oh, by the way, we could also run the script from absolute Path, which is home. I have solved my scripts and output. Now, in this case, we don't need dot slash We could just run the script from its absolute path and it will give us the same output. Now, I also have some off the scripts that is saved or written in my word, Pat, I'm gonna bring that up, and I'm gonna review them to tell you how we could list the command so I could have simply copy and paste. So here's another script that will run commands for me. So I'm gonna do V. I run commands is just a name that I'm picking for a file. Once I do that, I hit, I insert, I go here, copy this, and I'm gonna pace that here. So what? It does the 1st 1 as you you should already know defines which shell you are in. You are in been bash. And that's where the script is gonna run. The next one tells you the description off this script. This defines small tasks, so I'm gonna run small task is distinct. Ah, Comment. If I wanted to write another comment is I could do this script is written by Imron absolute or goes to safe, uh, date that was written in 2018. First thing that the script is doing is doing Who am I? Who am I? Is a command that tells you who you are. Then it's running. Echo what Echo is doing at this point? It's only gonna give a break inside off your script. It's gonna give you a space. When you run this command, you're going to see the output has a space. Then the next command is going to run his P W d. Next command is gonna run. Host name next command. Is it gonna run? Is ls minus. Lt are. And now, at the end, let's to run the script. Save it. So run commands What? I cannot run it. Why? Again? I do not have executed herbal commissions, so I'm gonna assign execute permission. I'm well verified. Yes. No, I have it. Run. Come in. They're Ugo. Remember? The 1st 1 was, um I tells me my user name. Restore a tree. I'm in this a directory and host named. This is my host name. And unless my SLT are the number of files I have inside and the reason I put an echo in the middle so I could have these spaces, the empty lines, it will be easier for me to read it. So that's about getting the task done on our shell scripting using our show scripting Another way I'm gonna call one more script is to define variables. When you defined variables, it will run those variables to whatever the values I have defined. So I'm gonna create another script called the I Very Able Command again. It's just name of the file that I'm picking. I'm gonna going to insert mode. I'm gonna copy this. Then I'm gonna paste it inside. Okay, let's look at it. What? This come Script is doing the first. The first line of the scripts is basically again defining the shell. 2nd 1 is telling me what the script does now. This was selling me Eight is for Imron. B is for absolute C is for the next class Now it will echo is my first name is dollar A So what is dollar a right here? Variable imron, then echo. My surname is dollar be. What is Ellerbee right here is defined very about Absolute And the 3rd 1 is my surname is C Sorry I should change my surname to my class Is dollar see? And what is that? Next class. So now let's run this command. Save it And again don't forget to change the permissions to execute herbal and let's run variable command. It say's My first name is Imron. My surname is F salt, and my class is it didn't tell me the class. Why? Because, let's say says Line six class, this command now found what's inside of this. Let's look at the file. Why it didn't like it. Um, my class is Lennox class. It should say that. But if it is not good, let's try to get rid off these coats and then run it. My class is still didn't run. Let's try again. See, my class is because since I have a space, um, it's not liking it. Ah, let's see why my class is dollar see? Should have. Let's try a single coat and let's see if it works. Yep, There you go. It works. So this double code doesn't work. Single coat does. You might have to troubleshoot a little bit while you are creating your script. So I'm glad I have this problem. So this way you will know exactly when you when your script doesn't run how you could troubleshoot. You could tell by the error, and you could tell by the line that it would tell you exactly. Your script did not run because it has an error in Line six and the Line Six Wars. 123456 So that's how the shell scripting works. And I really hope by now you have created three scripts, and I really encourage you to go online. Find Shell Bish basic scripts that you could use and run in your environment and see how it works.
106. Input and Output of Script: Input and output. This lesson is about writing a script where the script will wait for the user input. So when you run the script, the script will wait for it, for you to type in something. So it would take your command and then output based on that written statement that you have given to the script. So the way it works is that things are the scripting commands that you need to use for that is read, which will wait for your input and the output would be echo. So whatever that you input, it will output to the screen using the echo command. So let me look into the machine and I will show you how this could be done before I confuse you more. So I have my machine open right here and I am in my home, I observe my scripts directory. I am going to create a script call and put script just like that. And I'm gonna go ahead and hit will define the variable. Next thing is, you know, you put the author, I'm not going to just wait time and date, description and so on. Anyway. So you, you you should type everything. I would definitely recommend you. So Again, since we don't have time, I really want you to learn fast, so don't worry about it at this point. Then you you put in like Echo. Hello. Hello. Mine name. Having a bad time typing. Okay, so hello, my name is Ron epsilon, and as you know, it will just simply display that line on the screen. Now, what are we going to do next? Then? We want to do 30x. No, sorry. Put echo just for empty line and then echo. What is your name? So now we are asking the user for user input. And the way the script is going to wait for the user input is by simply the command read. The read is actual command in Unix or Linux that we'll wait for the user input. Now, you have to define a variable to read. So any variable, anything that user types will be automatically added to the variable. And what is that variable? Well, you have to specify are defined that variable, let's say a pick any variable, let's say even I picked name. So we'll say, you know what? When user put in the name. Put in, put that input into a container, into a variable, and that variable name is actually name. I'll just, you know, in simple words, name, container. So make it easy so you don't, you are not confused with name name itself. Now, once the user provides that information, then simply put in an empty line and then do echo. Hello. And now you put dollar name, container, which ever the variable you define here. Hit enter and echo. And that's pretty much it. Let's give it proper permissions. Proper permissions are there, let's run it. Okay, you see the first line on the screen is hello, my name is Ron absolute or your name. And now it's asking you what is your name? So it's weighting. See, you didn't get the prompt back. Why? Because the script is waiting for your input. So let's say you wanted to type something, let's say Jerry Seinfeld. And now you hit Enter and it's gonna say Hello Jerry Seinfeld. That's how the input and output script works. Of course, it gets a little bit more complicated as we go on. But basically, if you wanted to write a script and you wanted to take the input of the user, you have to use a read command. Now, let's edit the same script, add few more things in the script and may make it more professional. Let's see. Vi, input script. And now I wanted to define variable. So I'll say the variable, let's say a equal host name. And you know, host name is actual command and Linux that will give you the host name of your system. So I wanted to say hello, my server name is dollar a. And what does that 1 a is the a, the container right here, and that container is what host name that it will show you right here. And then you'll say, what is your name? And now, just for giggles, I wanted to change the Read it to just a different container. I'll put B. So just to clarify that, don't You do not focus on the container name. Container name could be anything. So you are asking, what is your name and the user who's going to provide the name will be put into the container called B. Now, echo. Hello. B. And by ok, so now what we are doing, we are saying is that when you run the script, tell the user hello. My server name is dollar a and what is 1 is the host name. And it will print it here. And what is your name? And you'll put in your name and it will upper back to your name. Now, before I run it, I just want to tell you one thing. There will be error in this crypt. Why? Because when you define a command with a variable, you could run that variable. If you only simply typed dollar a, then it will run it. But if you try to run that variable using an ACO command, then you have to have this ticks on the side. What are those texts? Those texts are right below your Escape key. Those are the text. So you have to have those. But anyway, I wanted to take it out for now. Just so you see that, what do we get if we don't put those tics in there? So escape, save it. Now let's run it. It says Hello, my server name is hostname. So it actually took the exact name that I type. It didn't think that it's a command. And it now it says what is your name? So now I'm going to put an M1. Absolutely. And it's gonna say hello, Enron upsell. Okay, so this part from here to here works. This part from here to here works. But I wanted to have my host name here. And what is my host name? My host name is My first Linux VM. I wanted to have that display here. So going back to what I was saying is if you are defining a variable and you wanted to run their variable with echo, then you have to put little text that is right below the escape character or Escape key, and also below that, that little curly thing. So now let's run it and see if it works. Yes, it did. You see right here. Hello. My server name is this is the host name. What is your name? Okay. M1 epsilon. Hello, Enron, abyssal. C. That's how the input and output script works. Tried out with different things, play around with it, and ask questions back and forth, back and forth. So first you should, what you should do is as your practice, what you should do is you could put more than one, read. How you could do it is like this. You put a good just to empty line and then you do again echo. What is your profession or your occupation, what you do. And then you have to read here again, read C. And then. Then you do echo again. One more echo. And now put an Do you like No, let's put it. What is your favorite show? And now this time read a, we have used B, we have you see, now use D. Okay, that's it. Now, what do we have to do is, first thing is has to say as echo, it will, Hello my name. Next thing I want to do is it should echo your profession, which is whatever the profession is, c is awesome. Okay, next, $1 d, which is favorite show, is good. Shou. You see how I did it first, I asked three questions. 123. Once I have all those three question asked, then I have put all these question different containers and I am outputting those containers one by one by saying, hello Iran. So echo your profession, whichever is, is awesome. And then your show, wherever they show you is, is a good show. And let's see. We could run it successfully. Slash input. Okay, the first name for the first question comes up. What is your name? M1 epsilon c. Now it gave me second question. It didn't give me the output right away. Now, it's waiting for me to give it all the information it wants. What is your profession? Let's say Engineer. Okay. What is your favorite show? Sign fell. And now and I hit Enter because I have answered all the three questions. And it will say, hello, Enron epsilon, your profession, engineer is awesome. Seinfeld is a good show. See how it works. Now. Think of this. Now, when you are installing a program or you are executing some kind of script. And, or even if its windows or even if it's Linux. Now you know that when you're going through the visit and it asks you questions, do you want to install that? You say yes, no, putting your organization name, put it this, you type in your name and this and that all the information that system gathers from you, it actually plugs that information inside wherever your variable is defined. So that's just a simple example of that. So it's like your little script, a visit that will take all the information and it will send it out on the screen. You could also take that information and put in your database, send it out and his email whichever the way you want. So that's how you work with input and output scripts. Again, I will say go ahead and keep that script long, add more things to it, add fun things to it. There's so much you could do with it. And if you wanted to share that, your new creative script, B might get sent me an email. And I hope your script runs without any error. If, if you get through any problems, not to worry about it. That's how we learn.
107. If then Scripts: if then scripts. Now you know how to write script. Let's get into one. Step up some advance groups. Some. If then scripts these air the scripts, which will define some variables. And if they're those variables are met. Then you could run those scripts. And if they didn't script statement. If this happens, do this otherwise do that. So whatever that you define that has to be met, then it will run it. Otherwise, I'll give you some different output, depending how you write a script to better illustrate this concept off. If then script statements. Let's get into our machine. Okay, Mr To Be are in. We are in our home directory and the directory inside. Off it is my scripts and this directory. We're gonna create a new script. I'm gonna call it the our if then script again. It does not have to be the name that I'm picking. You could pick any name like my script or X Y Z or ABC Anything that you want. So when you we wanted to write a script, you do B I and the name off the file. It will get you into the insert mode. So the first thing do you do If you want, Roy, a script is defined. Variable. Now, I already have a script written that I'm going to copy it from so it will save us time. And this is the script which checks for the variable. I'm gonna copy it and I'm gonna paste it. Now let's look at what's this group does. This script is gonna look for count equal 100. So if Count equal 100 which is the variable then is going to say echoed a Countess 100 If it is not equal 200 that is going to say the count is not 100. So that's what pretty much if else statement does. So let's look at our script. Let's run it that first save it. And once we save it well, of course. Where fly the file is created. Yes. What's inside of the file? The look into it and it has exactly the same thing that we typed in. Now we need to give execute herbal permission to the script. Verify it? Yes, it does have execute permission and I'm going to run it. There you go. It says the count is 100 Perfect because we defined in our variable that the count is equal . 200. So what happens if the change the count to, let's say one? We save it and we're on it. Once we were running, it says Count is not 100. So this is the exact purpose off. If then statements is if it looks for the variable, whatever the variable is defined. If the variable value is not met, it will tell you exactly what you wanted to do. You could also change the output by saying if then else I think. Sorry, the count. Let's make a lower case. Count is not 100 again. Countess 100. This is our variable. And it says if bracket count equal 100 then a coed Countess 100 Els otherwise echo. Sorry, the count is not 100 fee Fi is the opposite off. If and it is telling the script now, you should exit out that your work is done. And if else statement is done so you exit out of it by saving it. And now when you run it, it tells you Sorry, the count is not 100. So you just change the output to whatever you want and that's what the If statement if else our if then statement does another example off. If else statement that I'm gonna pick is right here, I'm gonna copy it and I'm gonna create a new script is if then new, I'm gonna define the variable which I already copied. And the first command I have clear it means when the script runs is gonna create the screen . I don't want to see anything that's already on the screen. Next thing is going to do is if minus e which is used, which is the option that is used to check if a file exists or not. So it's staying. If this file home my absolute narrowed a text file exist than what you should do, you should then Atco file exist else. If file does not exist then say echo while does not exist. And that's what pretty much it's doing to Let's run this command. And we, of course, have to give up. Execute herbal permissions that's verified has excuse permission. Okay, does no let's run at if now new Okay. And you run it is this file does not exist. It's telling you the actual thing. Why? Because there is no file exist. There's do cat. If then and it's the file exists where should define exist That fire should exist in my home directory. Error that text. So I'm gonna create a file. Now I'm going to just touch it, and I'm gonna create this file. The file is created. Now I'm gonna run the script, and now it says file does exist. So this is ah, sometimes a very useful command. And it is very useful tool for system administrators who wanted to run this command, um, at a certain intervals or a certain day because, um, an application create some error files or not. And they run this script on Cron job to see if the file exists or not. If it does, it means the application is running fine. If it does not, then it means the file doesn't exist, and it will tell you an error message. So this is F if then statement and we do have other effects else statements, examples in this file as well. And this file is also part off. Your, um, resource is your handouts, and I want you to try out every single script, create every new script and try out different values that you have here. So this is a very cool script that I have written. It tells you about your name and it's still asking you, Do you like working in I T. And it asks you if you if you respond, yes, I will tell you you're cool. If it does now, you say you should try. I t. It's just a good feel, so I want you to run the script on your own, created, create a new file, write the script and executed, and I'm very sure it will run just fine without any air.
108. For loop Scripts: four Loop scripts. Another advanced level of scripting you are keep getting better. My friends keep getting better. The next script that you're gonna run is for loop scripts for loops. What they do is keeps running until a specified number off variable. For example, if a variable is defined, 10. Then run the script 10 times or variable is green, blue, red. Then run the script three times for each color, so it actually simply fires your tasks. If you want to, for example, create file files or 10 files, then you don't have to run the command again and again again. Full four loops will do it for you. We'll go back into our Lennox machine. I will try a couple of scripts, four loops and then you could try on your own and you will become profession were running these little little time tie scripts. So which dirty we are in? We are in our home directory. Always. Home is not just home but entire home directory. And the dirty that we are in is my script. So in my scripts we're going to create a new script. We're gonna call it this time. ABC do V I A b c. And the first thing you know already by now is that you define the shell script that you're going to run this script in, or the shell environment. I would say that you're gonna run the script in and again with. I have already written few script for you to go over this training, and I'm gonna go into our first group, which is a simple for loop output. I'm gonna copy the script, and I'm gonna just simply paste it. This already has a defined shell, so I'm gonna delete that line. So what is it doing for I in 12345 Do so I hair is a variable, which is telling that this container, which is the container name, is I. It holds the numbers 12345 And then what is asking you to do? The script is gonna do echo welcome variable one times variable. Two times wearable. Three very before variable five times. And then once it's done, it is done. So that's why we have to define done at the end for the four loop to finish doing what is doing. So I'm just going to save the file once the files saved again, you have to give execute permission. The permission is given. That's verified. Yes, the ABC filed is there. Let's see what's inside of it. Inside, If it is exactly has the same thing. Let's run the script, ABC and their ego. It's doing welcome. One times, two times, three times, four times and five times. So basically, if you have a repetitive task and on trust me, you're gonna be working in a corporate environment where you would have to do so many repetitive tasks. And this loops script is gonna become so handy for you that you will be creating scripts for every repetitive task that you will be doing every day. So this is, um, uh, putting five times. Let's look at the second script. So the second script, what is doing? It's basically doing the same thing. But this time it will just output the names. And I'm gonna make this X y Z as the name of the file. And it has always starts with the shell. That shell name has been bash, and now this time you're gonna put in some comment and we're gonna say this script will output Oh, put Imron with different actions because it will say See Imron, eat cm Ron Ron, see Iran jump and see Imron play So this is what this group is gonna do. So that's why I have put it in just a comment. You could put more comment Mint. See, the script is created by Imron absolute. And if you want put a date, you can Medals kept that up and the script starts right here. It's telling you, for I in again I is a variable in Is you putting inside of your variable and variable is just like a container. It's telling you put, eat, jump, run, play inside of a container called I Once it has all these three or so four words inside of the container, I then do what we're doing. We're echoing. See Imron Dollar I. The variable is already always be displayed with the dollar and the name of the variable. So it's telling it, dollar eye And then, once I once the script is gonna display every little every word in the container, then it's gonna be done. Once done, the script is created. Script has done its job and we will verify it. The Scriptures here Next thing you know by now is to change the permission on X y z. So it will have execute herbal permission and executed permission. Once again, I am reiterating again and again. If you cannot run the script is because you do not have execute permission. So we do have executed excusable permission. Awesome! Perfect. Let's run it X y z Oh, it say's bash X y z no such file or directory. Why is that? Of course we have put c it Z actually x y z So let's run it and they go see him. Ron, Eat, See and run Run! See and Ron jump cm Ron play. So again it is doing a repetitive tasks for you. So this four loop is a very strong statement in a scripting environment that the lets you run repetitive tack again and again so you don't have to do it yourself and spend time all day and creating those little tedious task. I want you to write other scripts that I have inside of this file. This file is again in your handouts. Um, I want you to download this handout. Create these little scripts again and run it and see what they do. It will be a great exercise for you.
109. do while Scripts: do wild scripts do? One. Scripts are very similar to four loops for scripts. The Do Well script or statement. Continued lead executes a block of statements, while a particular condition is true or met. For example, if you are running a script and you created in a loop, it will run until a certain variable is met. For example, if you have, if you want to run the script until August 2015 to 2 p.m. Then you will define that and do well script and a lot of times the scripts or the demons, the process that never dies, that keep running and running and running. They always have do wild scripts because they are running content continuously until a certain condition is met. So, for example, Rana script until 2 p.m. As soon as the two PM hits, you're done. Exit out while condition do command one command to command three. And once all these commands are done and the condition is done, then you are done. You are done with your script. So let's look at our Lennox machine and let's try out ah, do a script. It's clear the screen where you are. We are in my script Victory, which is this directory we want to be in. And this time you're gonna create in this new script and we're gonna call it script, do a while again. Um, it's just the name I'm picking. You could pick anything you want Hit Enter. You are in V I mode, you hit insert and you start typing with the first thing that your type type hash bang been bash, which defines your shell environment. And if you wanted to put a comment, you could say this script is created. But in Ron have so on 2018. Yeah, that's fine. And if you want to put a description of the script, you could do that. But let's get into the script. I have already written in the script. I'm just gonna go in and copy it. There are two scripts in my hand out. I'm gonna take the 2nd 1 I want you to do the 1st 1 yourself. Copy it, and I'm gonna paste in real quick. Let's see what this guy does the script is doing. Of course, the 1st 1 is defining the show, which we already have some we're gonna take it out, but hitting D D. And then it's telling us that the count is zero. The number as 10 wild account is less than 10. Do echo number of seconds left to stop this process, and the process is the variable, which is dollar one, and echo is just empty space. Empty line. Sleep Sleep is a command that will wait for the number of seconds that is defined after the sleep command. Then it has a few number of expressions. These are expressions. You could get it anywhere online. I have that expression for a while that I tried out many times in my work environment. It works perfectly. Any phone is using in your work environment, you're more than welcome to do so. The next one is sitting echo, and then it says echo dollar. One process is stopped and echo again. It is telling it that it's giving an empty line. Let's run the script and that see what it does give execute herbal permissions. It's his 10 seconds left to stop this process. 987654321 and done process is stopped. You see that? So these do Wah scripts are created for a certain value or certain time to be met, and once that variable is met, it will stop the process and exit out of it. I want you to create a new script in your environment, and this is a script again. This is also in the handouts. You could copy and paste the script, create a new script and run it. You could also be my guest to go online and just type Do wild script examples. There are tons and tons of do while scripts that you could try and get get a low, um, exposure to do Y scripts. I'm sure by the time you will run at least five or six scripts, you know exactly what this statement do.
110. Case statement: que statements groups. Now this lesson. We will go over the statements off case where you are given options in a script to pick from. So it's like an interactive way off involving user whether they want to select Option ABC so forth. So in case statement, if a option is selected, do this be selected? Do that CIA selected do this? So these are the different options on what, exactly a or B or C is gonna do? Well, it depends on what the variable you assigned to them. For example, if you assign a to do, um, to up date on the screen, it will output the date. What if a is selected? Now, let's let's look at the script. I have a script right here. Always starts with the show. Shell is bash. The next is Echo, which is just printing out an empty line. Then it's gonna echo. Please choose one of the options below. It will print out a as in for variable equals display Date in time B list file and directories see list uses logged in and D checks system up time. Now, this is all just a display message that's gonna show up. Once the script is run, then it will read. All the choices are put all the choice in a container. Then the case statement comes in. It's gonna say choices, which is this variable choices in And the container? We put it. All these choices and what the's choice is going to do. A. It's going to run the command Date B is gonna run the command. L s C is going to run the command list of users War logged in and D is going to run the command up time. Remember, all of these are actual commands inside off your Linux operating system. When you run it individually, it will give you the date. But this script will allow you to automate the task toe. Pick these commands for you. So let's copy them. This is the whole script we have, and I'm gonna go into our Lennox machine, which I have already logged in on logged in us myself and this territory. I'm and I'm in my home directory. I'll go into my scripts territory. Um, I believe, uh, my scripts CD, my scripts. And in that directory I have already created some of the scripts that we learned in the previous lessons. So for this, I'm gonna create a new script. Gonna v I and I'm gonna name the file case script. You could name it. Anything you want once you are in V I mode hit, insert by and you could just simply right click on your, um on your mouse and it will paced everything for you. The first option is once again it's just a shell. It's telling you to run would shell environment. The 2nd 1 is you type in anything this script is created, but by me or yourself your name or what everyone you want to do. Second thing it's doing by the way, empty lines in the script doesn't really marry. Believe the Empty or you could just put a hash sign. Next thing echo again. Echo is just gonna throw in an empty line on the screen. And as we went over the script, this exactly what's gonna do. Um, and you're gonna save this file? Do ls my Celt er this is still a file. It's not scripted because we have not assigned executed permissions to it. So to assign that secured permission a plus X to assign acceptable permissions toe all user group and others and the name off the scrip s case script Verify it has all the permissions . Yes, it does. Now we're gonna run the script by dot, slash and type case. Once you're gonna run it, you'll see it's gonna give you that. Please choose one off the options below. So you have the list of options right here? A to display the date and time. It's nothing but exactly the display off all those texts that I have typed after Echo, which you see right here it's everything after echo. It's nothing but, um, and output on the screen. So now if I select okay and run it it exit of the script and it gives me the date it runs the command date itself as a few type date. It gives you the date, today's date, the time and you let's run it again. And this time will pick be once you do be it lists all the files or directories inside off my current director, which is the command that you already know, which is Ellis. Run it again. And this time I'm gonna pick D check system up time and to the command to check system up. Time is just simply up time. And this script will run up time command and put on the screen. So this was exactly the case statement does. So the last option. If you notice we have a star right here. What? It's telling me that if any other option is packed, it's gonna say echo invalid choice. So by so let's try to run it. And this time I'm gonna pick F. Of course, F is not one of the listing. So once I do, that will say invalid choice by. So that's how the case script works. I want you try it out. Pick different commands that you want to run, pick different text message that you want to associate with those commands and try to run it. Let's say if you want it, um, pick A for what is your name, and it should type who for it, and it will give you the log in name and so on, and all the different commands that you have learned
111. Check Remote Servers Connectivity: Hey everyone, here is another newer script that we will go where it's about checking the other server connectivity. Of course, you need to know all the time. If you are in a bigger environment, you need to know if your other servers are actually reachable. And Peng bubble. Now, I know there are a lot of monitoring solutions that are, that are out there that a lot of companies have. They actually monitor the servers, they monitor the health check and everything. But still, once in a while you do need to actually paying other servers or remote servers, that actually tells you if they are alive or they are down. So this lesson is about pinging the servers. What we're gonna do is we actually going to create a script to check the status of the remote host or host. And we'll find out if it is pink bubble or not. Very simple script we actually had to combine in this code. We have this combine if else statements, we might have to actually combine do-while statement together and you will see how we could ping the servers. I have my Linux machine open, and I also have a quick document here. You could say a cheat sheet, which already I have a script written there. Because if I go over completely black with you might forget and I might lose time. And I definitely don't want to do that. I definitely want to lose time and your time. So anyway, the first thing I want to do is I do want to mention one thing that previously we actually created a directory called professional scripts. Now, I noticed this whole directory is a very long directory. Let's make it short. So this way it will be easier to actually change actually from one place to another. So I'm gonna just do move professional directory scripts to PS, the symbols that now you'll see I have a directory called ps, and I go to ps, which stands for professional scripts. And now I have all my scripts. So just to start off with that, now, let's start creating our first script that is going to paying an IP address. Now the IP address that I have selected is the IP address of my home modem, which is one, 9p21, 681 dot one. And most likely if you are in a home environment not in the office, then your IP address is the same as 1 eighth, 1 16th, 1.1. if it is not the same, then you could go find out the default gateway IP just to test. If you could ping it or not, or you could just paying, or you could just pick any IP that you could test your script against. So I have picked one, a21, 681 dot. One, this is my IP that I'm going to test. So let's first create a script and I'm gonna call the script paying script. Okay? And this is the first time I will copy. And then later on, so I'm just going to quickly do the information. They description. This script will ping a remote host and notify, Of course, then modified. And since this is the first time, and I am going to the thetas, OK. Now let's get into the real work. Now, we defined the variable now paying, I'm sure you guys know what a pink script is. Pink goes out on the remote host paying an IP address and tell you if a host is available or not. So let me just write and quit out of this script. Make sure you save it. And just if you don't know, paying them, penguin a21, 681 dot one. And you will see you are getting 64-byte back from this machine. It means there is a machine out there with that IP address and it is reachable. Anyway. So now let's go back to our script. So what we are trying to do with the script as you wanted to, Peng minus C is count just penguins. The IP I1I2 once, 168 dot one, dot one. Now, as you go along, you're probably thinking, hey, how come Enron knows all those different options to specify how getting you remember is how can he just pick really quick? Well, to be honest, I don't remember. There many times. I just go online, Google it, and and I get the options. So if I wanted to Google ping only once, I'll type ping only once in shell script or ping only once remote host. And it will give me the option that I'm looking for. So don't worry about it. You're not the one that you are thinking here are my memory sucks. I'm not going to remember that. Trust me, my memory is probably worse than yours. So don't worry about it. If you forget anything. Go online and search for it and you will get it as long as you type exactly what you're looking for. Alright, moving forward. So we are pinging this IP, alright? It will ping, ping one time. Perfect. Now what will happen? What are you trying to do when it pings? Ok, we are trying to say is if single bracket dollar question mark. Now what is a dollar question mark? Question mark is the output of all the command that you run. By default, the dollar. Question mark returns two values. One is 0, which is that yes, it it ran successfully or anything else. So these are the exit status. If you don't know the differences between exit status, you can look it up, but they're mostly to exit status than I usually rely on exit status 10. So dollar question mark. If the return of my command above, which is paying minus C1, the IP address is equal to 0. Ok? You see if the return value is equal to 0, which means it did run, it was successful. Then since we are an if-else dense segments, we have to specify then tab, as I said previously, always put tabs so it will look neat and clean. Then what do you want to do that? You know, the ping is successful, the host is reachable. And what do you wanna do? Well, simply say, okay, how's that? Just that simple. Alright, perfect. Now, what f you don't get the zeros status, which is camping it, then what you wanna do then is what else? If that doesn't work, then what else? Else? Echo not okay. Right. So if do this, else, do that. Ok, perfect. Now, every time you start, if you have to end it with v, and that's pretty much it. Savior script. Give executable permissions to your script. And now run the script plus credit screen and now run, run the script. Perfect. You see it ran and it ran one time and it came back and was successful. Statistics came back one packet transmitted. This is all part of pink script. So we came back, the status was 0, which means it ran. And that's why I said, and that's what the script said. It was. Okay, perfect. Now what if I give an IP address? So I'll change my IP address right here. I have specified right here again, I'm gonna change the IP address 21261 dot 235. Now how do I get that IP address? I just paint some of the IP address in my home network. I'm sure if you're in a home network you are IP addresses are probably used from two to 15 or 20 at least, because we have so many gadgets at home. But it's very highly unlikely that you probably going to be at 235 IPs. So what I did is before I pick that IP, I just simply pinged that IP. Ok. You see I Peng that IP and that IP is not reachable. So that's why I just picked that IB. You can pick any IP that is not palatable either. So I'm gonna go into, back into my script. And this time I'm gonna change the IP to instead of one dot one. I'm gonna change it to 235 and save it. And now when I run it, what should I get it, camping it right? And it's going to come back and it's gonna say now, okay, so that's how the NFL script works. And to Peng other host, the devices, that is something that you will definitely, definitely will be working on. I'm sure if you are in system administrator or engineer or any kind of role, you probably will have to do that. Now, next one is, if you notice right here, I have this output coming in, that output, it's going to give me that it Peng and then it will give me the nod. Okay. Now what if I just I'm just concerned that don't show me anything, just tell me if it is ok. And if it's not okay. So what do we, what do we do here? As I have written down here, you could output because right here and you do Peng it output to the screen. If you do not want that to be output on the screen, then there is this syntax that you have to specify. It says ampersand greater than sign and Deb, No, it means that you are outputting it to a dev null. Dev null is just a file in Linux. It's a null file. Every time you throw anything on debit, it will just disappear. That's how it is. And I'm very hopeful you probably heard of that as well. So I'm gonna go back into my pink script. And this time I am going to tell it that, you know what? Don't throw messages on the screen. I don't care about the message. All I care about is what is come, is it okay or is it not? Okay? Now I will run it. Now. If you see, now, let me clear the screen so you will see it will come up very nice and neat and clean. So he's not throwing all those messages. All I'm going to get is not OK. That's what I care about. So many times you don't really want to see all that junk on the screen because that will not only confuse you, but it will take your time to actually read through it and what exactly you're looking for. So if I change the IP back to one, then I should get OK, simply and straightforward. Just OK. Perfect. Now, next thing I wanted to cover is what if you wanted to define that IP in a variable? Meaning you put that IP in front of a variable. So instead of just pinging the extreme IP, you paying the variable. Why do I do that? Because many times you do want to add multiple host or certain things that you want to. You want, you probably wanted to paying multiple times. Then you don't want to specify IP again and again and again. You just specify one time and then do the host to itself. So I'm gonna go back to into pink script. And now. Put in variable right here and variable I'm going to do is host equals sign code 192168 dot one dot one, quote close, that's my variable. Now instead of paying the IP, what I'm gonna say is paying the host and dollar host, Right? And this time I'm gonna make my script a little fence here. I'm gonna say if paying this host, which is this, which this variable, and I'll put to a dev null if the output is successful, then okay, instead of just, okay, I'm going to say, then say hosts, the IP is OK, is OK. And else, if that IP is not penetrable, then host is not OK. You say, I use my variable so efficiently. Now I used it three different, in three different places. I don't have to specify IP here. Sorry, IP here. I don't have to specify IP here. I don't have to specify p Here. I have specified the epi just one time as a variable, right here. And now I'm just going to use that variable as a container, and I'm going to use it again and again and again. Okay, so let's run it. Nice right? Ip that I'm trying to ping is okay. So now it's very Pacific. That's telling me that this is the IP that you're trying to Peng and it is okay not to worry about it. Now what if I change the IP to 235? Which is of course one of my P That is not pink bubble that is not assigned. And now let's clear this screen so he could see batter. Thank script. It's going to ping. And the reason it takes a little longer because sometimes painters waits for a tour respond. It's by default, it just waits for it anyway. So you see it came back. It says one I2, 16T, 1.2x 35 is not okay. Perfect. See how we actually make use of variable here. And we use if and else statements, and we are putting the variables in place again. Now next one is changing IPV already did that. Perfect. Now, the next one is a little complicated one, but it's easy if you do it together. Okay? Now what if you wanted to Peng multiple IP address in one script, okay, one IP ICU penguin, right? I could, I don't even have to create a script to paying that, right? I understand. You're probably thinking that, but the reason we start off with one IP, so you would understand what if you wanted to paint a 100 servers? Now, things get interesting. Now you really need to have that script, right? Okay? So first of all, what you need to do is you need to put that IP addresses that you wanted to paying to a file. So I'm going to create a file and I'm going to call it my hosts. And I'm going to put in the IP address, we want a 2681 dot one. And the second one, I'm going to put it on a 2681 U235. So now since we are working on only two IVs, if you have multiple IPs, you want to try it. Please go ahead. Now save. Now this is just an empty file, sorry, this is just a flat file. And let's do my host. And you will see it has two IP address. Now instead of changing the existing script, I am going to create a new script. And of course I'm not going to create a new script from scratch. What I'm gonna do is I'm gonna just copy my pink script and I'm gonna name it ping script dash l. So this way it will identify that this is for all multiple Linux servers, multiple hosts. Okay, now we are paying script dash. All you see everything here is done but I just have to change the description says this quibble Peng, i remote host, not remote host. Multiple remote hosts. Make sure you change this description is very important. Okay? Now we're going to come in and what I'm gonna do is I'm going to simply, let's first get rid of this variable host. I'm going to start from here. What are those host? So this is the variable and variable is what? Specify the location of your file. So that is slash home. I saw slash ps, ps for professional scripts, remember we did that. And b, What was the name we picked for the flapper? Was it hosts? Not sure actually. Let me go check so please make sure dislocation and this host file is correct. Otherwise, it's going to complain. No, I specified my host and it is home. I absorbed P S directory, my host. Okay, perfect. So now here is the location of the file that has all my multiple host. Okay, perfect. Now I wanted to use for loop for that. Why? Because for loop allows you to go through the script once, twice, or as many times until everything is being read or everything has been satisfied. So if I don't specify for loop, what will happen is it will pick the first IP in the list and it will be done. It's not going to go through the second IP. That's why we have to specify for loop four, IP. Now why I picked IP, IP is just a container again is just a variable. You could just pick anything for IP. And dollar parentheses in where Cat specify dollar hosts. Okay? Now you see what I did for IP. I'm putting, I'm creating a container in, other container IP in. And I'm carrying this at c host file. What is, sorry, unless you host, I'm carrying this. Dollar host files. What is dollar host file? Dollar host fall is the home I absorbed PS my host. So this is what I'm telling for IP in. Put everything that comes from this result cat, host, but everything in IP. Alright, perfect, I'll do that. Now. What else you want to do? Now? Do, because you have to specify what exactly once you do for always has to have a due for do, done for while, do ok. So for ok. Now what you wanna do, I'm gonna do is I'm going to move this one tab over and I'm going to say ping C1, same thing. And now instead of host, I wanted to do IP because right here it says IP, right? This is the container I am specifying it right here. Now you're probably thinking, hey Enron, why can't I just use the same variable? Hm, that's a good question. I don't know, tried, maybe it works. But this is how I actually go through my practice. And if you wanted to try it, please be my guest tried if it works, perfect. So IP, okay, going into depth, not now coming back to our same script. If lb dollar question mark equals 0, then instead of hosts, now you're talking about IP. Ip is, I put it there, Ping pass, I'll just leave it as is, IP is okay. And the same thing here. Ip is not OK. So by the way, this file that I am looking at it, I will I will attach that file with this lesson so you don't have to worry about it. You could also copy paste if you make a mistake. Sometimes when you're writing a script, many times I would say even 80% or 85% of the times you make mistakes. I make mistakes too. That's why I tried to write it, so there won't be any mistakes. Okay, so this is how it's gonna do again. So hopefully you understand what I'm trying to get at. This is the variable and the variable is gonna do, it's gonna specify the name of the file. Ok. Now for IP, this is another variable and is saying that, you know what, go and read that file cat that file. And that file is just dollar hosts. I don't know why I keep saying at c host is just so used to it. So you get the hills anyway, okay, do ping that whatever is inside of cat, cat hosts. And to go through the same scenario. Now another thing, don't forget at the bottom, when you have do, what do you have to have done? Same thing if you have fee, you have to have. So if you have f, you have to have fee. If you have, do you have to have done? Alright, perfect. Now let's run it. Let's verify the habit. Ok, we do ping script. I'll hit enter one idea, 1621 dot one is OK. And one ninety two hundred sixty one dot 235 is not okay. You see how it works? So that's how you could actually create a script that will have a multiple IP address or multiple host name and that you wanted to pink. And of course, if you wanted to run this script at a cron job, you could try that, but we'll cover that later as well. So just focus on this one and try it. And if you could seriously try to do a cron job that will automatically run at certain time. Try it will work. All right, good luck.
112. Aliases: aliases. What are those aliases? Well, in real life, Ellis is like a short name or easier name or something easy to remember. So I'm sure everybody has, Ah, nickname when you were growing up. Um, and just like other people who are very famous, Just look at 50 cents he has his real name is Curtis James. And, um, there's another one like another example would be pitbull. His real name is Armando Paredes. Eso Those aren't the real names, but they're Ellis is is shorter. So the shore aversion and shorter name they have is because easier for people to remember them since the same way it is his work in Lenox to So there are very long commands that you'll run almost every day. But you need a sure aversion off it. And how do you create a short version or a short reward for it is by creating aliases. So again, this is very popular command that is used to cut down on Lenti and repetitive commands. And some off those examples that I have listed here we will cover those example one by one in our legs machines that they say you exactly know what how leases work. So let's go to our machine and we'll go into our or courtroom machine Consul Terminal. And we will try these aliases command one by one. So the first Commander having Ellis is is ls so often time If you want to know all the files of in minus l and a option to listing or a for to also show the head and files, we will run the command ls minus l eighth or a L. And you will see all the listing of the files and directories we have in our home directory . And this is our home directory. Simon, run that command. Often time, you'll forget the option. So what do you do? Will create an alias, So we'll create a low Yes. And instead of just lsl cree tell, um, equal coat ls minus a l coat clothes and just hit Enter. Once you hit, enter and you don't get an error message back. It means that aliases created Now, how do you verify for screen but simply running an alias? But l l was our alias and let's run it. And there we go. We got the up as if you were running whole command. Let's create another alias, the other areas what it will do. It will, um, do the PW d for you And also do ls for you. So to command in one shot that you would you don't have to run twice. So do pl pl I picked the word just for print working directory and Ellis equal coat pwd and you separate each command with semi Colin and Elvis and coat closed. You hit enter. And now and I'm gonna tie pl I should get pwd and L s command running. So first let's clear the screen and I'm gonna write pl And there you go. So the first command it run was pwd Next command ran ls So every time I log into the system , I'll just do pl And it will run those two commands for me. Let's keep going on and let's try our 3rd 1 which has three commands. Who am I host name and PWD. So I want you to create the alias on your own. I'm gonna go onto the next one. Um, next one is it will list all the directories inside off my home directory. Um, I groaned a command ls minus l and a group, but And the cap right here that you see, which is on top of number six? That's it's telling the group group everything. Um, that starts with D. So run that and you will see it crept Everything. I'm in the output that starts with D. So off course, anything that starts with D is what is a directory. So that's what it's getting. So I'm gonna create an alias for it, and I'm gonna call the deal I o r equal coat Vellis minus l and I'm gonna grow up it the d enter clear the screen and let's see if it's working by typing de ir. And yes, it is working. Then I'm gonna try the last command in my list. So what last Command is doing? Sorry, I just have to move this little mawr and resize this. It'll see the last command. So what last Command is doing is, of course, it's doing DF minus h. Let's run DF minus h. We could output your petitions information the size where's amounted and how much is used. And the next command is doing the F at Mons. Age is printing it's walking. The last column. I believe he has dollar six close and you will see it is showing you let me make this smaller too. So it's listing all everything that is in the last column, which is a column six. Now I want to get in that output. I want to get on Lee the 1st 4 characters off this output. So I'm gonna run the command again and I'm gonna do cut my A C one through four. It enter. And there you go. This is what it's telling me that the last column, these air, the petitions that I have in my Lennox distribution. Sometimes you do want to run that command just to find out what petitions you have. You don't want to look at other other information that DF minus it gives you. So I'm gonna create an alias for that. So I'll just hit a barrel key off course to bring the command back. I'll go back all the way to the two beginning of the line by hitting the left arrow key. I'll type ale. Yes, and I'm gonna name this alias as just d equal. Of course I have to put quotation here. Double coat. And there is one little thing you have to change here is you see here dollar sign in Lenox Dollar sign has what meaning If you guys remember, dollar sign is actually outputs of variable Whatever that you have variable inside that you Attash scripting it actually puts it in there so it will think that it's a variable too, so we don't want to tell its variable. So how we could, uh, change that or how we could tell Lennox not to think it is as a alias. Eso he has a variable toe put back slash after putting the backslash move or liver to the end and hit quotation close that enter and it created my alias. Now if I do d again, that's clear the screen. I'm gonna do a D again and very good. It's doing exactly the same thing we wanted to do except with with all that long, tedious command you to have to run it all the time. So it's much easier. Every time you log into the system, you type D and you'll get your information. Isn't that cool? It is very cool because that's why most of the time people use aliases, so it will be easier to remember and do the tedious work in a very short amount of time. Now, where are those aliases created? Once you type aliases without any running creating a new command, just type releases Hit. Enter. You will see right here. It will give you all the aliases that I have created. He knows right here. This is Want dessert to another one right here. And then there are another one right here and the last one. No, this was other ones that are already created. It's already there by the system by default. It's already there for us, so I don't have to touch it now. What if I wanted to remove that alias from the list off? Elicit a creel simply, There's a command to do. It is a new alias and you type the alias name. So if you notice the first a list we have, you have his name just deep somewhere. Just type deep it anay listed. Let's see if it still exists. You just type bilious and see if the alias exist there or not. It does not. It's gone. There's another alias de IR until Alias as well. The I R. And then I'm gonna try to check if it's there. Nope. It's gone. So it's just that simple. It's masking something, it's telling. Is creating the a shortcut key for you to run in Lenox environment?
113. User and Global Aliases: creating users or global aliases. Now we have learned how to create aliases right on the on your own a session. But you might not know one thing that as soon as you log out off your council are pretty session where you have created your aliases, that aliases, they will go away. They There's no way to save them now. How can you save aliases? So every time you log in, they remain for their your session? Well, there are basically two type of aliases that you create in a use environment. One is user that applies on Lee to a Pacific user profile, and then the next one is the global alias. Global eighties applies to everyone who has an account on your system. So if you create one aliases, every user who logs into the system will be able to access that Julius. If you wanted to set up an alias specific to only one user, then you have to log into the user and then go into the user home directory inside of the home Directory. There's a file called dot bash R C dot files. At any time. There's a dot in front of full file. It means that file is a hidden file. So you would have to actually specify dot bash RC for global aliases. If you want to set up global aliases, you have to specify that in the Etsy configuration file and that is etc. Bash RC. So let's take an example of a nearly cyst. Let's say if I wanted to set up an alias that will look like this. I wanted to run h h and it I wanted to give me the host name instead of me typing the entire host name I just wanted to do Ahh So let's go into my legs machine. I am logged in tow machine right here. And if you notice when I run H h it's his command now found so ill I've need to create an alias for it. So when I type Ilias h h equal host name now, if I type just aliases, you will see that this aliases has been added it to my environment. Okay, Perfect. Now if I just type h h, it will give me the host name. Right? That's perfect. Now, remember this this set up off Ellis is stays here as long as I'm logged into this. This is consultation as long as as soon as I'm out of this or I am logged in from another party session. Let's say I won't be able to access this alias because this alias is a tide to this particular session. So, as as an example, I could show you right here. If you notice I have this party session, I'm logged into the same linens machine. I will become myself because in the other session right here, that's myself too. Who am I? That is myself. So I'm gonna become myself. And now when I type where my you'll see I'm logged in as myself when I type h h, you'll see command ofoe, see, same user, but different session. But this a change. It's actually tied it to this session or this terminal. So if I wanted to make that global meaning not sorry global, I find why to make that tied it to my user account than what I have to do is I would ve i my dot bashar see file which is right here in my home directory. If I do ls minus l. A to A is to view the hidden files as well. You You're gonna notice that there's a file called Bashar See? So go ahead and be idot bash R C file. Go to the end off it. And you could put a comment personal aliases and then you put an ill Yes, the name of the ill. Yes, equal. And the command name saved a file. And now if you go in and put in another session So let's say this it's not going to show up right away on this session because this is this session is still holding the old environment. So you have to create a new session. So goat click on this icon and click a duplicate session. It will open up another party session, log in with your user name, and now, if you type H h, you will see your host name is there. So now that's how you could tie up your alias with a user count. Now what if you wanted to tie up that alias to everyone who logs into a system which is called what Global areas? So in that case, let's say if I become, I mean, do a duplicate session again. If I become route and log in as root, and I type h h U C route doesn't have access to that alias. So I wanted to make that alias available to everyone. So for that, you first before you have to be ruled because every time you might need to modify the etc configuration file. You have to be route so en route. Oh, sorry. While your route make sure you are rude type, who am I? Then go into the either filed at sea, bash our seafood in this file, go to the end off it by hitting shift G and then put your comment as global ale uses. And here you could type ill. Yes, H h equal host name and save this file now again, if you type Ahh, Right now, it's not gonna work because this session the H H is tied up to the user accounts globally. So you have to log in again. So I'm gonna go ahead and close the session. I'm gonna go ahead and close this session and I'm gonna use the same session. I'm going to start as a duplicate session. So the 1st 1 I'm gonna try is I absolved and a must see that as I absolved, I have access to the alias. But now you're probably thinking, Hey, I added that to the user profile. That's why you do. OK, that's why not let me glogg into the root account. So I'm gonna go in and I'm gonna type route and I'm gonna log in as root. Who am I? I am route. And now if I type in h h and you'll see the aliases right here you go Also type analysis to see what is inside of the environment. But it's set as it aliases. Use it by Ellis is set as this one as well. If you have mawr users in this machine, you could try into log into that user. So if I do cat at Sea password to see what other uses I have, um, I have created some of the user, but then I deleted it. So let's say if I create in the user user, add create a new user called James James is created. Let me set up a password for James. That's fine. Forget passwords. Set up. Let's clear the screen and let's actually exit out of the screen. Let's exit out of this screen to now. I'm gonna log in, as do the duplicate session that's log in as James. No. And let's see if that H h l Use is also accessible by James H. H. So not you. And you see that aliases that we set it up in, etc. Bashar C is now also accessible to James as well. So that's how you set up a juicer. Aliases and global aliases is something that you should remember. When you log out and you don't add aliases to these files, it will go away.
114. Shell history: shell history. What a shell history is every command that your run in your legs up ring system or in your terminal It creates a history of these commands. This history command, I'm telling you, is so useful that even when you're troubleshooting, you're trying to find out what other commands people ran that actually bring your brought your system down or crash your system Or what is the command that was wrong that deleted a file? All those commands that you run in, Lennox just be careful. Those commands are recorded and those commands are recorded and can be retrieved by simply running a history command. So it's just the street commandment. Everything is lower case. When you run it, you'll get all the listing off your commands That's been run by a Pacific user. Let's try to run it. I'm gonna log into my party, Citian, I am already in here. Um, where am I? Myself just confirmed which directory on men and which whole Steinman Awesome! We have confirmed that they are logged into the right systems now. I wanted to clear the screen and run this three command. Whoa! Such a long list of history commands what is telling me right here that I have? So far since I have logged into the system, I have ran the history command 666 times. These are the different commands I have ran since I logged in or since as many times I logged in. Since the system is built, how do you view other commands? Of course. If you're running putty, you could just scroll up. But what if you wanted to see all of them? One page at a time? Please tell me you know that history Pipe it More it? Yes. Now it's gonna start listing all the commands one by 11 by one. The first command when I logged into the system the very first time and I built a system was pwd next commanded it. Exit if conflict those are different commands is if you could see you could check every single command every day. You could also run this command in your shell and find out what other commands is listed. It's not only gonna list the command at that you ran successfully. It will also lets the command that you ran incorrectly or wrong command or command that did not work. So that's how the history command Waas now coolest feature of history Command, which even alone that if you wanted to run any off this command again, you could copy and paste. But you could do that. But there's a chance is it's not gonna get copied or it's not gonna get paste. But if you wanted to create, if you want to run a command again, let's say I wanted to pick a command. Um, I wanted to pick a commander. I wanted to run last last tell you which users are logged in an arc walk. It's gonna print out only the first column off the output last, and then it's going to sort it out, and it's gonna unique it out. Of course, it's a long command. There's two ways you could do. It is one you could copy paste, or you could just do four or six. Remember four or six that this command the number off this command was four or six, and then you run it. How do you run it? You just simply type Bank 406 richest force or six you run it into ran that command and give you the upload. That command isn't that cool, guys. It is very cool. I use it all the time. And I love this because this way, I don't remember a command that I typed maybe five months ago. If I go into a history, I look into it right away. And if you want to do history, command and you remember that you ran a command that had walk in it, you were looking for something that has organised. So what do you do? You just grateful walk and ever list all the commands that Iran that has walk inside off it . If you wanted to do history and grab and you want true, check all the commands that has changed modern it You get all those commands. So again, try it. Try it as many times as you want. And please always run man on history and you will find many information on a lot more options that you could use
115. WELCOME TO MODULE 7:
116. Enabling Internet in Linux VM: getting Internet access to your virtual machine. Now in this module, we will co our different components off networking. We will learn little bit about how networking works in a Lennox environment. So before we get into the network, we do need to allow access to our Lennox machine. And in order to allow access, we have to make certain changes to our were actual worship box manager. Basically, we have to go to the network setting and change its network adapter to British adapter. So this way it will get its network through your laptop or your through your desktop. So let's go into right into on the change. This is our VM that is running. I want you to go to the setting network and change this attached to bridged adapter. Once you change it, leave everything default. Click OK, once it's sit, let's go to our courtroom machine and then here we will try to do Ping, uh ping dot google dot com And right now it's telling me that it has. The service is not available, so it's become route and then just simply reboot the machine in it. There to reboot is in it. Zero or just type, Simply reboot. It's open up the terminal, and this time I want you run Command If config and pipe it to more and you will see here, the I P address has changed. It is given the I P addresses off the same network that you have set up at your home. So now when you try to Pink www dot google dot com, you should get the response. See, it's getting to 64 bits. Response back from the server. Paying is the Commander is used to communicate to other servers. So now we know that our machine is ready. It's written on the on the network We could I don't know the packages. We could install the packages, anything that we want, it has ability to go on online.
117. Network Components: Now let's get into the network side off. Lenox Off course. This is not network where you're gonna be learning switches and routers. That's completely a dedicated network job that you should look into. But in Lenox, even if you are system administrator or engineer, you have to know a few things off network. What it means is, when you are building or installing Lennox Machine, you need to configure an I P address. You need to know certain things, certain components of network to get it working and get it online. What are those things? Of course, the first thing is I p i p stands for Internet protocol. I p address is could be like for example, one i 2.1 68.1 dot 234 or whatever. So of depending on the organization you were in, you're probably gonna have a different range of I P addresses. So your job is to assign an I P address, and you should know what I p address is and what it looks like. Submit Mask is an associated way to attach it to the I P address, and then we have a gateway. Gateway tells the your computer. Which route you have to pick to send your traffic out and to receive your traffic in. So if you are in your home environment, your modem, the I P address off your modem will be your gateway. Then we have the static, and worse is and DCP Ah, what static is if you are given an I P address from your company from your corporate environment and you have to assign a dedicated I p to your machine that is called static. And when you reboot your machine, that I p does not change. Whereas if it is set up as D. A. C p. The I P address will change, it will pick an I p from a pool off I p addresses. And every time your system is rebooted, most likely it will change its i p address. So in most of the corporate environment, you will be setting up a static I p address. Then you have interface. What interface is if you look at your laptop or your computer in the back off? Ed, there's a port where you connect. Connect your cat five Cable. That's the interface Nick card. So interface always have a Mac address that is a permanent Mac address to your neck associated with your card, and this Mac address never changes.
118. Network Files and Commands: network files and command. There are many never Quiles and commands that needs to be used in order to configure your machine and bring it online and bring it to the network so it could communicate from one machine to another. It should have an interface, an interfaith detection. Assigning an I P address to the system is very important when you bring up a system and you need to have it on the network, the interface configuration files or the 1st 1 is XY and a switch Dakar File. This file is located in every Lennox distribution. In fact, all these fathers that I'm gonna talk about all of them are and will be in your Linux system. So for the 1st 1 is Anna switched out Comp, which tells the system where is where it should resolve its host name, Toe I p address. So let's look at our length machine and then we will find out how how to read these files. It's clear the screen. Okay, the first file that we're gonna look at its etc. And a switch. So just do cat on etc. And a switch dot com file. You will see it starting with host Let's let's Doom or on it instead of just Cat. So this hills to read the file page by page. Okay, so all these stuff, anything that starts with pound, it means it's just comment anything that you want to have it in effect, just remove the comment. So let's go through it. Let's go to the point where we don't see the comment. So here it's starting from this page on it is a password file. So the first thing is telling you that look for the pastor part and the files don't go anywhere. There's no active directory, there's no other. And I asked Service That's running that's going to give you the pastors or look for at sea passwords. Shadow is also etc. Shadow. That's local group is also at si group, and when you come down to hose to right here, it's gonna tell you the the host information off your system is located in the files, and that is at sea host. And then it's going to say if you can't find it, then go to DNS. The N S is an other service that is installed on Lenox Machine, or it could be installed, and Windows machine will cover that later on. But for now, this is the N S. Which file looks like. And if you want your horse to be resolved, DNS, first you search Deanna's here to here, and file comes the second. So this is the in a switch file. You're gonna be seeing this configuration of this file many times while you're doing system administration. Next one we're gonna look at is at Sea Host SC Host file is where you define your system I p address and system host name. So if my system I p address is if config it's one I to 1 61 about 14 I could go into that at sea file becoming Route B. I the file and I could go at the bottom and I could put one I to 1 $68.1 dollar 14 and the host name off. My machine is, um, gone to me. Save it and they my first Linux os. So let's do it again. My it doesn't matter. Upper case. Lower cape. My first Lennox Lewis. My first Lennox Always. So now if you paying my first Lennox os, it's gonna paying your I p address you see right here the one that you specified in the etc file. So that's what at sea file does. It's a small a very tiny version of Deanna's that's sitting in your machine. The next one we have at sea sis Config a network file this file Sorry, this its network. I believe you know I'm right. So this is the file where you specify your horse name as well. Right now it's empty because we have hard coded the host name. But if you want to change it, you could modify it here, and certain other parameters can be set to. Of course, you are more than welcome to look it up more on the network file. The next file that we're gonna be covering is actually the file. That's where you specify your I p address on all the network all the sudden it mask and gateway. And when you are in the directory at sea says config, network scripts I want you to do ls minus. Lt are. And the last file you're going to see is I f g e and E and P zero s three. And what ISS this the last one. It's actually your interface. If you go if confected and you will see right here. This is the name off your interface. So remember every time all those interfaces files all this started. I if csg dash in the interface name So when you ve I that file here you will see the boot Proto is defined as the CPU could change that at hair ecstatic. And then you could define the I P. Address. You got to find some that mask eight way. And this way your I p address becomes prominent in your machine does not change. So these are a few few of the files that I really want. You understand and memorize it because if you are going to go into Lennox Jobs and you're gonna be applying for it often times you're gonna get questions on these where these files are, what the files do, where the located and so on. So let's exit out of this file. The last fall I have is at sea resolved Outcome at sea result dark off. Specifies your DNS server. Deanna server is again once again, it actually resolved host name to I P i p to host name and host name to host name. So if you define it here every time you go to www dot google dot com and hit Enter, it knows Google is I have to go into this is my way. I have to go to my gateway, which is right now acting as a DNS server. I'm gonna go to my Deanna seven ask where is Google and how to translate Google to I p edit and has translated. And this is the I. P address of Google. Let's go back to our lesson. The next one we have the network commands the network commands. We have learned Ping already. If you wanted to paying a server, let's say paying www dot hotmail dot com. That's a server outside that command that you will run is pink. If config tells you what your interfaces are in the system we have right now, three interface is the local one does not count as interface and the other one you could ignore the only one that I have is just one admits this is right there is telling me my i p is configured this. Then you have If up if down. If you want to bring down this interface, If you don't want a network, you could type it up. Sorry if down. Or if you want to bring you back up your type if then the next one we have net stat. And that's that. You go around with different options. I run is usually R and B. This one tells you your gateway how your traffic is flowing from which interfaces is falling from and the last one we're gonna cover is TCP dump TCP dump. It actually traces every single transactions that leaving your machine and coming into your machine to the command to run is simply TCP dump. You have to specify I with interface which interface you are sniffing. It's basically a sniffing tool and then you run it and you'll see every listening coming in , coming, going out. It's actually listed here. So that's how you actually run this TCB command. That's how you run all these commands and please memorize it. Please run a man command on each and every one of them and familiarize yourself how these network commands and files work
119. NIC Information: nick information. What is the Nick Nick stands for? Network into face card. That is something that is attaches to your computer, your desktop or your laptop. If you look at the back off your laptop, you'll see the little port where you connect the the Ethernet five or six cat five or six cable to it. That's the card installed in your computer and the port that is associate ID and are attached to the card. That port is cold Nick in Lennox or in Computer World. It's called Nick. An example to find the information about the neck is that you run a command eat tool followed by the name off your neck. And how do you find out the name off your neck? I think it think about How do you find out the information about your nick? You run the command if config that will give you all the interfaces off your computer if you run. If config, you will see other nicks as well. What are those? Well, there is one of the nick that you will see that shows up is L O L O stands for loop Back Device is a special interface that your computer's uses to communicate within itself. It works as a diagnostic and troubleshooting and to connect servers running on the local machine. So it's like if you could say, a private communication within itself, then you have another Nick that you probably will see in your machine. If it's a virtual machine, it's V I R B o The stands for Virtual Bridge zero interface is used for Nat Nat stands for network address. Translation. The virtual environments sometimes use it to connect to outside number, so I don't want you to really focus on the R B zero or even L O because you will be seeing this. But there is not not main function of this. The only function off the interface that is used to communicate to other computers is a different the third interface, which is usually labeled as if it's Oracle Virtual, it's E N P, or if it's a regular server, you're probably gonna see e T. H 012 or soul. So we will run this command eat tool in our environment and see how we could get the information about our interface. A little go into our Lennox machine And this time I want to log into my system using our consul. So the concert Or you could use Putty session too, if you want to. So let's see if I have ah petit session. I'll just execute the party section right here. But in order for me to run party section, I need the I p address. How do I find the I P address? How do we find it? If Gun fig now, you should be comfortable enough to run this command all the time. If config I'll put Mawr because if it's ah if it doesn't fit on the screen, it will give give me one page at a time and the i p address that I have for my interface Is this one night to toe once 68 Towanda 12 I log in as myself. And in order for me to run the Eat Tool Command, I have to be route. So I am route. That's clear the screen. Let's get rid off. This one minimizes. Since we already have the putty, let's make it a little bigger And now we'll talk about the interfaces again. How do we check our interfaces if conflict As you can see, we have the main interface right here, which is the Wanda is used to communicate to other computers or outside boiled, and it has I p assign. The next one is L O, which I have already explained, and the 3rd 1 is V. I. R B r zero, I already explained in my slight I want to get information off. We are B R o. So let's say Eat Tool and V I. R B r zero and it will say link detected. No. So forget that then. Next one we want to do is eat tool. L hope. Linked. Addicted. Yes, but there's not much information that's out there because it's the systems its own interface of We don't have to worry about that. The one that we have toe be concerned with is eat tool D and P zero s three. Where do I get that right from here? See this interfaith? This is a name off my interface. So I will run each tool followed by the name off my interface and I'll hit Enter once I hit Enter, I have right here my command. I'll put start from right here. This is what is telling me that setting for interface is supporter ports is teas TTP ah supported link modes. It supports 10 which is 10 meg 100 Meg and 1000 make. What is 1000? Meg. It's one gig. So my interface supports one gig of traffic. Nowadays, if you're running your computer on a very high speed network computer, you will see 10 gig right here. So a few things that you do have to get out of this, um, command eat tool is one that's ah, whether it's, um, link mode is 1000 or 10,000. Second, you have to know, Of course, the speed is 1000 megabytes, which is the same as this one. Then you need to know it's duplex is a full half duplex. These are the things you have to provide to your network administrator, because when your computer is connected, toe a switch and switch has to be configured for your port toe. Allow traffic to come in and leave your server. Your system you're never demonstrated will ask you for that information, so be ready for that and remember the command to find that information. His eat tool and the last one is linked. Detected that your interface link is up is active. It's not down. If you are troubleshooting it, you could find it if you see no hair than it means, it's something wrong with your never card. I tried these commands, run man command on each tool and try with different options that is given and see what are the options gives you the exact information that you're looking for.
120. NIC Bonding: Hello, everyone. Since we are on a network configuration, part of the Lennox will talk about Nick bonding, where exactly the nick bonding is just to let you know, Nick Bonding is one of the very important and critical aspect in the next number configuration, and this type of questions are asked often time in an interview. So let's see a Nick and Nick stands for network interface card that is attaches to your computer. So if you look at your laptop or behind, your PC will see a little port in there and that poor is your neck with Nick, which network interface card bonding is also known as network bonding, it can be defined as the aggregation or combination off multiple nick into a single bond interface. Its main purpose is to provide high availability and redundancy. So let's look at our picture. We have this four neck cards on a computer, so what we do in Nick bonding is we take two ports. We combine them together, and the reason we combined them because of what If one port dies, we still have another port. So this is for the redundancy. So another way to make two ports redundant or to have them. High availability is you combine them together. If a port is one gig and the other port is one, get you. Combine them together to aggregate them and get the true put off. Two. Gig. This is achieved for high availability and link aggregation. So Nick bonding procedure is that you type mod prob owning, which is to get the configuration off your driver info bonding to get the information of your bonding. Then you create a file called If Convict Bond zero. You added the first Internet one. You added the second, Ethan that, and you combine them and point to bond. Zero. If you have Nick one file, you create another Nick to file for the second neck, and then you create 1/3 file called Bond zero. You point your Nick one and Nick to files to word bond zero. And then what do you do at the end? You restart the network off your computer, since the command is system CTL Restart network. So without further do I log into my system and I'll tell you exactly how Nick bonding can be done. And before we start this fortune box I want you to take its snapshot. The reason I'm taking a snapshot is so good. Rigor of work back to a state which is where it is right now after we do all the configuration. So click on right here, you see snap shot, click on Snapshot And right here says take click on the take. Leave the snapshot number one as name default and click. OK, now it has taken the snapshot. Now I want you to click on setting Go to network click on network adapter to check enabled network adapter and select Bridged Adapt. Now we will have to Nick's on a computer, which is one here adapter one and adapt to to If you want more adapters, we could go to it after three and four and check on a naval network adapter. But we will work only Dr One and Adopter to at this time. And I want you cook. Okay, So once the setting is done, go ahead and click on start. Go ahead and log in as yourself. Okay. When you have the desktop right, click on your desktop and open up your terminal. I'd like to make the consul the terminal a little bigger. Go ahead and type if config and doom or under output. And here you will see. Now you have to network interfaces. One is an E and P zero as three. And the 2nd 1 is GNP's oh estate. The NP zero s eight is the one that we just added to article worship box. No, What we want to do is we want to combine these 23 and ate together and make a bond out of these two interfaces. Become rules first. Okay, let's clear the screen now. I will open up a document that I have that has all the commands and configuration in my document. This document is also added as port off your handouts. So before you do this exercise, I want you to also open up this document from your handouts. Have it side by side while you do the configuration of bonding. So I have already opened this document. Okay, so now it says, Just follow the directions. This is add. And you, Nick, if it does not exist installed bonding driver mod problem bonding. You need to install this if you don't have bonding enabled. But let's say if you do have it or not, so do mod info bonding, and I want you to do more on it. And once you doom or and if you get their output and description, says Ethan, a child bonding driver, words in 3.7 up one. That means you already have the driver installed, which is the Mod Probe and Lennox. So you don't have to worry about installing it so you can move on to the next step. Okay, The next step is to create a new file called I See If G dash on zero right here and I have to create this file in this directory in this path. So if I copy and paste is not gonna work, so I have to type it. So I go back into a machine and I do the eye at sea. Sis config Network scripts. See if g dash bond Jew Now you are envy. I mode hit I to insert, and I want you to start typing exactly what's it's written in there. Please make sure don't make a mistake. Type is bond. Name off. This bond is a bond zero bonding master meaning? Who is the Master off. This bonding is it's a self so yes, it's a boot proedl. So when you type none or static, it means the same thing. So type none on boot. Yes, I p address. I'm sorry. There's a mistake. It should be just i p a d D r The I p that I have picked is 1 92 the 1 68 0.1 dot 80. Because I have already typed this I p before and I know this I p does not exist. Nobody has taken it. But if you want to confirm if this I p is not taken, you could just go into you could open up another terminal and duping 19 to 1 68 a $1.80 and you will see you. And you're not getting a response back on that I p That means it's not taken. So use i p I'm assigning the static. I p no mask. 2552552550 Gateway. He is the I P address off your modem and then bonding under school options. Equal mode five. I'm picking mode five. And what exactly? Malan five is army. I'm on is this is the speed and the state. I have also included that in my document exactly what these options mean And I want you to review them and you will know exactly what it means. So now you could just save and exit the file. Okay? Once you have that says the bonding options detail can be found here. You see? Right here has all the option repacked. If you remember, we picked option five, which is transmit load balancing. You could read about it and then am I i m o n which is a monitoring am I linked monitoring frequency in Mili seconds. We picked 100. Okay, So next step is this is added the first Knick file, which is e and P zero as three. So I am in the root directory. I'll go into that sea says config. Just drag this a little more so you could see a little better. Says conf exceeding network script. And in this directory, I already have a file called at CCF, g E and P zero history do the I. And now I have here. I said delete the entire contents of how do you delete it in the Via You do de de de de de de de de keep doing dee dee dee dee dee until you go to the bottom. You are the bottom and says no lines in buffered. That's good. Now hit. Enter. Sorry. On a hit insert you have. You probably have to hit insert a couple of times to get it. It's now keep typing. What, exactly? It's in their type. The next pro. None device E and P zero s three on Booth. Yes. You want to have that boots hardware address? This is a new one. Now, this is the Mac address off your eat and peas. Your best three. So, what is my hardware Mac address? Um, you have to open up another term in the back drug, and then just type if config and do more, and you will see e and P zero s three has a Mac address off this. So what I will do is I'll drag this a little bit on top. I'll bring the other window in the bar in the back, and now I could type the address. 08 Joe 27 c three zero. Sorry. Zero A to there. 28 verified to seven C 30 28 years and then it entered. Master, it's asking you who's your master? The master is bond zero, which is the other file that we created before that hit. Enter Slave, Are you a slave? Meaning this interface is in a slave. Listen. Yes, Toe check again. Boot Proto boot. We missed one. Oh, no, we did not. It's their type blue proto device on boot hardware address, which is America. Just master his bond, your and slaves This. Okay, now save and exit. Okay, Now follow the directions. Okay. Now it says create the second nick file for E N P zero s eight. I could create a 2nd 1 Or I could just copy this e and P zero as three and changed the name and Mac address so it will be easier. Could just copy e and P's or s three and I name it. See if g dash bnp's Orosz three and take up in a place 38 nights copied now, V. I see if g e and P's you're s eight now in your S eight. Now you have to change this third line says device zero s three with eight. Yes, Yes. And now the Mac address would be different. Well, back to you. Other command, that is open. Bag it up and you will see here The marketers for GNP zero s eight is this one. So once you have it highlighted, drag it down so you could see it. And now it change it. It has. It has changed after the three. Opted, though. Zero d 17 nine b. Okay, Bond zero Master is the bond zero slave. Yes, I am a slave for Bonzo then, right? Quit Conceived of all follow saved. Now I want to restart service system. See Thiel, restore the network SOS number three star hit. Enter by running. If config do the more on it and you will see now the I p that I have assigned says right here 19 to 1 68 $1.80. Its master and the other ports. Sorry. Other nicks. U N P zero as three. And it's eight. You see here right here says you're their slave and slave. So I ps signed has given 19 to 1 $61.80. I'm gonna take this I p plug it into my party session and see if I could connect to it. 1 90 to 1 68 Rwanda 80 it enter. Yes, I could connect. This is just a sausage key warning sign. You could just accept it to save it. And Dogan And yes, There you go. So now you know that your interface is combined together to and pointing it to Bonzo. Any other instructions that we have, we could go down. We could also see here. It's telling me that I could verify the setting by doing cat at Sea Pro Nick Bonding and Bond zero. And I do that I should not have. Okay, let me make this bigger. And now you'll see her when I did the cat, you see it say's currently active slave is this one? It is Lord balancing slave interfaces. This and seconds later interfaces this now once it is done, I want you reward back to your original bm so just close it. Power it off close and says power off the machine. You pour it off Now go to your oracle Were from machine right here and first once wait for it to power off, then go to setting and then come to network come good network adapter to unchecked the one we checked before. Click. Ok now it should not have the second adopter, but I want to click now to the Snapshot one and click on Restore that this is going to restore to the original state where we had it before Here it will create another snapshot off your current state which I don't want you to do so unchecked this box and click restore . Now it is restored to exactly same way where it was before we started this lesson. Alright guys, I hope you enjoyed it and please try it on. This is this is one of the topic is that's very important. You will be working on a physical machines most of the time and you have to do number bonding
121. New Network Utilities: Hey folks and welcome back. We have learned all those commands to manage our network. We have learned the configuration files that you need to remember in order to configure your network. Now, what we're going to talk about is the network utilities that are available to you that will make your life a lot easier because now you don't have to remember all those commands, all those configuration files. You just need to remember one command that will do a lot of things for you. So the very first thing is what we will learn in this lecture is getting started with network manager that's in your utility. That actually provides a never configuration methods. And those methods are an empty UI command and M CLI command and M dash or hyphen connection dash editor command and the network utility or network setting through genome or console setting. These are the different methods that you could use to configure and manage your Linux systems networking. I'm moving on getting started with network manager. Manager is a newer tool that replaces your older service or utility. They are called just the network. So network manager is a service that provides set of tools designed specifically to make it easier to manage networking configuration on Linux systems. And is the default network management service on Red Hat eight. So if you are using Red Hat aid, you will see the network manager will be your default service for your network management. All right, what else it gives us? It makes a network management a lot easier. As I mentioned the first slide, you don't have to remember all those configuration, all those commands provides easy setup of connection to the user. Network Manager offers management through different tools, such a GUI and empty uy and NMC alive, which we will cover one by one later on. Now what configuration matters? Let's go more deep dived into what are those methods about. The first one is NMC CLI, which is short for Network Manager command line interface. This tool is useful when access to a graphical environment is not available. And you can also be in, that can also be used within the script to make never configuration changes. Now you have all those different commands in the network. But again, if you wanted to use just one command, you could just simply use NMC ally. And that's a command line interface. Then moving on, one of the best utility, utility management tool that I see and I found is NMT UI, short for network manager texts, a user interface. You don't need a GUI Urania console. You could use that same command on your command line. This tool can be run within any terminal window and a lot, and sorry, I meant to say this tool can be run within any vendor terminal and allows changes to be made by making menu selection and entering data. Then the next tool or Command is an em dash connection dash editor. It's a full graphical management tool providing access to most of the network manager configuration options. It can only be access to the desktop or console. So when you run this command on the party, for example, you're not gonna see anything. So you could only run this command on the GUI. Then we have genome setting the network screen of the genome does subsetting application allowed basic network management tasks. So we performed which is like as if you are going into console and I'm at the top right side, there's a wheel. You could click on it or go to Eataly's anyway, I'll cover that later on as well. All right, let's go, let's do some practice on our Linux machine. So first thing is I have my Linux machine right here, which I named it the next seven. You probably have it as my first Linux VM. It doesn't really matter. So let's say if you are using my first Linux VM, then pick that one. I'm going to for this video, I'm going to use a different VM for myself. But for you I would say use my first Linux VM, power that VM off. Just like this, it is powered off. Go ahead and take a snapshot. Make sure you take a snapshot anytime you make any changes to your configuration files. Take and a name, anything. Let's say you either name snapshot or second snapshot, wherever you put it in or you wanted to put a date that is fine as well. Click Okay. It is going to take a snapshot. Three seconds ago, snapshot is done, and it is a lot faster because your system is powered off. Now I want you to go ahead and click on Details. Go click on Settings, and go to Network. Click on adapted to and check-mark enabled network adapter. Now for those of you who have this enabled network adapter or ready, because we did the never bonding previously in the previous sections. Then you are, I would say is go ahead and remove their network adapter again because we are. We're going to do the network bonding through these newer tools. Now, you don't have to manually add an or modify the configuration file. We will use these newer tools to do the bonding. Clicked on adapt in number 2, then checkmark enabled network adapter attached to bridge adapter and click, okay, now my system will have two network adapters. Go ahead and click on Start. Login as root. Okay, so the very first thing is what I will do on this box is I will go through the NM TUI utility and then we'll cover the NMC ally Italy later on. So T U again, Network Manager tool or texts user interface. Let's try an MTU I. Before I do that, let's do ifconfig to see that the adapted that we added, it's there. So I did IF Config and I do see the network adapter, E&P is 0, S3 is here. I have a different IPM using a different router. Now, it doesn't matter if you are using 192, 168 IP. That's still fine. And then the other one, I have this E&P, S3, both of them are active because both of them have assigned IP. So what I need to do is first I need to make this room, deactivates. This only one can be active. All right, go ahead and type it in. And M texts UI. Okay, as soon as you enter you will see it's a text editor that will open up. It looks like a GUI, but they call it a tax user interface. Now I want you to see right here says select an option. The first one is added a connection which would be 2 by picking up a select existing connection. Second one, activate a new connection and that there's one set system host name. So if you want to change the system host name, you could change it here as well. So let's go ahead and first click on edit a connection. And you'll notice right here it says wired connection, connection one. This is the one that's been added to my system for E&P, S3. So I will select that, move my cursor to the right, and I'll go and click on Delete. And it will ask us to confirm and go ahead and click Delete. Now that is gone. Now it only has E&P, S3 and virtual adapter. Just ignore the virtual adapter. Go, move your cursor to the right and then come down. Click back, hit Enter, move your cursor down, click on quit and hit. Okay. Now I want you to do is to ifconfig again, and let's do more. So we will see one page at a time. And you will see we do have both adaptors, this one and that one, but now only one is active with the IP and the other one does not have an IP. Okay, Good, One thing is done. Now what I want you to do is I want you to create bonding the same way we did, but in previously, we created the network bonding by actually putting in all the information manually into the configuration file. And now what we're gonna do is we're going to create bonding. And we are now going to assign any IP. We're now going to give any static IP. We will let the system pick over DHCP. But at the same time also make these two network adapters as a bond. Now before I go into a bond, I wanted to discuss one more thing. There is a new tool that is that actually replaces bond, which is called team. You could use either bar or you could use team. Both of them performs the same function. It lets you put both of your network adapters together and make them redundant for each of them. But for this method, I'm going to use the team instead of bonding because bond, you already know how to do it. Okay? So first thing is, I wanted to show real quick this is my IP. What I'm gonna do is I'm gonna go to my party session. And I'm going to type it in the IP address ten to 53 dot one dot 59. And her route. Putting the password and the hair you when you type C, this is that terminal. It's command line terminal is not a GUI. But the beauty here is you can also run an empty UI right here on this GUI. And it will give you the same menu as it is giving you right here on the GUI. So you could do it here or either here. I will do a here because while I'm going to go through creating a team or bonding, I'm going to lose never connection. So you've got those never connection. I'm going to lose the recession as well. So it's better. I'll quit that. And I will only use just this canceled. All right. I'm going to go and type it in T M. And MTU I again and edit connection. And I want to delete this E&P S3 to meaning not completed leading but deactivating. So this way when I'm creating the network teaming, then I could add both of these adaptors and then activate them. So Selected, move your cursor to the right, click delete and delete confirmed. Okay, so now it bridged adapter is there. If it shows up again, click, simply click Delete. Okay, now you see it's gone. Now move your cursor right, click back and then quit. If you do. If Config, you will see the both adapters are there. E&p, 0, S3, and eight, but doesn't have an IP because I deleted them. So if you see I have my party connection that is also gone. That's why I was you the console. So let's close this window. Now let's go back and type in an empty UI again, and let's create the team for that. What we'll do is edit a connection, moved to the right. And you see right here says add. And right here, just select the type of connection you wish to create. And I wanted to create bond, which I'm now using because it said a bond is an older version. We'll use a newer version which is team moved down. And right here it says team, hit enter. It's asking what is the profile name? What do you want to call that team? We created, we chose a bond one previously, same thing will chose Team 1 for this device and M dash team will leave that as is hit Tab to come down. And right here's his team slaves. Now pick those network adapters that you want them to be part of this team. So hit Tab again, I will move to add and hit Enter. And now select the type of slave connection you wish to add. We are selecting the Ethernet now because those E&P as 38 are on Ethernet, hit Enter on Ethernet profile name. I'll pick the profile name same as my network adapter named E and P 0 S3 device. This is same, e and p 0 S3. And I could assign an IP to make it static IP. But since we're just doing this in the lab, we just leave it as is on the DHCP. But if you do want to assign IP, you could right here. This is our edit. No, sorry, we will go back and assign IP in the next section, I'll show you in a second if you wanted to create a static IP. So just here, but simply go ahead and click Okay. So E&P 0 S3 added. Now go back and click Add again because you want to add it to network adapters. Internet. I want to call it u, the net, E and P 08 devices, the NPS or eight Ethernet show. This is the if you wanted to specify the Mac or clone, but it will pick up from the device name itself, come down and click. Okay. Now you'll see I have for both of these added to this team one here where I've say IP configuration right now it's automatic. Now if I wanted to assign a static IP to this team adapter, I could hit Enter and change it to manual. And I hit manual, then it will come down. And when I click here, I here show, come down right here in the show, you will have this IP address. If you have already IP address that you wanted to assign, type it right here, gateway DNS, search domains and all the information that you need that we were adding it previously into those configuration files. Now you just have to add them right here. And it will add that configuration of the parameters for you into those configuration file. Anyway, go bad. We don't want to have a static IP, we want to leave a DHCP. Therefore we are going to, all right, Let's come down. Automatic, leave and hide this information. For now. Ippes for configuration is automatic. Ipv4 six configurations automatic, but we are not using that. Make sure automatically connect is checked, available to all who is shaped. Go ahead and click, Okay. Beautiful. Now you see you have right here Team 1, and this is your team adapter that has both of your other adapters, E&P as 38. And I want you to move your cursor to the right. And come down and hit back and go ahead and click Quit. Now, when you do ifconfig and pipe it to more, you'll see E&P S3 has no IP address. E&p S8 has no IP address. Then come down right here. This is your team and network team. This one tells you it has given this IP address 1053 dot one dot 59. Or maybe in your case, if you're using a different router, which we were using it earlier, you're going to see what 192, 168, 1 dot whatever. And then it's telling you the Ethernet, the information that it has to be its network teamed. Okay, now, let's verify if I could use that IP to log into this machine. So this way we will know that team really works. So what I'll do is I'll go into a party session and I'm going to type it in that IP 10, 53 dot one, dot 59. Bingo. I got there the login prompt. And there it is, I have my command prompt, so it means it work. Okay, so that's pretty much how you could use m Btu I command. There are other commands, sorry, other functionality within an empty UI that you could use, which is to activate the system, which is a separate system host name. Or if you go back again to edit a connection. And let's say if I want to add a new connection, then I have these different options. Wi-fi, Bond, Bridge, IP told, and there are so many other functionality that you have within that an EMT you are. Okay, I'm gonna cancel this. And I'm going to cancel this and quit this. Okay? Now I'm going to minimize this console thing. And I'm gonna go to my command line. And this right here. Now I'm going to show you the NMC. Now, for those who don't want to use an empty UI, which I don't know why you wouldn't use that. Then you have another option which is a command line. So if you do CLI and M CLI, you will see your teams, your network adapters, what kind of information it has, its IP address, what IPs assigned. Okay? And there are other options that you could use with an M CLI for example, and MCL icon for connection show. And it will show you all three connections, E&P, S3, NSAID, and virtual bridged adapter. These are the actual physical or an arc, it's virtual. And this is a team that we created on top of these two adapters. Okay? There are many, many different commands, many different options that you could use a using NMC CLI. And if I'm going to show you every single one of them, it's going to take me forever. So I will recommend you to go search online and find out what are the different options available under NMC ally. But my that's my advice to you is to stick with an empty y, which will give you everything that you need. And going forward, it's going to be very, very helpful for you to use this command line. Alright, the next tool that I wanted to talk about, and I'm connection editor. So that is only an only available on your GUI. It's now going to work here on this terminal polytomy. So let's go back to our GUI. Let's clear the screen and this time let's type and M dash connection. Hit Tab and it will autocomplete for you and hit Enter. Right here. You see, this is, uh, this week window looks exactly the same as if you are running the NMT UI right here. So if you wanted to make any changes to the existing no connection, for example, Team 1, you could select it, click on configure or settings. You can remove that or add a new one. So let's say for y to modify this one right here, Tm1, the settings right here, the team that never connections. The adapters that we added are 0, S3 and zeros, eight IPV setting DHCP, same thing. If you wanted to change it to the static, then you could change it to manual and sign your IP address. Go ahead, click cross on top right. So if you could close a window, if you wanted to add a new connection, you could do choose a connection type here you have, if you notice closely, you also have the same option that you had on an empty USE right here. You could create a team using this GUI as well as this one. So it's pretty much the same. But it's easier for those who like to do in the GUI. But of course, as I always say, is in corporate environment, you are not lucky enough to have these GUI Windows or gui at all. So that's why I stick to an empty why? So let's close this window. And the last one I want to cover is genome settings. Genome as your desktop. Right here. See, this thing is your desktop. So let's see. If you go to Application and go to System Utilities. And the system utilities, you're going to see either here or maybe System Tools. It's courses and Tools and go to settings, yes, right here in the settings. Now this is the genome settings. Here you have a Wi-Fi settings you can modify. Or you could come down and right here you see network. This is where you could change your network as well. A modify your network the way you want you go to setting or you add adapter, move adapter, anything you wanted to do. But this is only available to you if you have this Genome desktop. Again, coming back to the same thing, most likely you now going to have in corporate environments. So once again, stick to an ETU. All right, so I hope this lecture, this entire lecture gives you a lot of information about not having to remember all those configuration files. All you have to do is simply use the NMT GUI command, which is a newer one. And it is widely available on Red Hat aid and you should be using this one instead of modifying the configuration file manually by yourself. Okay, So remember we created a snapshot. Now what I want you to do is shut down this machine. And this will give me an error message. The system is going down. Let's close this x2. Okay, Let's close this power of the machine. And right here it says restore current snapshot 2, second snapshot. So go ahead and click this one. Okay, here's another thing. Remember we created, we took, we went to the settings and we added a network adapter. Now, it's unchecked. The reason it's unchecked, it's because we revert back to our snapshot. So go ahead and delete this snapshot. Delete it, it's gone. And go ahead and start your machine just to make sure you do have EN PS3 and it is active, enabled and up and running. Okay, we just did IF config and I notice he and PS3 is there, E&P aid is gone and S3 is, has an IP address and it's a well bowl up and running beautiful. I'll see you in the next lecture.
122. Downloading Files and Apps: downloading files or applications well in Windows when you have in those machine windows PC or laptop, if you need to download anything like an application or a game or a file, what do you do? You actually open up your browser type end the the link in the URL. If you know the exact link and you click it, it will take you to that page. And then you click on that download link again the next one, and it downloads it right right here. But in Lennox, we don't have the green. So how do we download a file, or how do we download an application that we need to download? Well, there is a tool in Lenox that's called W get W stands for World Wide Web. And get is, of course, to get it. So get it from worldwide or to the Internet. This is the command that you'll get an an example off. Um, off the command is w get followed by the exact your URL where the file is located. If the file ends with hot tar or dot zip or dark M s, I whatever that is, you specify the entire you, Earl in the w get command. Now the question is, why? Why do we even need to download any file or any application or any program in the Knicks? That's a very good question, right? But there's one thing that you missing and that is the jump command. You're probably thinking off the jump command when you have a limits machine and you need to download any in package or any file. You could just simply go to Jum, followed by the name off the package of the file and then install and it down so it loads it for you is in this example. You have a server and the server goes to another server. To get a file in this case is the server is a mirror or the repository where the young goes and install the packages. But that server does not have that's filed. If you're looking for, then it goes to another server. Our computer will go into the server, but that server is not listed as one of a repository. So what do we do? How do we get that file from from that server to our server? We get it through the w get command and that's how we install it into our machine. So let's take an example off our Lennox machine. I will run the w w get command in our Lennix machine and see how it works. I will run it through the putty. But before I run into the party, what do we need? We need the I P address off our party said sorry off our linens machine and how to find the I. P. This is something that you should know by heart. So I have 100 to 1 68 $1.12. I'll put that in hair 19 to 1 $68.1 dollar 12. I will log in as myself. And the reason I have this I p instead of 19 to 1 68 56 1 a one is because I have in my washing machine. If you go to the setting and you go to network, I have bridged adapter. If I had, um host Onley adapter, then there would be a communication between laptop and this was a machine. But now I wanted to actually go outside off the network. So that's why I have this bridge adapter. And how am I connecting on my laptop on my desktop is to the wireless, right? So just make sure you have these settings, so I do. And I know I have this I p address have used to put he had put a day i p address. I'm in now. I'm just simply going and minimize this. And I would minimize this as well. And I will take an example off. Let's say I want to install, um, putty in my Lennox machine. So in order to install it, you have to run young command. And before you run jump command, you have to be route. So I'll do John party install. That's a command right to install any kind of party or any kind of packages or file you're looking for. Okay, So the young went outside to his repository and asked, Do you have the packet putty? It says no. I can't pseudo command putty, please make sure jump. Uh, sorry. I did run the command wrong. It is young installed buddy. I'm sorry, but it's OK. Mistakes happen, right? Okay. So Yom installed putty your head and enter and then you'll see the end. It says No package putty, available error. Nothing to do. So it did go out to the Jum repositories. It did not find the party package. Now, this is a perfect example. Now, at this point, I do need a party package, formal itics machines. And what do I do? Well, you need to find out where the link azure l of the police station is. So I'll go into a browser, and I will type in google dot com and I'll go to download Puddy. I'm just going to the vendors machine and to the web browsers so I could get the link to download a party. So this is a package for UNIX source archive. This is what is the one have to download, So all right, click to it. Oh, go to copy link location. So it has copied the link location. I'll come here and just type that location here just to make sure that it does. Show me that it will. Don't know the file. Yes, it will see. So you just cancel it. Now you go back to your Lennox machine, and now, at this time, you type w Yet it's a long length. So Just make sure you extend. Maximize your window space, you right Click on your keyboard and it will paste the entire Europe for you. So this is the euro. And once you hit enter. See, It is connecting. It is downloading. You see that? Amazing! Amazing. We have that package now. Where is it? It will be downloaded in the current working directory where I am. And where am I at this time? That's a PWD. I'm in route, so it should be in the root. And this is it, buddy. Dive, zeroed and version that hard up GXE. So that's the reason we need that. W get command. So So people or users or developers who cannot find their packages that are on 1/3 party Wenders website. They could use w get command to actually download a file or package or whatever that they're trying to install.
123. Curl and ping: curl and pin commands. What do we need them while those two commands are so useful when you are troubleshooting system network related issues. So if you are system administrator and you get a call from someone and says, Hey, Mike, my the server is not reachable or this machine is out or down, or I cannot pink this address or I cannot reach this website. So what are the first few things as you need to do? Well, first thing and our that you try to communicate to that server yourself to see if you could reach it, right? So how you gonna communicate to it? So there are two very basic commands or one of them is curl, and the 2nd 1 is paying. So you have this Google website that you go on windows, you log in, you go to the dot google dot com Perfect. You could reach it. So you know how this But what if you clinic system, you don't have the gooey or you can open up a browser, you have to find out, um, how that works, right? Just like the w get command. So for that we have in Lennox, we have Cool. Now Curl is specifically is for the euro. So as you could see it, see? And then you are l So you grab that your and see whether you could get to that Pacific http site so you could ping the site. Let's a few up in google dot com. It will come back with the i P address. It will try to ping that I p address and you will see Hey, the servers up. OK, but if the service of what if the page is not up for us over and the page is actually run by what it's run by a party, right? A cdpd What if the server is up and pages down? Then you need this coral command, which is very handy command to find out if that pages up. And of course, the other one is the pink paying you you ping the server. If you are sober A and you want to see if the server be is up or not, you ping that server by its host name or by its hype i p address. So ah, the example and Lennox for curl is that you specify the http um and entire Doral. And it will bring you back the content off the page. Exactly the way looks when you open up a browser. But it will bring up all the HTML source code, most likely or some other information. But when it brings it back, it means that page is up. Then you also have curl minus Oh, uppercase. Oh, option. If you want to download a file, remember, we could use w get command as well. Well, in some computers. If you don't have w get you could use Curl Command to tell Lord are filed your next machine . And of course, at the end, we have paying. If you want to Pincus over by host name, which is, let's say, google dot com or your system host names with a fully qualified domain name. You could use Ping command. So we will try Ah, curl and paying one by one in our Lennox machine. So this is my looks machine And this time I wanted to log into the links machine through putty. So before we get into the party, I need to know the I P address off my legs machine and my i P addresses right here. You'll see when I went to 1 $61.20 So now it, if you see that 18 to always comes up if you have the network adapter set as bridged adapter And if you are connecting to the Internet to wireless, make sure the name is connected to a wireless or if you are hard coded with the choir than you pick the wire cable connection in the name anyway. So you I know that I p address. Now I'm gonna open about party session and I'm gonna put in my I p address 18 to 1 $68. Wanda 20 I believe, has confirmed one more time. Yes, it is 20. Go ahead and click open Log in as root. Okay, So I am logged in as root who confirmed that I'm rude and also by the prompt right here. It says the prompt is pound. So I'm gonna make this a little bigger as well. So now let's say if I wanted to go to a website and I wanted to make sure that website is up or not. So let's try our simple website. As always, Google hit, enter and you see all that stuff that came up on the screen. There's so much other stuff, too. But you don't really need toe worry about what that stuff is or how to decrypt that, or how to understand the HTML to understand that all you have to do it. If when you run the curl followed by the host name or the rural, and you get this entire page with HTML coding and stuff like that, then it means that you your website is up. You could reach it good. So if you want a pink it so you could do paying. Www dot google dot com This will on Li Ping the I. P address of the Google. You see the I. P address of the ghoul right here, 216 58 to 17 68 so it could change so you could paying it by the host name, which is cooled out comedies Ural or you go paying by the I P address. So let's say if I ping Goodbye I Pierre. There's 216 0.58 to 17.68. We'll see you getting a response back, and that is Google, you could always do. And it's look up on this to find out which website is that. And you will see this website belongs to Ah, these names, um, and these names translates to which is the point of record translates to Google. Anyway, what if you wanted to download a file from from the Internet using Curl Command for that, you need to know the exact Buehrle for, um for the file that you're downloading. So I have on my, um, browser, I have, um a page open, which is download party. So if you know, you could just go to, let's say, Google and and type download Putty it will bring to bring you to this page. Click on go download and you see right here this is the dot M S I file which runs on Windows. We're not trying to download on UNIX or anywhere but in Windows. Then you could use this one if you're trying to download on Lennox and you could use this one anyway, it doesn't really matter for this lesson, because I'm just trying to explain you how you could download so you could pick anyone. Let's say if I picked this one right click on the link and you see right here says copy, Link, address. Click on that. Once you copy it, you could verify the link by opening up your note pad, and then you could paste it. Here. You see, this is the entire link for that tar tar GZ file. Now go back to your putti Citian. And now this time type curl dash, uppercase oh, and right click, which will paste your copied link to your screen. Once you have that, go ahead and enter and you'll see it's downloading it. It tells you the statistics off the download now Is it downloaded? Where is it downloaded? What it will download which ever director you are in. You are in slash route So we are in route and let's say if it could wear If I do ls minus l . And you will see right here. This is the file that we just don't load it today with today's date and time. So this is how you don't load if you don't have w get or if you want to specifically don't know. Through the Ural Disc, Earl and pain commands are very useful Also, a lot of people in interview would ask Tell me the commands or different ways that you could troubleshoot. If a server a cannot re server be then you could simply mention that you're going to use the ping Command. You're gonna use the coral command If it's ah, February. Well, you're gonna use different commands to check it. Um, also going back to paying if you're pinging Google and you will notice that this is going to ping continuously. Now sometimes if you are on Windows Machine and you try paying ghoul ill pink it three times and will stop. So to use that ping on a Windows machine, you would have toe, I believe, used the option minus s or minus t. One of those options will please try it. Um, no, I'm I'm very sure that's one of the minus two. Your mind side s option. I'm not I'm sorry. I don't have the exact option, remember? Right now, But try those so it will pain continuously and you will see the packets are dropped. Or of what? How long is is taking for the ping to go and paying and come back. So these are the two basic commands that I wanted to cover with You try them out and, um, just play around with it, all right?
124. FTP File Transfer Protocol: hype in this lesson, we're going to cover FTP, which stands for file transfer protocol. The FDP is a standard number portal closures for the transfer of computer files between a client and a server on a computer network. FTP is built on a client server model architecture using separate control and data connection between the client and the server. This is the definition that I have. I have actually got it from exactly from Wikipedia in very simple words. And FDP is a protocol that is used to transfer ah file from server A two server be. Now that the Pearl call is actually a set of rules used by computers to communicate that that's a pearl call that tells the computer Hey, this is how it should be transferred. This is the poor that you should use. This is encryption that you should use. These are all defined rules that are already built in. But then a computer and operating system for the FDP. The default FTP poured is 21 just like for Ssh, we have 22 for DNS. We have 53 for many other services that we run in the next for FTP the use port 21 to communicate for one server to another. Now, for this lecture we needed to Lennox machines. Um, if you do not have to links machine, I would recommend you that you should go ahead and build another Lennox machine running Cento s, which could be exactly the same one as you had previously. So my first machine that I've been using is my first Linux VM. This is Ah, host name and the second machine that I created and I'm referring it to as the host name as Lennox Cento s seven. It's just a word. It's just a name that I picked. So anyway, I'm sure you already have my first Linux VM cento s v m. And what you need to do is to install another Lennox Reum. So if I give you a quick information on the ARCA virtual box, you see, this is the first vm that I was running and this is the information it has. Um, one gig mint machine 10 gig, remember? Sorry. Dis space. That second machine that I'm using as a server is also has this meat. Same specifications 10 gig one get everything. Exactly the same. Even I'm losing the same version of Santos as well. So But I am using a build a 2nd 1 so we could go through this. Let this Lex lesson. Sorry. All right, So to put in a graphical way, let's go into detail. So we have a A client. A server that needs to send a file to another server is called. It's over A and several B. And whenever you have one server trying to connect to another server, that recipient becomes a server and the sander becomes a client, so it wants to send a file or FTP protocol. Now, if this is the recipient server, if it's not running any kind of listening service to receive that protocol, then it's gonna reject that, um, that transfer. So we need to make sure that it is running ftp de demon or the service or the application on that server, and by default, whenever we run it, it will start up that service on poor 21. All right now, what is the process to actually configure that on Klein and server? So let's look at the server side first. So here are the quick step that will cover to do the installation configuration off FTP on the remote server. Um, after becoming a rood, will check of the house FTP server installed Will check If you have Internet connectivity, will install the V sftp deep package on the server and then we'll modify the V sftp D dot configuration file and in that file will make certain configuration changes, and these changes are here listed. We'll go over them one by one, and that will start. The service will enable the service it could start a boot time. Ah, will stop the firewall d so the communication can take place between sober eight and several B. If you wanted to leave yours of horrible d up and running, then you have to add a rule for it to allow to accept port or traffic 21. So traffic on port 21 you could find that online how to add FTP, um, port on the firewall D. And then you could disable that firewall D. If you're not using it, just disable so it won't start back online. And the last step is, of course, make sure you create a user account on that FTP server if you do not already have it because that's that's that Comey will use to transfer file from Celebrate Too Soon. Will Be and the Last Port Are part would be the will install FTP client on the client server will become ruled Yemen Saul FTP become a regular user and then we will create a file called Krueger. Now, this is just a regular file. You could actually use any file name you like. You could pick pizza, pasta, whatever the finally. But if you want to be consistent, staying with the just make a file called Krueger Once with filers created, then we'll ftp to the server who enter our credentials, will put in a B I for binary hat and then had for hash tagging that so you could see the progress and will use the command. Put Kruger once it's trash for them to be simply type of bias to get out of that FTP process. All right, so now let's let me go back to the installation process off FTP on the server. All rights, as I said, for that I have a client, which is my first, and it was just the very first Linux VM that I created and I called it my first of the next PM And then I have another machine that I'm using for this lecture purpose. And then that that machine I'm calling Lennox Center s now in this machine. Once you have it built and configured, I want you to become route. By the way, I was logged in as myself. So if I exit and I do, who am I? You're going to see that on this server. I have already created an account I absolve. So if you do not have a camp during the installation created, go ahead and create it. If you have it good and become rude after becoming rude, of course you could do who am I just to confirm of which is residual logged? And as now you need to install the FDP demon or the FDP service on your machine before you install it. Check if it has already been installed. So I recommend you type RPM deskee way and group for V S f t p d. This is the name off the package that needs to be downloaded. Okay, it is not downloaded, and it has not been stalled. So I will run the command before I run the command. Or before I go out on the center s repository to install it. I wanted to make sure this machine that I'm logged in right now has Internet access. So I'll do. Simply paying a dub dub dub dot google dot com. And you see, I'm getting a response back. Perfect. It means I have Internet connectivity. Now I'll go ahead and do jum installed v sftp d now disk. A man is going to the older repositories and it is checking. Hey, do you have the S f D ppd package that I need to download and then installed? It did. It did go there. It checked, and it says, Yes, I do have it. And this is for architecture 64 but And the version that I have the latest one is 3.0 dot to do you want to download and the sizes 1 71 case? Yes, I do want to download. So simply type y and hit Enter is saying downloading package and then it's saying it has a fingerprinting, some information, some security information. Is this okay that comes with the package. That is fine. Go ahead and click. Yes, Running transaction check running transaction test. It will go through the process off fetching that package, downloading the package, installing the package and then verifying the installation. And at the end, you say it is completed and verified. Of course. Now, if you run that same command rpm desk, you away and grow for V S f d p d. You will see it will show up the package that is installed. There you go. This is a package that installed So we confirmed that it has been downloaded and of course , it is installed. Now we need to configure it. So every time you hear the word configure, it means we have to configure it on the configuration file. The configuration file for FTP server is at CVS, F d p d slash ves ftp d dot com file. So, before I modified, I always recommend that you make a copy off it. So let's go to see d v sftp d do ls minus. L t r. And you will see this is the file. Now, I want you to go ahead and make a copy of that So copy CPV sftp d dot cough the sftp d doc off dot or Ridge, This is the name I usually pick to make a copy as its reads. It's will tell me that this is the actual original thought. All right? The copy or the backup has been created. Now I need to modify that follow v sftp d dot call. Well, and now I have to go through these parameters that I have listed on my slide it to modify these parameters. The first thing is fine the following lines and make the changes as shown below Disabled Anonymous. Log in. So I will search for slash a and O and M. Sorry. Y m O U s anonymous. It took me to the first word because I'm doing a search within B. I took me the first word, but this is not the line that I'm looking for. So I'm gonna hit and need to go to the next one, and there is, says, anonymous underscore enable. And it is yes. So go ahead and remove that and put no, because you don't want anyone else to come into your FTP server as anonymous. Good. Next parameters is A S C II A scuzzy ice. Ah, And now you have to uncommon these two lines. Upload enabled. Download enabled. That's perfectly fine. Now come down to where is his F t p D? Search for that? And there is his f DPD underscore banner. Welcome to block FTP server. That is fine. And you could remove that uncommon t'd. Now, if you want to change to welcome to Bly FTP server to welcome to my beautiful FTP server. That is fine. You could do that. Now, the last thing it says add at the end of this file, if you want to go to the end of this while you have to press shift E g and it will take you to the end. And here I'm just gonna put first. I'm gonna put comment as local time, and I'm gonna put in that parameters. Says use underscore. Local time equal. Yes, Perfect. That's Onley. These are the only configuration changes you have to make. I'll go ahead and save the file. Perfect file is saved. Now it's time to start that V sftp de service. And for Dad, we have to use the command system. CTL start v sftp d It is started. Let's check the status if it is actually started or not. Yes, it say's started. See, Active here. Beautiful. Now I want to enable that. So every time my system reboots, I don't have to go back and and start that service manually again. I, wanda service to start every time the system reboots. And for that I have to use the command system CTL space enable V S f d p d hit enter. And it is It has been enabled Now Perfect. Now I want to disabled the firewall on this server to disable lead. I'll use the commence before I disabled. I need to stop it to stop firewall D. Now, As I said earlier, if you do not want to disable firewall D which I don't recommend you, I'm disabling it because this is my lab environment. So I'm okay. So if you're in a production environment and you have, I will de running, then you need to add the rule toe. Allow poor 21 2 in as an incoming traffic for their firewall. Anyway, going back. Let's stop the far wall de because I'm using my lab and I'd really don't need that. It is stopped. No, let's check the status. See? Right here it say's inactive. Dead. Perfect. Now I want you to disable it. Meaning every time My computer reboot. I don't want this service to start back again. It is disabled. Perfect. Beautiful. We did out work on the server side. And the last line you're going to see it's his user at I absolve if the user does not exist already. I mean, I do exit out off the root and I do Who am I? You see, I already have an account. My account IVs all on this machine. So I don't need to recreate if you do not have the account or if you do not have an account that you will be using for the FDP purpose that I want you to go ahead and create an account. Anyway. So this is the configuration we followed on the ftp. Sorry. On the FTP server. Now we have to do a few things on the FTP client. So the client needs to install ftp the package and for to do that, let's go in to our client and my client is right here. This in my first links via perfect. Now here. If I become route whether I was logged in as I absorbed. Now if I run FTP command, you see it say's bash FTP command now found the reason it is not found because I do not have the ftp Klein installed. So I need to install decline. No, of course. As I said, Always checked to make sure you have Internet connectivity and for that pink any website that you like online and it say's I am getting their spots back. Perfect. Now I could go ahead and do jum install ftp now. This is not the V sftp d. This is f'd piece of Eden year insulting the client part here, not the server package. All right, so once you do John men stall ftp, it will go online. Check for the package and it says running transaction check package. This will be installed. Perfect. This is what I want. The version number so and so. And the size has been 61 k That's perfect. Good. Why Look, a transaction tests succeeded verifying it, installing it, verifying it, and completed. Beautiful. So now if you type ftp and just simply hit Enter, you seal. It actually took that command, and it brought you into the ftp interactive session. You don't want to use that right now. Just click buy so you could get out and get your prompt back. Now I want you to become I have zala gain you could do s you dash. I have salt. Or of course, in this case, it's yourself, but or you could just simply to exit and we'll bring you back to your own user account I've saw. All right, so if I do ls minus. Lt are these other directories and files I have right now in my ah, home directory. So this is home directory. Okay? Now I want to create a file called Touch Kruger. It is created if you do Alice myself here. You see, it has zero bytes, and right here it says zero bytes. If you want to add something to it, it's a I will do ls minus. Lt are. I'll put that to Kruger. Perfect now. And you do all this mind? Lt are you see? Now it has total of 517 bites. If you do cat on, Kruger. You're going to see basically the output of Exactly ls my SLT are. Anyway. So I Why did I do that? No reason. I just wanted to have some information in their file. You could have done V I and typed in something else like the I Kruger. Like, this is my file. Blah blah. Anyway, I just wanted to populate that file with some information, so it won't be zero bytes now. Right now it has 545 bites. Alright, beautiful. We're moving along. Now we have the file. Now the question is, I want to trash for that Kruger file to the server. Then the server is the one where we installed that FTP de package. So in order to trash for the file over to server, we need to know the i p address of that server. So I'll go back into my server. Doesn't my server for the i p. Address al type? If config. And if I move up, you're going to see the I. P. Address for E and P zero s three. The signed one is 1 90 to 1 $61. 58 perfectly. Got the I p address Now I'm gonna do ftp 1 90 to 1 68.1 dot 58. Hit. Enter. Beautiful. There you go. Says welcome to Bly. FTP Server. See that black thing? I told you, if you want to put a like, beautiful hair would show Beautiful stare. Okay, so anyway, it stays Name and I p address and user name is Ives. Also by default. It picked the using name that I've been trying to ftp or if you wanted to use a different user name, then you will specify. Here. Let's say you want to use John or whatever, but I wanted to use my own name. I was also I'm not gonna enter anything. I'm gonna leave it as default and I'm gonna go ahead and hit. Enter. Please specify the password. This is the password off your eyes. All account to that server or to that remote machine. It says 2 30 log and successful remote system type is UNIX using binary motor to transfer files. Perfect. Now what I need to do, I want you to type B I or been as switching to binary mode because you wanted to transfer the file always using FTP to the binary mode. That is fine. Then I want you type hash hash meaning when you doing the trash for Show me the hashtags which will show which will tell me that there's a progress going on in hashtag progress now time to put the fall So whenever you when it's time to trash for you use the command put because you're going from a to B and do cougar hit Enter right here. It's a Z as soon as you hit. Put Kruger Local cougar remote and drink Passive mode 150. Okay, to send data hash tag. Remember this the progress If it If it was a huge file, you would have seen so many hashtag to 26. Transfer complete 5 45 bite. Since this is the size of the on my file 5 45 cents Succeeded succeeded. Perfect. Now you could just do by now. You're back out to your machine now. Do you want to confirm on the server of has been transferred? Of course. Yes. Let's go to server. I am in my home directory. Unless to a less minus. Lt are and you're going to see right here. This is Kruger. This is a file transfer. That's how the FTP file transfer works. I hope this lecture actually have served its purpose. And you know how the FDP works. If you have any question, please do not hesitate to contact me. I'm here to help you. So let's go and work this FTP server and learn this thing together. Good luck.
125. SCP Secure Copy Protocol: hello And this lesson we are going to cover SCP, which is secure Copy protocol. The secure copy poor coal or SCB helps to transfer computer files securely from a local host to a remote host. It is somewhat similar to FTP, but add security and authentication. So if you are transferring a file again from server A to sever, be you could use as CP as the protocol of the command rather than FTP. And the reason it is preferred is because it is secure. It adds more security and authentication. Now the protocol is that said before the Pearl call is a set of rules just by computers to communicate. So and SCP was built, they decided, OK, this is the protocol that SCP should use and this is the port that should be used to transfer a file from one server to another. The default SCP port is ssh are poor 22. So there is no different protocol that was established or set up for SCP. So it actually leverages onto the same as the sage protocol every used to connect from one server to another or ssh Now for this lecture again, we needed to Lennox machines. One is for the client and one is for the server. Decline is where we have the file. And the server is where we want to trash for their file too. For the client, I have my limits machine and it is called my first Linux VM. For the server, I have a server which is exactly the same as Klein as well. But I named it Lennox Center was seven. So the process is SCP perk. The process in the graphical way is you have a client, A and Klein be server now. Client A wants to copy. Ah, file over to server. Be now. Evils use the protocol SCP or the Commander CP. But it Ashley scratch for that over through the protocol we already have in place. And that is ssh. So there is no new particle for that. It actually piggyback on Ssh. And of course, the ssh port is 22 the service for SS age demon should be running under recipient order Remote server in order to accept Engram Incoming incoming traffic. Okay, what's the process? The SCP command to transfer files to the remote server. First of all, you have to log in yourself, then create a file any fall. Let's say V in this Ah, in this lesson or in this lab, we will create a file called Jack. Once the Jack fall is created, then we will simply run the command SCP That finally, in Jack I absolve is a user name that actually exists on their remote server at 1.2168 1 dot exe is the at the actual I p off the remote server off course replaced that expert the digit that is the digit off your remote server. And the last part is cold in the slash home slash I have. So this is where you want to file to go to in this directory on the remote server once is connected, then it's gonna ask you to enter user name and password, and it will transfer the fall successfully. Now enough is enough. Let's actually start our Lennox machine. Um, which I have already started. And I have already logged into my party. This is my legs machine, and I refer to as my client machine because this is the one that connects to the server and this machine host name is my first Linux VM. Who is logged in. Who am I? I'm logged in as myself. But I followed the directions here. I'm gonna create a file called Jack in my home directory in my home. Director slash home slash I have solved. I'll go ahead and do touch Jack, and I do ls minus. Lt are. You will see. I have a file called Jack. It has zero bytes. Now. I want to transfer that. But before a translate put something in there just to make sure it is transferred with the right content. So let's do V I on Jack and just put, um, Jack is Jerry's, um, uncle, That's it. Do ls minus. Lt are now. You'll see. It has total by 22. Perfect. Now we need to trash for this file to our remote server. But before we trash for the file to the remote, sir, where we wanted to know What is the i p. Address off that remote server? So I'm gonna go into my remote server, which I also have it opened. And I'm going to do if config e and P zero s three. Because that's the interface where the I P is assigned and the I P is one I to 1 68 $1.58. Beautiful. Let's go back to my client. And now this time I'm going to run the command. That's clear the screen so you could see it better. Now run the command as cp the name of the file which is Jack, the name of the user who was going to log in to the remote server. What is a remote server? 1 90 to 1 68.1 dot 58? Yes, and then colon slash Where is it going? To a rich directory. It's going to home. I've ZOLL had enter, and it's gonna ask you for the password. If you are doing SCP for the first time, that is gonna ask you for the fingerprints where you have to type and yes, and then enter the password. So go ahead and password, and it say's a jack, which is a file name. 100 person transferred and the size was 22 this is the time it took to trash for Okay, I got this message on decline. But let's confirm on the server whether it was transport or not. So first of all, it was transferred as I absolved, so I have to log in as I absolve. So who am I? I am I absolved. Beautiful. Now which directory and my logged into I am in my home directory? Because that's where I transferred the file. Right now I will do ls minus. Lt are to check if that Jack Fall came in, It did. Perfect. Is this the right file that came in List Cat it. We did. The cat Jack is Jerry's uncle. Perfect. This is how the SCP works. And you could also do the same thing, by the way as cp to go into this remote server. If you want to pull something out of that server from server to decline and you have just have to reverse the command anyway, try it out. And these are the couple off commands, a few commands that wanted to cover and very important commands. When you are dealing with transferring file from one server to another
126. Rsync Remote Synchronization: hello. In this lesson, we are going to look into our sink. Yes, another utility to transfer files from one machine to another, or copy from one machine to another, and then our sink stands for remote synchronization. What exactly are think is? It's a utility for efficiently transferring and synchronizing files within the same computer or tour more computer by comparing the modification times and size of the files. So basically trashing file from 18 subway to sever B and the way it works efficiently is because it looks at the modification time to enter sizes. If the sizes let's suppose to gig, it will transfer the first time to kick it. The second time is four gig. It will only transfer the change, which is to get not the entire forget. I'll tell you a little bit more about it. Now the our sink is a lot faster than those tools. Like FTP or SCP. This utility is mostly used for the backup of files and directories from one server to another. A lot of system administrators and engineers actually have our sink commander utility running in the Krahn tab to actually copy files everyday files of modified files from one server to another as a purpose to back them up the default arson port as 22 which is the same as ssh that as s h uses. So there is no arsenic server that you don't need to install on the remote server to accept the incoming traffic. It is going to use the ssh particle just like SCP uses the same protocol s a sake. Our sink does the same thing. So it piggybacks on poured 22. Ssh! For this lecture again, we need to Lennox machine because we need to test from copping or synchronizing files from one server to another. I have my first machine is my first Lennox VM, which is I refer to as Klein because I transfer files from that machine to another. And what is another machine is my server, which is which I created another center as a VM Ah, and I named it Lennox Cento. US seven. It has the same specifications as the first machine that I created. Nothing changed. The only thing change is the host name. All right, let's look at Mawr on an A graphical or a diagram way. So I make you understand how the are singularly works. So you have a server, A or client that needs to go to server be. And he needs to transfer those files over the utility. Our sink now are sinking uses as a sage or piggyback or ssh to trash for the files. And for that, you need s sensation de service running on the destination server where the files are going and a poured by default for S s h E d is 22 now it what it does the arsenic it actually copies and and and copies the destination. Keep the same copy the same size and and the time from source to destination How it works. Let me show you right now, if you have a two Meg, the size of the file is to Meg off a file. It transferred the very first time, the exact same size to Mac. Next time someone comes in and change their file, not a flower size. Become from two meg to eight. Meg. So now you need to trash for this file from server A to serve a B. So now this is the beauty off our sink. It is not going to take your entire eight Meg and copied over again. It will actually subtract those to make that was copied earlier and Onley copy the wanted that the difference in the file Just six make Meg. And then, ultimately, the first half or the 1st 2 Meg plus the six Meg it's gonna make combine them together to make it eight Meg. Similarly, if the file grows from eight Meg to 20 Meg, the our single, it subtracted the difference. And on Lee transferred the difference over to the destination server. All right, let's look into the technical side how the command works. So Basics Index of Arson Command is our sink space. The option. If you want to specify any option than the source, what are you copying or transferring? Destination? Where are you copying and which location? Install our sink in your Lennox machine. So first thing we need to do is if harsh sink is not already installed or the command is not available, we have to install that utility, but first, before you go ahead and install, check if it is already is installed. So if it's not Dujan, install our sink and sent to us. Red had distribution in a bun to day being you do apt get install our sink, then our single fall on a local machine. So you need to copy a file from local machine within local machine. Um, you need to do, Let's say, if you want to tar. Um, So for that, let's create ah ah, back up off the entire home directory and we put in a tar and then we back it up. Well, our sink, a director on the local machine are sync a file to a remote machine and we'll are sync a file from the remote machine. All right, so these are the steps we will take. So I know it's a lot of information throwing at you, but we'll try one by one, and I'm sure you'll understand by the time it was done with the sector. So I have my limits machine open. This is my Linux machine, which is my client and which is my first Lennox VM ups. Okay, now what I need to do is I need to make sure I have the our sink package installed before I actually go in and do jum install. Let's do our PM Dash Qiwei and grew up for our sink. Beautiful. It is there, by the way. I am logged in as myself and again. My host name is my first experience. And to check if the package is installed or not, you don't need to be route. You could just simply run rpm deskee way. But if you need to install a package, then yes. Then you need to run Jump Install are sick with the root credentials. All right, now we have confirmed that we do have our sink package. Now let's get into the fun part. Where you going to do the are sync a file on a local machine. So I am in home my home directory and on and I do ls minus. Lt are you see all these directories and files. What I wanted to do is I wanted to put all these directories and falls into a tar fall into a container in Torit. So for that, I'll do tar C v f back up. This is a name I wanted to give Once it's archived and tarred and what I'm tarring, I'm talking everything within the same director. And this is the same director, which is PWD. When I did its whole my abs also, that's why I'm using dot I could have used slash home slash hives. All as well. But since I'm already in this directory, no need to specify the absolute path. Go ahead and enter. All right, so it has tarred all the files and directories into backup. Tatar. You see it? Is there perfect. Now I'm gonna are used our singer to the D to our sink. This backup doc tar into another directory. And that another director I'm picking is slash temps ash backups. So before I do that, I wanted to create that backup directory, which I don't have it created yet. So do M k D i r slash stamps as backups. Perfect. It is created to test you could do CDs, Ash temp sash back up. And there you go. It is and you are in slash temps like backups. That's how you conform. Anyway, your CD back out. Do pwd just to make sure you are in your home directory. Yes. Allah, run the command. Our sink Dash z VH. If you want to know every little detail about each of these options that I'm using. Then you should run the command man our sink, and it will give you the information about every option that is available to you. Here are the different options, any of it. Our sink, dash z the H back up, which is the file name that he created and backing up where it's gonna tell me. Temp backups slash temp slash backups Good hit. Enter they go. It's sent it say's one point. There was six bytes received 35 by its size and ah took 77 54 bytes per second. It's a transfer speed. So now go to seedy temp slash backups and check. Verify If the back of dot tar fall came through or not, that's well, it's my SLT are it? Is there nice? Okay, now, next thing we wanted to do here, let me move this up or on the side right here. Sink a directory on a local machine. So before we sink the file now I want to sink a directory. So let me go back into my home directory by just typing Cdn Hitting and turnout do pwd You're gonna see its home IVs all do ls minus. Lt are to see the content inside of my directory. No, again, You probably have a lot of different files in your home directory. Ah, that you do. You might not see on my screen because I make a lot of changes when I go through making videos. So don't worry about it if my contents don't match with your contents, Okay, So our sinker directory. So to do that, I want to our sink everything that I have in this directory to this temp back of directors . For that I will use the Commander Our sink. That's a z vh slash home slash i of salt Perfect. And then move this up and I'll put it the spin, the right hair. So you know exactly where I am. Okay? And now where I am copying it to slash temp slash backups that enter bingo. Beautiful. It works. So let's go to temper, backup, verify everything that I have in my home directory, which is which is home slash home slash abs. All you know, it's everything has been synchronized here. Perfect. Now let's talk about the part right here that's moving down. It says are single file to a remote machine. Now. Now, for my remote machine, I have this as my remote machine. And I call it Lennox Cento Us and the I p address for this or more home remote machine is if config e and P zero s three it is one i to 1 68 $1.58. This is the I P. Address. And this is where I want to trash work. So let's minimize again. So I'll go into my home directory and I wanted to copy or our sink the back of dark tar file. Now, before I are Think this over to the remote, sir, where I wanted to create the destination folder where this is going to go. So I will go back into my server and I'll go into slash temp. And here I will create a directory called Back up Backups ls minus. Lt are. And you're going to see right here the bottom it has been created. It's clear the screen. Now let's go back to our Klein machine. This is our client machine. Now we're gonna use the command, our sink, dash a V Z back up. That so far do you want to transfer over now. You want to transfer over as what? User as myself. Okay, which machine is it going to? It's going toe 18 to 1 68 $1.58 which is the I. P address we just checked on our A mortar. And which directory? It's going to colon slash temp slash backups. This is the director is going to go ahead. Hit. Enter. It's gonna ask you for the past, for for the I absolve on the remote machine. Put in the password. Beautiful. It is trash. What it says sent it tells you a lot Information and speed and everything. Now wants his transfer. Is your job to verify it has been transferred. Go to your CD sash temps as backup directory to ls minus. Lt are and you'll see right here. This is the one that's been transferred. Perfect. That's move on. Let me minimize this. Now The last part is right here at the bottom. This is our sync. A file from a remote machine. Now we want to go to the remote machine and fetch ah file from there. So which fall are refreshing? So first, let's make a test file dummy fall. So I'll go into my home directory because on the server on Logged In as myself here, I'm going to create a file. I'm not Call it server file. Do ls myself tr and you're gonna see the server fathers there. Perfect. Now, if I come to my client machine to PWD and two ls minus lt are you see, I don't have that several file, so I need to bring or pull that's ever file from the server. And for that, I will have to do our sink dash a visi h. I absolved because this is the Jews in a models used to log into their remote host. What is the I p off the remote host 58? Perfect. Now, where is that file that you are trying to bring? The file is in home. IVs all and the file name Miss Server file. Perfect. Now, when you bring it, where do you want to save it? Or copy it to going to copy it to my temp backups file or directory? Good hit. Enter is gonna ask you for the password. Perfect has sent 43 bites. Now where did it go? Let's verified. I asked to come to my slash temp slash backup directory. Do Ellis myself to your and you're gonna see right here says server file. See, that's how you fetch a file from the server. So anyway, there are different options that are available on our sink that allows you to do like dry runs, allows you to do, um, arson continuously allows you to do only only Delta's meaning. Only the changes. You just need to pick the right option to use. Which option works for your own requirement. Good luck.
127. System Updates and Repos: system updates and repose. Repost stands for repositories. This is a very important lesson for installing new packages to your systems, So there are two major commands that are used in system updates and repose. Installation is the 1st 1 is young junk. A man is mostly used in santo s or IT and red hat environment, whereas act get is another similar commander is used in other limits distribution servers. Jum Command installs a package from the repositories that are defined in your Lennox system . Those repositories of those configuration files has the Ural Link for repositories. So when you run Jum, it's telling the system. Go online with this your URL and get the package that I'm asking you to install. So, in other words, Jum does need and Internet access to go online and install a package to your system, then the next command we have is our PM. RPM stands for Red Hat package manager. Now our PM off course was first developed by red hot, and it's still in used by red hat. But nowadays, many other linens distributions have carried over the same command rpm That never changed. Now what's the purpose of RPM before I tell you about our PM, let me tell you a difference between our PM and yum. This will be much easier for you to understand what rpm is. Our PM is used when you already have a package downloaded in your system. And then you could install it locally by running the command R p M. Now where, As young Young does all the things for you and downloads the package, it installs the package as well. So our PM is mostly used in environment where they don't have Internet access. So let's get into our legs when she knelt to try out both of these commands. Okay, I'm logged into my Linux machine as Root bitch directory. I'm in. I'm in root directory and there are different commands. And, of course, what is my host name? My host name is my firstly next machine Alexe us. Of course. Now we know we're not in the wrong system. When you're installing packages, please also make sure run a host name so you don't install packages toe a wrong system. Okay, so now the next kept The first command of you will learn is John. If I wanted to install a package. Let's say NTP, all I have to do is type young NTP so young, installed and tp it will go outside to the mirrors or wherever the u. R L has been specified and it will look for our anti package. Now, before it goes outside, it looks for within itself within it since its own system and see whether the NTV pet package has been installed already or not. In this case, I try to insult NTP package. And what happened? It's his NTP package has already been installed with the latest version. So nothing to do. Okay, Perfect. So I don't have to install it. I don't have to update it. Now. What about if I wanted to install um, Apache and a podgy package? Name is http. It will do a gain the same thing. And if I have the system, if I have the package install, it will give me the same message that it gave me before. Um, this is no package. HDP available, I believe. Is http d Okay. Yes. Same message issued a P D sent to us already installed, and with the latest version. Okay, so now, before we go headed and try 1/3 package to install. I wanted to check if that package has already been installed in my system or not. And to check that I have to run the command r p m minus, which is an option queue for Curie. Query all the package that I haven't told my system with minus eight with a option you can enter. It went into my list of packages that installed it is giving me every single packages. Of course, there. So many of them. What if I wanted to know how Maney package have installed? I will do simply wc minus fell. This will get me the total number packages that installed. Of course, WC Minds help in this case is not actually counting the packages it actually count counting the lines, the output off RP minus Qiwei just telling me there are 313 150 packages installed Now I want to see I want to install a package for DNS now, before and salt packet for Deanna's. I wanted to check if that package is installed so I'll do RP minus. Kiwane grew up and the package that needs to install Association associated with DNS. It's called Bind All Do our PM minus queuing and grow for bind only, and you will see here it has buying libraries key binds buying libraries by lot, license RBC buying and buying utilities. So there is no package with just bind, so it means I don't have DNS installed. So what I will do is I will install by running the command yum install find when I hit Enter. Now it's doing the same thing. It's going outside on the Internet, to all the repositories that are defined in my configuration files, and it's coming back with the package saying, Hey, I found this package called Bine and its architectural version that I find which matches to your system a 64 bit. The version that you will be installing off mine is this repositories are is updates repository, and the size is one point eight megabytes. The transaction summaries right here installed one package. Total download size is going to be 1.8 meg, so I'll go ahead and it will say, Is it okay? I'll say yes. Go ahead and install the package. And if you see the progress depending on the speed off your computer how fast it is connected to the Internet. Um, that's what matters in doing the download and install. So right now, if you see that the JUM is doing two things for us one, it's downloading the pack. Once it's completed. Downloading, then right here it's installing the package. It's installed once it's installed, it verified it. And it has confirmed that I it has installed a package. Now, how do I verify again manually, by running the command R p him minus kiwi, Great or bind. Okay. And now this time you will see um, right here. Yes, the 3rd 4th line. This one is just simply bind without any Libs license or any other extra packages that needed for bind. So jump also installs any dependencies. Meaning if there is any other packages that is required with this package, it does it for for self. Where's our PM? If you have one rpm package you when you run the command, it will tell you Hey, I don't have that dependency. So you have to install that package as well. So, to against you go back to our RPM Command to install a package you have to use the command R p m minus. I ate three. Or you could change that to HIV V i h whichever the way you want space the location off your rpm. So if you have downloaded your rpm and let's attempt, then you will specify slash temp slash package Whatever the name off packages and usually the package ends but dot R p m. Then when you run this command, it will install that package for you. Now you could also do R p m minus e to remove a package. So let's say if I wanted to remove this package, find the one we just installed. So I will have to type here now find our package is not so sorry. I did some kind of mistake so hard. P minus. See? Let me see. Fucker. Copy and paste should be able to do that. Yes. Copy on. Paste it. It's gone now. Can I verify it? RP minus Qiwei. Great for bind. Okay, You see, it's not there. So what do we do now? For one, it wasn't solid back. Have a luge young installed by click. Yes, to install it. Yes, it is downloading again. Same process, and it's downloading now. You're probably thinking, K. Didn't it download when we when we did the same command before? Yes, it did download. But jump is very smart. Tool. What it does, it downloads. It installs, it verifies, and it also cleans up your download. So they so your space. The space is used more efficiently, so it doesn't keep the old downloads on your system. Okay, so now the download is completed. Let's check again. If he had the package. Yes, we do have the package. And package is right here. The 1st 1 Now we use the R P. M minus E command to remove that package. And we could also do junk remove mind, and it will do the same thing as if I would do R p m minus e. It says remove one package. Yes. Go ahead and move it. They go. So it's gone. So anyway, guys off, I hope you know now that how rpm and young command works, you will be working a lot with this. These two commands, if you gonna be in system administration capacity
128. System Upgrade and Patch Management: system upgrade or patch management. This is a very, very important topic. Very, very important lesson for this. For this training, you will be upgrading your system from time to time or applying patches to your system. Um, on a quarterly basis, depending on your company's policies, there are two type of upgrades that happen in Lenox operating system One is the major version upgrade, which is from 5 to 66 to seven. And if you don't know what worsen off Lenox via running right now, then I would tell you right now, stop everything again. Stop everything and go back to your Linux VM and find out what version you are running and you will find that out. How you could do cat at sea, red hat dash release or you name. I say, Are there different ways that we have talked about previously? So anyway, just let you know. If you don't know if you forgot, that is fine. The version of your running in a lynx machine is seven, and the minor off that version is $7.4. So there are two type of upgrades. Major versions 56 or seven and minor version from 7.3 to 74 or $7.1 to $7 to. Or that stays within the same channel, which is, like seven all the way from 1 to 56 everywhere where it ends. The major version does not get you cannot get upgraded through the young command. Minor version can be up done through jump update Command major words, and you cannot do how you could do the major version. Upgrade Well, you have to back up the entire server, build a new server from scratch and transfer files. There are a few other ways that you could do it, but trust me, it's very cumbersome example to do. Your update is simply running a command jum Space update an option minus why? And the reason we have minus why is because this is telling the opening system. Every time you're gonna prompt me to install a certain package, don't ask me. Just install it. So, for every question, my hand, sir, is yes, there is another way to do that. Update is update and upgrade. Now what's the difference between update and upgrade? Upgrade? Deletes packages when you have a package, let's say you have an anti P package or http package and you, you, you did jump upgrade. It will delete the old package, which is, let's say, http 0.5, and it has a new words in http 0.6 So it will delete that old package, and it will update it with the newer package. So that's a difference. Where, as upgrade preserves, it preserves the older packages as well. Why? Because it is a good practice for some system administrators to keep a little packages in case they has certain off their applications don't comply or don't run with the newer version off the packages. So that's why sometimes people have to roll back to its original pash updates. So system upgrades and patch management. This is just ah, quick, um ah lesson for it. I will go into my limits machine again to try out few of these commands. I want to go in as putty. So in order to go in s putty what you need, I am keep typing this. So this way you guys would know these this command or networking off limits machine. So there's that I be you put in the i P address in the Lenox machine. I already have the party open. Who am I? I'm my son route to just minimize the council. And now I have open buddy. So the first thing is right here. Um Yum update again. When you do the jump update, it will preserve old packages whereas upgraded elite old packages. But before we go any further, what version do we have? Have you checked that out? So you do. It's he had released. We have version major version seven and minor version doll for So we will do Young update. We will not put Minus Why? Because I will show you when it will ask you if I want to proceed. So just do jump update. It is actually going through all the packages that require an update. And it is telling you right here at this summary. Let's scroll up that these air the packages that do require some off them to be updated. Every package has a dependency on other packages. So if I'm installing package ABC, it might requires a package off X Y z Ah, just like in windows. If you are trying to install one package, it might require you to install java as well, or flash or some of those other packages. Similarly, limits works the same way. When you're installing one package, it does have other dependency, so it has to have those packages updated as well. So that's what it's saying. That it will insult BIPAC, just new ones. And there are more updates there. 209 packages off it, So that includes five pack that includes the dependency as well as the updates of the packages. So we will say, Is this OK? Yes, it's OK, Go ahead. And yes, if I had put in space minus why it would not have asked me to put in my Y or would not have waited for me to put why? So I'll why as yes is the unloading packages, it is going through the update process off 449 packages that in these two update this will take quite some time. So what I will do is I will fast forward this so at least you could view it how it is going through. Each package update wants the packages. Updates are done. Then it will do to clean up and and remove any lingering process that's out there. Okay, The system has been updated and it is complete. We did not get any er messages. And by the way, I should have mentioned in the beginning this. Make sure your system can go outside, and every time you need to make sure you could just simply ping google dot com It does go to Google, but just to make sure we have throwing one. So it is going outside and it is pinging every time you see it's coming back with 64 bites from this machine, it means it has Internet access and it could talk to the server outside. If it cannot, then you definitely have the issue and network issue and first checked those before you run the junk command because the JUM command is actually going to the Santo s repository to download your packages or update your packages
129. Create Local Yum Repo: I say now, this is the topic about creating a local repository from your DVD. Now what is a repository? A repository is something where all your packages are stored, and then you could download and install the package that you wish to. Now you do need an Internet access to go out off the outside repository and downloaded installed RPM. But what if you do not have Internet access? That's what exactly the local repository comes in. So you have a linens machine, right? Whether it's a virtual or physical machine doesn't really matter. It goes out to the Internet, and then it goes out to a server, which is also most likely a red hat server. Santo s server average has a repositories. Now some companies do have those repositories local to their environment, which which is called the product that holds that repositories called satellites. So that is the repository, which holds all your repose or rpm packages so you could bring them back and solid downloads. Now, what happens if you do not have access to the outside world or if you do not have a red had satellites over in your environment, then how are you going to install new programs? Well, in that case, you create a local repository, but then your server. So this is what we're gonna learn in this lesson on creating a local repository. Now it just remember, if you do have, um, an Internet access to your VM or your machine, you don't have to worry about this lesson. Or if you just want to learn for just for educational purposes, how to create a local repository, then please go through this video. So the command to create or we will learns. Listen, it's created Repo. That's just one simple command. So how does it work? So let's get into, um, are links machine, my virtual machines power off. Now, I want you to go ahead and create a snapshot. What snapshot does It just takes a snapshot in case we need to reward back. If something goes wrong, we could always go back to that snap shot Click right here, see a snapshot and click on take, and by default gives the name snapshot one. But you could give the the date or anything that you like that will make you remember. I'd like to pick date or sometime times if I'm creating multiple snapshots, So now it has created a snapshot. So in case I mess up during this creating local repository and I need to report back to my original state, which is right now that I always come back to it. So now let's go ahead and power on your okay. So our machine has been started, so let's go ahead and become route. Okay, so now you are creating a local repository. So what you're gonna do is you're gonna take all the rpm all the packages from your DVD or CD CD Wrong Drive, which is a disc which has all your packages. So what you do is you go into these manu devices optical drives, choose disk and picked cento us Isola image. So I haven't saved on my desktop, so just choose it and click open. So now this should automatically mount your DVD to your legs machine, See, right away a pop manning came up and also you, if you notice it will also create an icon on your desktop saying this is the disk. This has been attached. So now we have it attached. How can you verify it? on the command line. You do DF minus h and you will see right here. The last row tells you that it is a deaf s r zero and it is mounted on run media. I have sold center was seven. So now if it is not mounted, um, automatically Then you could run a command mt slash dev city rahm And wherever you want to be mounted. Anyway, since it's already mounted for us now, the next step is where are you going? To put all your packages. So you have to create a directory. Right? So the directory I'm gonna pick is let's go to slash city slash and under slash make a directory. Let's call a local Riebel. It was just the name you could pick anything. You could pick Seinfeld, George cream or whatever you that you like. So go ahead and hit. Enter Do the less months lt or to verify it, is there? Yes. The directory is there. Now. I want you to copy all the contents to do the of ice age. The copy, All the content off the desk. So do CDs. Actual Ron slash media. I have salt. Now if you notice the name off. This ISA image is sent to a Space seven space as it 86. Now Lennox does not like spaces. So how are we going to put that in my pats if I just put incent Os space seven x 86 underscore 64? See, it says no such file or directory than how. How can I make Lennox understand that there are spaces to do that? The best thing that I would tell you to do is do CD Ron Media. I have soul. And when you are at this point on the fourth directory, subdirectory than hit Tab and even automatically pick the ice and Mitch under that, I have solved directory. So if you notice it has backslash backslash, which is telling Lennox that there are spaces in it. So go ahead and hit. Enter. But now you are in that directory. Do ls myself here and see what's inside of it. You see, there are a few directories, end files, CD into packages. That's where all the rpm's are doing this myself. Here you will see a bunch off rpm's India. Okay, so if I wanted to see how many rpm so I have I could do ls minus. Lt are hype it wc minus l. And it's telling me there are 3973 packages are rpm's that are there coming within that DVD ice image? Well, that's a lot. So it is kind of like a repository. So what we're gonna do is we're gonna copy all of these packages to our local Dr B local folded that we just created. And the gun full. The name is a local report. Right? So now, before you do that, also make sure that you have enough space in your Lennox machine. So how do you find out? First, you are in that directory, right? Packages run the command D u minus as h and dot Which telling it which asking the lungs machine. Give me this. This space off the current location off the directory diamond hit. Enter is saying 3.7 game now do d of my age. And make sure your slash directory has that space empty. Yes, we do have war dot for available. So it's good. So now we could go ahead of it. The copying every package that we have in this location. The command I would use to copy his copy everything from this directory dot or you could specify the full path Run media. I've saw center Wes packages so you could do everything. Asteroid, because you're copping everything under packages to your local Repot it better. Now it is going to copy every single rpm to the local report directory. This is going to take some time If you open up another window and then you go to seedy to local repo and two ls minus el Pipe it to WC minus l You will see the number off. I was being copied. So right now we have 1480 files that have been copied. We have to go up to 39 something cause to be copied. Okay, All the rpm's have been copied successfully. Very good. So we have to tell Lennox. Don't go outside. We do have all the packages locally. So how do we define that? So there are files in etc young dot reposed are deep. These are all the files that tells the Lennox to go to these different mirrors. So what we're gonna do is we're gonna remove everything in here Now again. Before you remove that, please make sure you do have a snapshot. If you delete all of these packages and you do not have the snapshot, then you won't be able to go to Internet. And don't look the packages through young commands. Okay, everything is gone now. Go ahead and create a new report here. Call it local Diary Po and add these values center Where? Seven. It's just telling it these are positive percent toe a seven name sent. Seven base You are Well, this is what matters. File zack slash slash local read local report. This is the directory that we created in slash. It was always started to slashes than the third slash with local report directly enabled. And one, if you want to make it enabled G p G check zoo. These are some of the default well use. You have to put into that file. Go ahead and save it once that it saved um, now we'll run the command, create Rebo and where is my repo local reaper I had entered. Now it's actually what it's doing is it's actually going to the local report directory and It's saying, Hey, I had $303 97 1 packages. I'm gonna make them available to my local machine as a repository. The create repo had created the database that will be available to our jump command. Now go ahead and created young Clean, Run this command, come clean. All this is going to clear out any cash from the old repository. Go ahead and run Junk repo list. Oh, now this should tell me my ah, full list off a repository. Syria, Go. So we have a report list that has a total package of 3971. These are the exact same number of rpm three Ad, remember and telling you the size. The report i d the cento us is the name that you picked in that R p m dot de directory fall . Now you could test it by running the command. Yum install. Now, what do you want to insult? Uh, just what test type Tomcat. It's gonna go into their repository and check if it has a packages that matches Tomcat. Okay, Perfect. It did find a package. And this is basically how you create a local repository. Now the system is not going out on the Internet or to your right hand satellite. It is actually going to your local repository, which is sitting but in your legs machine. So if you are following this than Gold Hood and delete the local reap report directly that we created and revert back to our snapshot
130. Advance Package Management: Okay, guys. So in this lesson, we are going to cover at vast package management. Ah, we have the package in our environment be installed that we learned those couple commands earlier. And one is jum and the other one is our PM. Now, rpm, um is a Red Hat package management command. There are other commands that are used in other than its distribution, like app get for a bun two and many other different flavours. But anyway, our focus is on Santo s and red hat. So we will be using RPM and young command. So what exactly we are going to doing it. Bass package management. Well, advanced package. My memory had We'll learn how we could install packages. Hey, you could do that through jump command, right? Yeah, of course, we could do that. That's the best way to do the installation off the packages. What if you already have the package and you just want install it so that we put rule core ? Then we'll learn. How did we could do the upgrade of those packages followed by how we could delete those packages? Then we'll see how we could view a package detail, meaning if you haven't installed package and you want gnome or information about the package, how or when it was installed? What? That is packages about when it was built. What other configuration Poile associated with it and a lot of other information related to the package. Then also identify the source or location information. If you have ah, file or if you're running a command, let's say you run a command PW to you or l s. You want to know which package that command belongs to, So that type of information will cover so and last one is the package configuration file. So if you have installed a package, let's call it ABC. So we all know that all the package configuration files are by default in slash, etc. So once the package is installed and configuration files gets creating at sea, but then it goes into subdirectories so at sea slash this slash that that we don't know. So sometimes we even forget. So how can you find out that information about a package if he are? If you have done that download insulation and now it's about the configuration of the back . So those other things that will cover. Um, so to go where? 11 by one, All those things. I'm gonna go ahead and log into our Lennox machine. I'm gonna use our party session to ssh into the next machine. So let's go into our likes machine right here. I have already logged in, and I am logged in as Groot, and you could also verify by looking at this pound sign. Okay, So the package that we are going to install in this lesson are in this practice is, um, corn shell package. Now, corn shell is a shell which you probably have already know about. It's just like a bash or seashell. So I'm picking this just for practice purposes for just for this lesson. So corn shelled is the package that we do not have in the system and we are going to install needed to be upgraded the lead in view. It's package information, and we'll cover everything that we have listed on this lesson. So let's say if he have a corn shell package already installed in the system, So to check that you will have to do our PM dash Qiwei grip it for corn shell, and you'll see, we do not have that package installed in our system. So, um, now we have to install package through two ways. One is that be run jump installed. The name of the package. The 2nd 1 is that we don't load the package through a different means. If you do not have Internet access, then you could download the package then installed. But I do have Internet access on this machine, and I could verified by doing ping www dot Let's say, facebook dot com and you'll see I'll get a response back. See, it means that I am online, so you could also check by running if config command and you'll see I have I p one I to 1 61 done 13. You probably have a different I. P depends on which network you're in any way. So I do have it. Internet access. Um, and I don't need to download a package, so I could What I could do is simply do zham installed que as each corn shell anything that is related to corn shell like we just put it asterisk. So I hit. Enter and you will see it did find a package one package and the name of the package and it say's X 64 package. It doesn't have any dependencies. Good. So I'll go ahead. Why? Also, if you notice the bottom tells you the size of the package installed size, you could confirm everything before you could go ahead and hit. Why? So, um hit. Enter and this is going to download the package first. And then once the package is downloaded, then it will go ahead and install that package Firefly to clean it up. So let's give it Ah, a few seconds and that it finish the package. Installation has been completed and it is successful. Once you see at the bottom says complete. Now, how do we verified? Hit a barrel key again and you will see you have the package. Last ran RPMs. Q A group for corn shell hit. Enter. And this is the package that was installed during our Jim install command. OK, so now what? If you wanted to remove that package, you could simply run the same command. Jum removed corn shell and hit um astrakhan enter. This is going to go ahead and remove the package that it just installed why and it is complete. Now run the pack of the RPM command again to query their databases. The list of package that installed and you'll see there's nothing, um, nothing installed that matches corn show. Okay, so that is the first and most preferred way to install and download and install a package now coming back to the same scenario. What if you do not have Internet access or what? If you do not have a local repositories, then what do you have to do is you have to go. You have to know the exact location where the five, how to download a file and then do our PM command to install the package. But first, let's go to our Internet and, ah coda Google if you have a different one different search method Ah, observer that you could use your used bang or whatever anyway, so all type. And as you could see, I already have typed in before. Download corn shell por Cento US seven. So hit, enter and go and click on the first link. This will bring you to the package that or page come down and all the way down and you see where it say's the package that ends with dot rpm Just simply right. Click to it and click on copy Link address. And she did the copy link address. Go back to your legs machine. And now this time type w get and the package Exact location of the package and hit. Enter. Now you're probably thinking, Hey, I don't have instant access than how can I download this package? Um, if I don't Well, simple ways you could go ahead and download on your machine. Um, on on the machine that already has Internet connection, you download and then you can ftp over whichever way is preferred for you that you have to pee or it has downloaded. Where did you download this? Check PWD. It's downloaded and slash route. That's verified. If it is there by doing ls minus. Lt are hit. Enter and you'll see. This is the package rpm. Now we have installed this package before using the command you dumb. But now this time you're going to install this pack is using the command rpm dash HIV and the name of the package HIV are the different options you could use H i p HIV differently. V I age ivy. It's whichever the way you put for it. I proposed this way. So go ahead and hit. Enter. And now it has installed that package. Um, And now you could check by running rpm and XKE way in grateful Quantrill, and you will see the packages there. Right? So that is the way you could install that package. Now what if you wanted to verify the information about the pack, you could do rpm space, Q I as information and the name of the package Copy. Right. Click hit. Enter and you will see the information about the package. That package name is corn shell version released, architecture installed, a group and whole bunch of information where you get it. How what exactly it does was information about. So this is about the information off the Pacific package that has been installed in your system. Okay, so next step is what? How can you delete that packet using, um, rpm command. Remember, we learned how to lead a package you're using. Jum remove command. Now, let's delete a pack of using rpm for that. You need to know exactly the look. The name of the package the name of the package. We have it by getting running the command rpm desk. You weigh now. Ron Rpm, Dash E As for delete, specify the entire package. Name hit, Enter. And now it's has early that package verified by doing rpm Jeschke Way and Grateful Corn Shell. And you see it has removed the package. Okay, so now this was about removing the package. Now, I wanted to cover more things about this package, so I'll go ahead and install it again, this time on Sullivan Jum install corn show. That's correct. This picture and it has installed a package perfect. Again. Verified. Yes, that packages there. Now, um, I need to list configuration file of this package is how can I list that? So you could do R p r p M dash Q C and the name of the package. Enter and you will see the configuration file that you need to modify in case you might need to do the same configuration of the package. And these are the list of all the configuration file. Remember I told you the package configuration part are always in etc. Directory. But then, once you're in a sea director. There are thousands of files. Thousands of directories. Where do we have to go exactly for that Pacific package? Well, therefore, that you have to find out the configuration file. And how do you find out? I just showed you rpm ask you see now what? If you want to find out some information off the, um, command, let's say if there's a command associated with this package and the command for that package is I know offhand is corn shell just hit enter. And that will bring you to a corn show, just like a regular command like pwd. Unless command, every package has a command associated with it. So let's exit out. So we go back to our bash shell. So this is I commend. What if you want to know which package this command belongs to? For that, you have to run the command. R p M dash cute f and K s h Ah, oops. Sorry. I forgot. First I need to know the path off that package a document. So Ludovic Cassity And it's telling me that ksh command the full path is user been kearsage Now I could do that Command rpm de que with and all put that here Hit Enter. And now it's telling me, Hey, this command that you run this command belongs to this package. Good, Good. Now you're probably thinking, Hey, this is fun. I could find out all the package information for all the commands I have ran right so far. Whatever the commands that you have learned, you could definitely find out which package it belongs to. For example, my favorite commanders. Let's say every time you log in, I wanted to see who is logged in or risk directory. I'm And so let's a pwd is the directory. Maybe that's the That's the command which tells you with director you are in. If you wanted to know which package this command belongs to first, what do you need to do? You need to find out that command path. It's a rich pwd. Now you know that this command, the full path for this command is user been Pete ability. Now do our PM that q f slash user slash been and pwd. And it is telling you that this command pwd belongs to a package called core. You tills and inversion. If you remove this package, then you cannot run the command p w d. Then which they're here. And how you gonna find out? You cannot find out. So you would have to reinstall that package again using jump command or going to the Lincoln downloading. So that's how you actually find out the information about a Pacific package, Pacific configuration off package or the package information off a command package. Management is one of the things that everyone would face in their career at least twice a year or three times year when you have to do or install or upgrade the packages. Hopefully, this lesson serves a purpose. If you have any question, always send me an email.
131. SSH and Telnet: Ssh and tell it, these are the two main services that run and Lennox to accept connections from outside. Telnet is an old and unsecured connection between two computers, and a lot of companies don't use 10 anymore. The SS age is in your connection established protocol that is completely secure. There are two type of packages for most of the services that you see on a little machine, one is declined package and the other one is a server package. So you have a server. It sends a connection. Request an ssh request to another server. So in this case, you are declined and the computer you're trying to connect is a server. So let's take it the other way. So if you on the right hand side and their server is on the right hand side when it tries to sink, it's time to you as through the NTP Protocol. Then it's no longer the server. It becomes a client, and then you become the server. So let's look at our assess age and telnet, both of these those services that we have and how they work in our computer. I will connect it through the putty session and I'll confirm I am route. It's clear the screen and the service that runs the 1st 1 is Tell it. So when you run, tell it you see it says Commander found Why? Because by default now, Lennox don't include tell it in the installation. So if you have to install 10 that you would have to do junk install Telnet and it will go to the repositories and it will find a match. The the option I have for talent. And it found one package, and it's telling me, Do you want to download now? We will not be using Tell it in our environment. But if there is, if you're troubleshooting, talent is sometimes a tool that allows you to troubleshoot some off the issue. Some off the number of communication issues before this lesson, we'll just skip that, and we don't want to download that next one. We have the ssh. Do we have a sausage? Yes, we do. That's why we got this usage off message we could do as a sage to follow by the I P address off the remote computer. But since we don't have a remote computer, we'll just say local computer, which is the same box that we're trying we're already logged into. When you do hit, enter? Yes. You're logging in as roots of putting the root password and you log into the same machine that you were logged in before, So you could come create as many sessions as you want so you could exit out and you'll come back to your first session to check the service off. SS h d will run PS e f to see if the process is running and you'll see the processes right here. It says user s been SS s H Indeed, this is the process that actually listening. We're all the incoming traffic. If I stop this process, I will not be able to log into this machine anymore. But before we do that, I wanted to check my I p and my I P address is 1 90 to 1 68 Don't want 12 and let's go ahead and stop esus H D service and you hit Enter. You get the prompt back. It means it's not running. You could do PS minus f again to grow up it and you will see the ssh d and S s h D. This is this Already established connections is telling me, but it is not showing the one we look for before we just user s been ssh deep. So it means it will not accept any incoming sessions anymore. How can we confirm that? Let's log into a new party session, and I will put in the I p address of this machine again one night to 1 68.1 dot 12th. She says never care. Connection refused because there is no ssh dese demon that is running, so we'll cook. Okay, close this out. And this time we'll start the ssh deep process. It has started because we've got a prompt back. How do we verified you could run PS minus cf again? Sht and you'll see right here the process is running now. Now it will accept the connection. Another way to find out if that services running is by doing system. See Thiel status. That's a 60 and right here is telling you active, active and running. So now if you try to connect to that I p 19 to 1 61 that well, you should be able to 19 to 1 $68 under 12. Bingo. You see how sht works? So this has how you could stop the connection to your server or refine or restrict your computer? This is a weight on an has way to implement security on your system.
132. Download, Install and Configure DNS: DNS, which is called Domain Name System. I'm sure you have heard off DNAs from many different people, but exact what exactly it is. What's the purpose off DNS? Well, Deanna's it is a system that is used to translate a host name. Toe I p address. So what that means is, when the whole Internet started the Web, sites that were built over in the systems were built, computer systems were built. Every computer system has an I. P. Address. And to remember those I p address was so cumbersome people wouldn't remember the I P addresses. They will forget it. It would have to write it. It's a security issue. So then they came with a resolution, and the resolution was to come up with names. The host names. Okay, we do have the host name, but computers don't understand letters or horse named computers. Onley understand digits. So how do we translate it? We do need a system in place that does the translation for us and that system or that service is called Dennis again. Domain name system. It translate Host name to i P address I P address to host name, which is called a PTR record and host name Toe I. P. Address. The record name is called a record, and the last function off DNS is translate host name to host name. And this is for some off the host name to translate to an easier like a alias type of host name. For example, Google have probably like 50 of servers running background that serves their website google dot com. But do you think that Google itself is the name on every server is the same name? No, it's not possible. They probably have different names on those 50 servers, but they do have one alias school, Google, which is, um, pointing two other server holes names. And then it points to other servers. That is, when it's called host name to host name. And in order to create that, you need to create a record, and that record is called C named Record. Please to remember these a record PTR record and seen him record. If you're gonna be, uh, preparing yourself to go for Lennox interview, you will be asked these questions, and I know that for sure. Many people been asked these questions. Remember these records? Then there are files that are involved in the configuration of DNAs and the primary configuration file is in etc. As you already know, everyone should know that by now that at sea is the configuration directory. With all the configuration off, every service is located. And the file name for DNS is called named Doc. Off name dot com is because named is the name off the process off the DNS and the package that you install for Deanna's it's called Bind Next Fine. And the next file we have is war name D. This is not a file. This a directory. In this directory you have all the zone files where you define all the host name toe I p i p to host name and all the other stuff that you wanted. The service that you need to run in your system or when you started. You have to run the command system, Tim CTL re star name D named Dee is again Name and D stands for Damon that this Damon is gonna run. Keep running it. Every time I request comes in, it's gonna serve their request. From this point on, we will go through the download install and configuration off the DNS server. So the first thing I will always a command is that you create a snapshot off your washing machine whenever we touch the configuration file off limits machine. It is always a good idea to create a snapshot just in case. If you make a mistake in the configurations, you don't have to troubleshooter, spend endless number of hours or even rebuild the entire Ling's machine. So please go ahead and create the snapshot. Then the set up usually looks like, as in the DNS, there's a massive server, and then there's a secondary or slave server, which is a replication to the massive server and then declined. The client is any machine that will result its host name or others. Service holds name toe I P addresses in our set up. Since we are using one lab machine of you only have one next machine. We will use that one this machine as a master server and as a client as well. We will not be setting up as a secondary or slave server, but if you have to machines that I would recommend that you set up the DNS on one machine and the other machines use as a client to look up for DNS entries. Anyway. Moving on are a domain name that we will set up for our lab. Deanna's configuration is lab dot local, and the I P address that we will give to that Deanna server is the local I p address that will that is, right now assigned to E and P zero as three. So, of course I'm sure everyone is using vie if I never could, apter so and why if I never could apt her. The I P address that is assigned to your network or to your interface is always a DCP, meaning it changes every time you reboot. So when you assigned this I p address to your Deena's, remember, it could change says Better where you'll do the install configure DNS. But then we could actually undo all the changes Order of Word or restore to original Virtual Machine snapshot. Anyway, the steps that will be involved would be is to install the Deena's package and the packages bind, buying the dash, your tills and my as I option meaning. Say yes to every question that will be asked. Then you'll do the configure DNS in summary reels modified that etc. Named out com file, we will create two zone files forward, out lab and reversed out. Lab forward, out Lab is to do host name toe I p address. Look up and reverse is to do a reverse look of it. Just i p to host, name, Look up. Then we will modify the DNS, file permissions and start the service. And of course, after that, once you verify everything Dennis is working the way we wanted it to configure, then I would definitely recommend that you report or restore back to your original snapshot . So this way, if your I p changes, you don't have to go into the Deanna's configuration file and update that I p over and over again. This configuration off DNS works best if you have a static i p. But since we're working on a wife, i d c p i p. And this is a lab. And my my intention here is to teach you how you could download, install, configure and managed DNS. And that's why we're going through this last process. So I will go into violence machine and first of all I am here and I am logged in as myself . Sorry as root. And the I P address that I've always use is 1 90 to 1 68 1 29 I could do if conflict for that again to confirm one I to 1 68 $1.29 is assigned to E N P zero s tree. Perfect. I could do the installation configuration right here on the council. But I would prefer to use a putty session. So I already have a party session open right here, and I will minimize at this window the council and I was used the party machine again with the putty. I will see who am I? I am my selfish directory. I am in n which host I'm and OK now I will become route. Okay, I'm logged in as rude. Let's do who my rule to Let's clear the screen. And now I will follow my detailed procedure that I have documented everything in a word document. So I will open that up on the side. So this way you will follow the documents step by step. All the steps are Excuse me all the steps are hot are highlighted in step one, Step two all the way, I think until step 13. So first thing first, let's go ahead and do the install off the Deena's package. Ah, before we do install, let's check if he have the package, so to check it, it's rpm deskee way and grow for bind It will go pull up all the list of RPM said we have installed and Pacific decrypt for bind And now look at the list and you will see their earn any bind package installed just by itself buying There's bind Keep buying rpc mind Libs licensed Live you tills. We do have your tills That's good. But I will still go ahead and do an install on you tell just in case there is a newer version. If there is, it will upgrade this old words in which is right here. All right, so Ah, first step installed the NSE yum installed bind Space bind is the second package You t I s minus y meaning Just say yes to the question that will be asked during this installed. So when you do the jump, the young will download as well as installed your package or the package that you're looking for. All right, let's go ahead and hit. Enter. Of course, this will go out under, were sent to us repositories. Looks it will look for these packages. So before it goes out to send to us repository and make sure you could actually get online meaning get on the Internet, you could just simply do paying dub dub dub dot google dot com. And if you're getting a response, it means you are. You're able to get online so that that's when you actually that's when you actually go in and install the package and complete Good. Now you could go ahead and do RPM dash Qiwei and group for Bind again and you will see and you will verify that the bind package just by itself. Bind has been installed beautiful and you told Package is there it was 0.9 dot nine, and now it has upgraded to $9. 11 perfect download installation is done. Next part is actually configuring the dnx. So when you install the bind or Deanna's, by the way, DNS is the name. Bind is the package name and the service that runs the Deena's runs. It's called Name D. D stands for Damon. So remember the difference. DNS is the name of the DNS is the name name off the entire Deanna's Um, the packaged application itself Bind is the package name, and the service name is named e. All right, let's add it. The Etsy name dot com file. So before you edit it, you could make a copy as well if you're doing in production. But I'm sure you have taken the snapshot. So let's go and do V I at sea named are Cough come down to the point where it say's options , and here you have to do listen on Port 53. So, by default, Deanna's listens on poor 53. So right here, I want you to type in the i p address off the E m P zero s tree, which is one I tutto 1 68 dewan dot i believe it is 29. I will check again and put semi Colin, please make sure. And then there's a space curly braces, clothes and Sammy calling again between nine. Now I want you to go down all the way down to the bottom of the file right above where you see these two lines include? He was gonna You're going to see this? The section that these 34 lines of parameter to start with zone. Now you have to ad in the value dot Take that out and add lab dot local. So this is the domain that I have picked to be the Deanna still mean type replace. Hint. Would master file the file name that the evil create will be forward dot lab and one the last parameter would be allow dash update space, curly braces, none Cold semi colon based curly braces close and then semi called. All right, then, the next one is for our reverse. So for this guy, But I will do is I'll simply copy it from here. Okay, Inserted. All right, So now this is the reversal zone. Look up. Configuration parameters. So in reverse, we have to specify the the in the reverse. Older one night to 1 60 it out. One type is master file is reversed. Our lab allow update and it's closed. Brace. Curly braces did okay. Included. The last two lines Stays the same. You have to change it. Okay, Just make sure this port is added to your name dot com file exactly as I'm showing arts once is added. By the way, the document that I have on my left hand side is also attached as poor off this lecture. You could download it and you could go through this exact same document. All right, let's go ahead and save this file. Father saved. Saving. Quit now created to zone falls. So one's own file will be forward. Our lab. But you have to go into war. Name D directory. Make sure you are in war. Name D directory. Good. Touch forward our lab touch reverse dot Lab. We have both river forward and reverse. Now, these are the zone files. Very review Actually going to keep the entries the forward look of entries and reverse Look up entries. So if you want to resolve hosting toe I p, it will go into this fall. If you want to resolve i p to host named, then it will go into this fall. All right, Any weight. Let's keep moving. So now modify the first file, which is forward dot lab v I forward. Ah, lab. This is an empty file copied this. Everything that I have in here and paste it in your fall. So now let me just quickly tell you what this is. Format is better that you formatted the right way. Not because it will be a bad configuration or it won't work. But it will be easier for you to read, so I always do tabs for these. Okay, So, basically, ISS, time to live 8600 in 6400. Every line that you see here has a meaning. And of course, if I go into every meaning, it will take a long time. But just quickly. I'll tell you, every time you make a change to this file, the serial number has to be updated. So if you are adding an entry here, please make sure change 1 to 2 Orphee adding the third entry. Make 2 to 3. All right, so these are the pre defined parameters that we have that you need to follow. So let's come to Deanna's So master DNS. So, first of all, at an name server, our master Dennis's laptop local, and then add in a 1 81 $61.20 and This is our I P address. And our master Deanna Server is has the entry in a one a $2161.29. These are the last two lines that I have added as a test client. A in a one, a $2161 to 40. And the other one is, by the way, these two machine client A and client be do not exist. But I have just added just for testing purposes, whether I could resolve that when I completely done configuring the dnx art. So let's go ahead and save her father's save. Now, let's go ahead and modify the reverse start lab, and I'm gonna do the same thing. I'm going to copy and paste exactly what I have here. Okay, everything is copied again. This one is reversed. The 1st 3 entries, um, will be the same. Ah, it has this client one. It shouldn't be there. But let me just remove this one. Yes, I have a removed. This one here too. Okay, We saved the file. Okay, So it should have these 1st 2 as it was in the forward as well. Then the 3rd 1 Master DNS in a one a 2168 1 dot 29. And if you noticed this last three and trees, we have the same entries in forward, but they are now reversed. All right, good. Now go ahead and save it. Now we need to restart or start than the service that associate it with Deanna's. With that will do. System. See Thiel, start name D Perfected has started now. Alice enable it so it could start at boot time. That's enabled. Okay, the next port is disabled. Firewall. If you have a firewall running, go ahead and disable it. And to disable the firewall. A system CTL stop. Why will d if you do not want to disable the firewall, then make sure you configure your firewall toe. Allow port 53 to come in and listen on poor 53. All right, that's disabled it so it won't start back on at boot time. It's disabled. Now, let's go ahead and configure the permissions on war name D um, for ownership and SC Lennix. If you're running sc Lennox and you have to run these commands, if you're not running at sea Lennox and you don't have to run the last two commands. But anyway, still run it. These This will set the permission off your war name. Dif off directory. Make sure you run them in sequence. So let's keep running ownership of this routines as root. That's fine. Didn't change. It's still route. If it was, wasn't rude than it would have changed it. Okay? And the last one is named Arkoff. So everything is done. Now test the configuration and zone files for any syntax error. Okay, so we have to make sure those configuration files the changes we made to our actually our has no mistake. So for that, the first configuration file changes we made was in etc. Name dot com. So to verify if there isn't any mistake in that configuration file will run the common named dash Check cough at sea slash name dot com If you don't get any output, that means it has no issues or there isn't any mistakes in the configuration. For now, I will do the same thing. But you'd run a different command which is check named Art Check Zone. And that is for my lab and lab forward zone file that he created and it say's his own. The lab that local loaded to remember is this and it's his okay. Meaning it works. There is no mistakes. Perfect. The drawing The second command for a reverse zone and it stays. Okay, Beautiful. Now we'll go into our network config files to add at DNS server information into that network conflict file. And as you know, our my Nick is e N p zero s three. So if I do if config e and P zero as three, you're going to see so i e and P zeros three you're going to see that it has the i. P. Address. The same I p address I have given to that DNS server. So I will go into this configuration file at C sis config Network Di script. In there, there's a configuration file V I I c f g e and P zero s tree. I'll come all the way down and add the DNS entry would be DNS equal 1 92 toe 1 68 dewandaka 29. So you it Now you have to modify the etc resolved Arkoff. Now remember, if you are using to Lenin's machines and you are trying or configuring this DNS from on one server and had the other server as a client. Now it's time for you to go to clients. So can Klein can look it up to Deanna's? If you only have one machine, that is fine. We will keep or consider this one machine as a client as well as a server. So for this, modified at Syria's all dark Hoffa V I at C result a cough. And here you will see the name server is set to your default gateway, which is one night to 1 68 1.1 Which is your modem as well at in your home sort of place one of the 29. Because this isn't now your new DNS server it saved. Now it has saved. Now, let's go ahead and restart the service. So we have to restart the network now system. See Thiel restart network art. This network came back online, and now it's time to verify whether our configuration or the hardiness works. So well. Do dig master DNS dot lab da local. Okay, so we will see right here. Let me make this bigger. Should be easier So right here says Master de en esta lab, The local in a There is no I p is showing him. But let me try to and it's look out for that and it's look up, Master DNS don't lab dot local. Okay, OK, it is ok. It's still going to one night to okay? Yeah, because what happened is every time you restart the network, remember video and the command system Security start network. It changes your DNS information back to one I to 1 61.1 So go back into its here is all con fault and change it back to 29. Now try to dig master DNS dot lab dot local And here you're going to see Master DNS doll Abdel local is actually resolving to one night to 1 68 $1.29 Beautiful. Okay, now I'll try the honest look up command by the honest look up and dig commence actually performs the same function. But dig gives use mawr information than NS Look up! Okay, so now I'm gonna do and it's look up of it, Master DNS Dalal abdel local had entered and now you will see it is going to the DNS server , which he created 19 to 1 61 29 And it is resolving itself. And it is one I to 1 61 that tweet. Awesome. Now remember, we created two more entries in forward look up zone and that was climbed and climbed. Beat. We're going to try to resolve that as well. And it's look up client a dot lab doll local and is showing one I to 1 68 Towanda to 40. Nice. And as to Klein, be 1 90 to 1 61.2 41 Nice. So the forward look up works. Now let's try the reverse. Look up. So instead of putting the host nameless, putting the I p one I to 1 68 dewan dot 240 and look at that, it is resolving it to t host name. Now Same way will do for 2 41 and it is resolving for client be now, If you build a new system and you wanted to add a new entry to the DNS server, all you would have to do is the CD into war name D directory. Then you will go into the forward dot lab. You've modify that you come all the way down and, for example, your type client see in a and then the new I P address off that Klein to 42 and make sure to update the serial number from 1 to 2. In this case, save it and then you could try to look it up. Client to see. Right now, it's not showing because we have to restart the name D service. So that would be system CTL restored Name D. Now, let's try clients, see, and you're gonna see that it is resolving to 2 42 Now. See, that's how you keep adding the host names, and it will keep resolving it for you. Um, by the way, there is also a command to instead of restart name D, you could you could reload the configuration for but any way you could look that up. So this is how you do the download installation and configuration off your DNS. At this point, you should know how does how it works? If you want, you could revert back to your original snapshot, Or you could simply do system CTL restart Network and what it will do is it will reset your at sea, resolved out com file back to original DNS 19 to 1 $61.1. So you're not gonna have a problem going to the Internet. And when you do ping google dot com, you're going to see it is ableto. Anyway, I hope this electricity this purpose, you learn a lot from this lecture. And if you have any questions regarding DNS, please let me know. It's just simple. Just go through my documentation, the war document that have attached and good luck.
133. Hostname and IP lookup: host name and I p address. Look up. What exactly that means is if you have t host name and you want to find I p address. How does it work? We do have DNS, right? And there are protocols that we run, like paying. Or, um, we go to a browser and we type in the host name or the website name, and it resolves to an I p itself because those are the type of protocols that knows that it needs to resolve i p address first. If you don't have those protocols and you just wanted to know the I p or host name, then you will just run the commands like and it's look up and dig their two major commands or tools that are given to us in Lenox. I believe they are also available. And windows, I'm sure and it's look up is, but I'm not sure dig is available. But you could also dig for dig his to find out if dig is available on windows. So what exactly these tools are these commands do for us again? They resolved host named toe I P I. P two i p or host name to hosting. Let's look at them by logging into our system. Unloved then through the council. And the command I will run is in its look up and you run this. It will bring me to its own menu. And if I type here www dot google dot com it is giving me the i p address. Google. What is right here. Right here is a resolve. Er meaning this is our DNS server rdn a server. Since we are running our machine local toe, our modem toe. Our modem is our Deanna server, and our modem is also accepting requests for the N S and Deanna's Port runs on Port 53. And when you see the message here known authoritative answer, it means that when I type and it's look up for that I p i that my modem does not have the information for that google dot com It went outside on the Internet to find that information for me. That is why you see that here not authoritative. If I had the information for Google saved in my local computer or in my local DNS server, then I would not have seen non authoritative answer. I would have gotten straight name and address so you could quit out of it or control. See out off it. Clear the screen so you could also run Hennes. Look up. It's simply followed by www dot Let's say, this time we'll do Hot Mela, and you will see the hot mill I P address is right here. Tool for 79 1 97 to 12 If you type this I p address into the Lennox machine or in your Windows machine, you will get the host. You'll get the page associated with this I p address. Similarly, the same command works for dig hommel dot com, and you will get same answer but a little differently. So some people use and it's look up and some people use Dick. Nowadays, a lot of people uses and more inclined toward Dick Command as compared to Ennis. Look up and it's look up. It's a very old utility, and you could get a lot more information out of Dick Command as compared to Ennis. Look up, so try and it's look up or dig command on different websites like www dot facebook dot com and then try to see if you could get this I p and resolve it to the pace that you go going to. So any at night example, we could try to open up our server right here. Oh, sorry. Ah, browser. And in this browser, let's quote some off the tabs in this browser, I will type I p address that shows up four Facebook, which is 31.13. That's 71 36. You hit and enter. You see, it took us to the Facebook took us to the Facebook page. That's how the Internet DNS works. It does not know the name it on. Lee knows the I p addresses. But since we are humans, we we tend to remember the names instead off I p or digits. That's why become easier for us to do to use DNS That actually translates host name toe I P . Address to try these two commands a few times, do run man command on them and see how it works.
134. Network Time Protocol NTP: and TP, This is the second service that we wanted to learn. And this service is stands for network time protocol. The purpose off the service is to synchronize your computers time to another server in case you lose your time. Time drifts from seconds, two minutes. And when you are running, um ah, few servers, more than one in a clustered environment and you running your workflow. So in corporate environment, it becomes very, very imperative that you have all your servers synchronized with one clock, so at the time won't shift. So the file that we will be configuring for NTP it is etc. And tp doc off the service to run the NTP demon is system CTL start or restart and TP demon and the command to check whether it is synchronized or not, we will have the command and tp running. So let's get into our server and we will do some configuration or if the configuration is already there, will go where it and we restart the service. This is our linens machine, and we are logged in as root. And the first thing we have to do is check whether the NTP package is installed or not, so you'll run the command r P m minus Qiwei and type and TP. It's telling you that I do have the NTP package installed. If you do not have this package installed, then you could just run junk installed and t p. And of course, you will get the option to hit. Why? Because it will tell you these other packages. If it found. And this is the size of the package, Do you want me to install it and you'll hit? Why? And it will install it for you, Since I already have Install is telling me already installed with the latest version, Let's move on. The next thing you would do is to modify the NTP Dakar File. NTP Dakar File has all those comments that starts with hash pounds or just ignore them. Go to the line that has server. Now in my configuration, I have previously selected the server 8.8 dot a 0.8. This server results to what if anyone knows any guesses, Pishevar resolves to Google. Um, it is a Google DNS server. This is configured for to provide your DNS resolutions as well as sometime people use it for network time. Poor recalls. So I have set it up a 0.8 and that's what I'm gonna use it. The other ones are. The center was pre defined. I'm not gonna touch them. And this that's it. I'm just gonna save it. If you don't have it set up, I want you to set it up as a 0.80 a and then save your file. Once the files saved, run the command system CTL and start your service in the service name is NTP D. And these against ants for Demon demon is a service that would never stop and just keep running as a process in the background to listens to the request that comes in. How do we know we have started the service? You do status and right here is telling you that NTP service is running good. So another way to find out whether the services running is PS minus F command and grab for NTP. Here you will see this line telling you the NTP server is running and the process ideas 43 40. You could kill that command by typing kill for 340 anti p. Q. Is the command that will bring you to interactive mode. When you hit, enter you type ears and it will tell you which servers you are connected to to get your time. You are getting your time from Google. This is the first ever. If you remember, we just configured it with a dot a dot a 0.0.0.8. And that is the Google Server. Be getting our time from it. The other ones are center where servers. So if you have confirmed it is getting it's time now, well, just quit out of it. And if he wanted to stop the service, we'll just do stop, and it has stopped. And if you want to verify it, you'll see there's nothing in there. So NTP is another one off the M service that every system administrator should know. And it is very again very imperative that you all your workflow servers should run and tp to have time synchronized between them. So try this and take people different servers and have fun
135. Chronyd Newer Version of NTP: Cron e d. Now, Connie D is a demon That is the latest version that is used nowadays to replace an NTP demon. Now, why did they do it? Because it probably have most enhanced features in it. So we'll cover that crony D in this lesson. So the purpose off Cron e. D is a gain for time synchronization exactly the same way as NTP that he had covered before the package name that you would need to install or this program is called Crony D. The configuration file is at sea. Cron e d dot com Fall. This is where you go in and specify the NTP server now again, And T P is used to synchronize your system clock where the next turn oclock or any other club within your organization that serves as an NTP server. Then we have a log file for Cron, e d demon and the log file. All those recording are all activity are is logged in to Warlock Ronnie, um, directory. And then we have a service. Of course, when you configure the crony de Dakar file, then you have to start a restart, a crony de service, and by now, you should be familiar it system CTL start crony D and the program Command that you could run Cron e c. Which will tell you which on DP clock you are sync with. What's the status off it. So let's look at our lyrics machine again and we'll try out this new feature of this new program that is used in Red Hat and sent to us. Okay, so I have logged in as myself to or Lennix Machine. And, of course, through Consul, see who we are. You are self. Which hosts are beyond. We are on our correct host machine Now. I want you become route. Okay, Now check if he have the package and the package name is craun e deep. So it's r p m minus Qiwei again. Rpm is script that will list all the programs that we have in the minus option Q and A and we'll grow up for crony D And when you could enter, um, I think it's just like crony Believe not Ready? Yes. Okay, So I have confirmed that I do have the Crown Edie package. Sorry. Crowning packet, Of course. Now what's the next step? He always do Once we have the package install, we configure it. Right? So let's go into our configuration file, which is at sea Cron e dot com. While it better and this configuration fall pretty much looks the same as NTP dot com file . And we would have to law go to the line. Where's his server? This is where you define your NTP server. And if you see first server second, there therefore service that automatically defined. And these are actual servers set up by Santo West that put a new line, and I'm gonna have the server as pool dot and t p Don't pork. Now, this is also one of the server. So you know what? Just as for giggles, we just sink it with google a dot a 0.0.8. So, of course, this is not on anti peace over by Google. This it's just a DNS server, But just for practice and training purposes, I'm just putting that. And so this event we checked, the status will see it is connecting to the cool. Anyway, you escape pod If it and do right and quit now, you saved it. Now the next step is you have to start to service. So to start the service first check it Assistance services running. Um system. See Thiel status Craun de. And it stays right here. It say's enact. Okay, so we have to make it active. But also one thing. I want to mention that please do not run NTP and quantity at the same time. So check the status off NTP as well. Sorry, anti PD. And if it is running, I recommend you to stop it. So it is running as you could see her right here. It's his active. So let's stop because we don't want to run to services that performs or that serves the same purpose. Let's do status and stuff. Now that has stop the NTP. Just verify it. And it says inactive. Right. OK, good. Also, I want to disable it so it does not still get started at the time at the boot time, the disabled And now it is. They see now I could go ahead and do a system. See Thiel Stort. Cron e d. Okay, this started. Um let's check the status, okay? It is active. Okay, Now we have to enable it. So it gets started at boot time if it is enabled now. Okay, so now the program that comes with this package, it's called Cron E D. C. So it's scrawny space on then CCF I think it stands for command Killer Crony, See? And then you hit Enter. It will bring you into an interactive mode program motive, its own crony crises, and now a new type help You'll see there so many commands that you could run within this program. But the one that I wanted to run it's called sources. This will tell us, um, where did it go? Right here. So this will tell us which, um and TP So we're connecting to, so type this command. So while I'm in, probably see So it's sources hit. Enter and you will see right here the 1st 1 If you guys remember that I picked 8888 So this is a Google server that we are sinking our time to. And of course, this is not actually an anti peace over. I just picked it for training purposes so you could exit out if it I think it's quick. And, um, I will go ahead and modify my crony de upon e dot com. File again, and I will remove this first line once it's removed. From this way, I'm not hitting Kugel Head, DNS Server for some different purpose anyway. So now it's modified, removed. And now do restart on the service because we just modified the configuration file Every time you modified configuration file, you have to restart its service now, running this granny see again and now you do sources and you will see. Now it's going to a difference over which is defined in there, depending on what is it resolving to? So that's the topic above Cron e d. Again. It's a replacement for NTP. It has in your features. You go look it up online, whether their your features and was the difference between and tp and crying.
136. New System Utility (timedatectl): Hey, boys and girls. In this video we are going to cover the new system utility command and that is time, date, CTL, all one word, or you could be pronounced as time date control command. The command is a new utility for rel, which is Red Hat Enterprise level and CentOS 7 or 8 based distributions, which comes as a part of system D system or service manager. It is a replacement of old traditional day command which we learned earlier. So date command and the time date CTL command both exist right now and the systems. But eventually in the later version, it will be completely replaced with time date CTL commands. So it's better that we started learning from today. The time date CTL command will query or show, change your date, time, and time zones of your system clock. It synchronizes the time with NTB server as well. So you could either use chronic D, which is a demon that you need to have your clock synchronize, or the older demon, which is for the anti PD, you could use either the service. And then in that time they'd CTL with a different option you could set to as a yes. So it will look it up to these two demons. Or you can use a newer demon, which is system d dash time sync the D demon to synchronize time, which is a replacement of NTP D and chronic. So you have to of course, have to have that new demon. This new daemon is a very lightweight. It doesn't offer a lot of different features that chronic ED or NTP D had to offer, but it does the work. So one thing you need to keep in mind and please note, please remember the CentOS and Red Hat. Neither one of them does not provide this demon in a standard ripple. Meaning if you download it or install CentOS or Red Hat with GUI, you will not see that system d dash times sinc, the D demon in your packages. You will have to download it separately. So in this video, we are now going to go and download this system d times sinc D demon. We will just cover that time date CTL command, and we will see how we could use that command to synchronize with Ronnie D. Alright, so let's do some lab exercise and run this command in our Linux environment. So the very first thing we have to do is to check the time status. We have to run the command time, date, CTL. You can run just by itself or the command followed by status. So I have my Linux machine opened. By the way, I have both machines or Red Hat eight and CentOS 7. So I have both versions. So this one is and CentOS 7. So I could run the command, the time date, CTL, and it will give you that information, Local Time, Universal Time, RTC time time zone. Is NTP enabled? Yes. Is NTP synchronized? Know so DST active time next DST, it gives you all bunch of information. If you do the same thing with our version eight, date, time CTL, sorry. Time data CTL. Okay, I'll give you a local time Universal Time, Time Zone System clocks synchronized, know, NTP servers active? No, it's an active. So why it is inactive? We'll figure it out as we move on. So, so right now, let's move on. And then the next command to view all available time zones that you have in the system. You could just simply due time, date, CTL, list, dash time zones, and ever give you all the time zone, you just have to hit the space bar and it will keep going. And if you wanted to get out, just simply hit q. Same thing with our version eight, time date CTL, list, time zones and give you all the time zones. Then next thing is if you wanted to set the time zone or differently. So right now my time zone is set to, let's check again, is said to America and New York. That's where I am as well live. So my time zone is set perfectly. If you wanted to change where if you see you have a wrong time zone, you could set it by simply running this command, time-based CTL, set a dash time zone, and then put double quote, America slash in New York. If you do not know the right spelling or exact spelling of your time zone, again, again, you can run the command time date, CTL, list time zones. Our next one is if you want to set the time or change the time, you could just simply run time, date, CTL, set dash time, and then year, month and date. And this is for if you only wanted to set the date. If you remember in the previous command in the date, you will use the command date with the minus S option, which is to set the time or the date to set the date and the time together, you have to run the command the same command set time and give it the entire parameters, which is the year, month, day. And then if you are using if you're doing 24-hour format, then you have to specify the 24 hours format, hour and minute. And then the second. Then to start automatic time synchronizing with a remote NTP server, you have to set the NTP true and then you have to check the status. So let's go right now and see if you have NTP set. So right here, it says NTP enabled. Yes, but NTP is not synchronized. It means maybe our chronic ED is now running. But first we need to find out whether we have chronic D or anti PD running. So for that we have to do system CTL status and TPD and you run it and it says NTP service could now be found. Okay, it means it's not installed and running. Now let's try cranny D, and we'll see yes, it is installed, However, it okay. It is installed and it is active and it is running. So what we have to do is let's restart it. So it gets synchronized with our time date command and it says NTP synchronized. It says yes, Sorry, No. So how do we have to make it synchronized? We could try time. They'd CTL set and TP, true. Okay, now let's run the time date CTL command without Saturn, orbit status doesn't matter. And there it is. You see NTP is now synchronized because we have enabled it and set it to true. So now it's looking for that time with chronically. Similarly, if you go to our version 8 times 8 CTL, This command or status, both same commands. It doesn't really matter. Let's clear the screen too. Okay. Now you see system clocks synchronized now. So we will do is before we synchronized, we have to make sure chronic ED or NTP service, either one is running double-check system. Ctl status. First, NTP D. Okay. The service is not there, not even installed. Okay. Let's check, Ron ED. Okay. It is inactive. Okay. It is installed. However, it is an active. So first of all, what we will do is we will enable it. So it could start at boot time, and then we could start that chronic. Ok. Now it is started. Let's run time date command to see if it automatically synchronized to it. Okay, it says system clock synchronize. However, the NTP service status is 0. It is active. Beautiful. If you don't see this active, then what do you have to do? Simply run that command and time date CTL, set dash NTP to true. And then you do time date CTL and it should show here. Yes, and active. I'll see you in the next lecture.
137. Sendmail: send mail. Send Mill is another one of the major service that is used in clinics or UNIX environment. Send Mill is a program that is run in your living systems to send emails and receive emails . But I would say primarily it is used to send e mails because when you have a program running in your system or our workflow running in your system, and you do want it to be notified if this if the process finished our if the whole workflow finished successfully, you do want to get animal at the end. That's when you actually have to have some kind of milling program. And the most and ready, readily used program that runs in Lennox is Sand Mill. So the purpose is again to send and receive emails the files that the configuration files off Sendmail is at Sea Mills and mill dot emcee, which is the main file. It's EMC cents for milk configuration, and you configure everything in this and once you actually compiled us ah configuration file, it sends all its configuration to at sea Males and Medhat CF. Many people go straight to send mail dot cf, which is also OK it's fine. It's nothing that you're gonna break anything. But it is, ah, standard and practical, practical way that you should always go to send more than EMC and then compile it starts system. Start that send mill and it automatic pushed the changes out to this configuration file. All the configuration file of San Mill is located. All the files are located in etc. Mill directory, the service that you need to run or start with your system. Starting stop program is system CTL Restart. Send mail. Send mail is one of those programs that does not have D at the end, but it does not mean that it's not running at all times. It does run in the background. It is still a demon, but it's somehow never got a D at the end. The command that you will run if you want to send email out from your server would be male Dash s, which is an option and then coats. You put a subject line fall by the email address that you are sending it to. Once you send it and hit return on your keyboard, it will bring you a kind of enter active or like, ah V I kind of mode, where you will type everything. And then once you're done, then you'll just simply do control D and it will get you out of the mail program, and it will send the email out. So to illustrate that MAWR will get into our Lennox machine and we'll look at some of the files and command are related to send mail. So we have our server hair log in as ourself and most like if it has already logged in as root. How do you verify it? We'll just run where my which is a commander tells you which users long did. I'm gonna move the window to the side so we'll see exactly what we're doing based on our slide in the back. So the first configuration file is send mail. But of course, before we get into the files, the first thing what we need to do is we need to find out whether we have the send milk program installed in our system. And how do we need to find that out? There is a command that you run RP minus Qiwei and then you grew up for send mill, our P minus Q. A list, every single program or repository or package that you have installed in your system. So I ran it. I see it. It's not there. So the next thing we'll do is we will install it to install a package you run, jump, install, send mail. And, of course, remember that this is going to go outside on the Internet, where all the center was repositories are located, and I'll get that package from there. If you do not have Internet access on your Lennox machine, it's not gonna work. It will fail. Safe's cannot reach the Internet or cannot reach the their repositories mirrors. So once I run, jump installed sand male, it's telling me that it phone one package and the size of do you want to install it? Yes, of course. I do want to start. I'll click. Yes, and it'll start installing it. Download, install, verified. Clean up. All that stuff is gonna go through. Okay, the insulation off send mail is completed anyway, there is an another package that you do need to install, which does the configuration of your sent mail, and that is send mail. Dash CF. You click yes to install it. Okay, it is complete. It's awesome. So once you have the package installed, it means it already creates your directories for you where they belong. It already creates a configuration file for you. So the first thing we have to do is called a configuration file to define its configuration parameters. The configuration files, all of them are located at sea mail, and you'll see right here the first 3rd 1 from the top, I said, Send mail Emcee. This is where we will define our mail relay server, and what is a male really server mail relay server is a server that is set up in a company in and wire man, which will accept your e mails that coming from any of the server and then deliver. It's like a middle man, which takes on the left hand. It takes your message on the right hand and delivers it. It's a it's a server as well. Sometimes it's a Windows server. Sometime it's Lennox, ever depending on your environment. But Cem mil release over. Okay, so when we come down to this file, anything that starts with D N. L, it means that is just a common you could ignore that we have to come down to a line. Viruses define smart host, and the smart host is far SMTP server or relay server, where we are going to send our e mails and it's gonna accept it. So you just put the host name with fully qualified domain name meaning the host name dot your domain name dot com. You will add it here once that has added. And next thing you have to do is you have to start the service system. CTO you start or start sin mill. Okay, the send mail service has restored it. Let's check the status. It says it's up and running. You can also check the status of send mail by running the command PS minus e f. And then you could just simply grow for San Male. And here it will tell you the 2nd 1 The 1st 1 is just telling you they it is accepting connections and this is the main process. There runs that you will kill it by typing the command kill followed by the process i d. Six year or 23 Now you could send e mails and the the command to send email is male minus s subject line is, uh, male set up and I wanted to send it to myself, so I'll put my email. Um, which is Imron underscore. And why? At hotmail dot com, I hit enter, and once they hit, enter. And that's where the male body is. Whatever that you want to type the text schools in. Hi. Hello. Um, goodbye. And once it's done, you all you have to do is type control. D troll d is type. You will get out off your mail program, and that's how you send and configure your mail male again. Once again, it's ah ah, one of the critical services that often time you do have to configure in your system. So familiarize yourself with the male files, the configuration, how to start and stop this mail service and how to monitor it and how to send mails
138. WebServer httpd: What server or http D this lesson is very fun lesson because I promise you at the end of this lesson, you're gonna be so proud of yourself that you gonna create your own first website on your own server. So the purpose off the http service of the Web server is what is to serve that pages right ? Like Google Facebook, hot mill or whatever the page that's out there on the Internet and even that say, if he wanted to sell something or you want to build your own website or even your profile website and you want to build it, you actually go and pay two companies like Go Daddy are ricks dot com. But now you could actually have your own machine and you could build your own website and you could publish it online so people could see it. So you have to pay. But anyway, this is this this lesson. The purpose of this lesson is not to tell you how to build your webpages and publish it on without paying anything. But is this lesson is just to tell you how Web server works and how we could build Ah, that page in our linens machine. The service or package name that needs to be installed or running in our Lennix environment is called H T T P d. The files are the configuration file off http D is at c h u d p cough slash h t t p d dot com This is the configuration file where you make changes, allow connections or, on a Pastrana Pacific protocol, specify the user directories and a lot of bunch of information. The next file. We have his war. W w w slash html index dot html This is your home page. Whatever the changes, you make an index dot html This is what it's gonna show up on your home page. So the service to start a service or to restart a service this system CTL, restart http D and to enable the service, which means if you want the service to restart or start when your computer starts its system, CTL enable http D the log files is war flash log slash http So this is the log file. If you are troubleshooting any issues, you could go into this log file and see why your server is not working anyway. without further do will log into other next machine. And we will start our star building our first page, and I will go into my machine. I got my i p address from my machine, and I loved in already into our party session. So I'm gonna go into my party session, become route. You are logged in his route because I have the pound sign here. It's clear the screen. Let's go back to our configuration. The first configuration file is before we get into configuration. We need to make sure we do have the package for http. D http package. Yes, we do. See, right here. This is the package Http. D cento us this one. If CPD tools, there are additional tools that are available for this This package And this is additional package that you could install whether that gets install automatically. Um, those are part of dependency. Anyway, the main package were concerned with this package. If you don't see this package on your legs machine, you will simply have to run jump installed http and it will go in and it will say I found a package for you. Do you want me to install it and you say yes. And you installed, by the way, Since I already have it, it says no package http available or I should have said D And then he would say that package this already installed and latest worship. But once the package is there, then let's go to our configuration file CD at see http Cough h t t p D. Sorry, this is a stew. DPD just make a correction. I have skipped d so seedy cough and the configuration file is http dark cough. So I will view this file and see if there are any changes that I have to make. For example, let's doom or for this file and anything that you see that starts with hash or pound, It means it's just a comment. So you ignore that and you could say See, right here says the root file system for this service is etc. Http. D and it's gonna listen on port 80. What? It means every time you go to any website, all the websites run on Port 80 or poor 443 which is a secure website which often prompts you that this is secure upside Do you want to continue and then you will see us. So if you want to change this poor to some other ports than you have to specify on the browser you world and that's how you get it. But anyway, this is a configuration file, and another file that we have toe find is right here says document Root. This is the one that I have listed here. This is war www slash h t m l. And then the last fall. This is basically telling me that the main page or the home page off your Web server will be located in this directory and their many, many other parameters that you could change in this configuration for the next uh, the homepage Fall is the one that we have to go to now in order to start making our page So we'll go to Seedy War W W w html, and the file name is indexed. Our HTML has two ls my SLT are and you will see here I do have a file name called Index HTML. If you don't see this file, don't get panic. Create this file from scratch and you know how to create a file from scratch. You could do touch command or you could do V. I command When I first created this index dot html fall. Of course, there was no file existed in this director, so I created from scratch. I have already some off the parameter sets and my home page said in this file. So let's look at it. So I want you to do V I index html and then hit Enter. The first thing is in your page. You always have to type doc type space. HTML and HTML code always starts and begins with less than and more than signs. This is how it works. Now you notice you are learning html code. The next line you would have to specify that this is an HTML file, so html open close The next line I have his body. What's inside or what shows on my home page. This is the body style background color, light gray. This is a light gray color I want for my page. Then next one I have br br stands for break. I want to space. They're not have h one percent's for header one I have in my head of one style text align center. I wanted to show up right in the middle and welcome to my first page and then you close the header. Then do you have header for these are the different fonts actually had a one would have a bigger font header to lesser had a three smaller and smaller and soul. And then on the second line, I have my name is Enron Absolute and break, break, break Close the body that you started right here. If you notice it's part of the body right here. Now you closing it and you're closing the HTML right here. When you started, every time you close these tags always put the slash. Now, how do we know what type of html code? We have to add more that you have to go into HTML class if you really want to learn how to build your websites. But this is just a basic listen. They want you to know if you want to get into I t or devil definitely help you to get a job . So I have all that, and I want you to type everything that you see here in your index dot html page. I have also copied this entire content to the description off this lesson. So you could copy from there and type of from there. Once you have a type, then you could simply save and quit. Now the fun part. How do we access that page? To access this page, you have to open up a browser to view that page. Right? Okay, So how do we open the browser? You need to know the address. Like, you know google dot com Mohammed dot com. What is the address of this? Well, we haven't put in this address in a DNS. So then how do we access? He would access it through the I P address. And the I P address is 19 to 1 68 I wander 12. So let's take this I p address and put it in a broader. So I have browser here. We'll put it this right here. As you could see right now, make sure you are putting this I p address on the same machine where you running your limits machine. So right now is trying to connect, and it is not connecting. I think I know why. Because every linens machine by D four runs firewall, and you have to have a firewall rules in place to allow port 80 traffic or simply disable it. I'm also the time disable it. But again, depending on your company regulations and security policies, you should comply with that. But for this training, I would say Go ahead and disabled his firewall, So I will do system CTL Stop firewalled d. This is the name off the fire World Service you hit Enter and it has stopped the firewall. By the way, I should have said, Let's do the start. It will start And before you stop it, just check the status, whether it's running or not. And if you had run this command before stopping it, you would have seen that it is up and running. So that is why we are not able to get into our home page. So let's stop it now, Okay, it has stopped. Let's go back to your browser and this time just had refresh or f. I is still not able to connect to see why we have stopped the firewall. That's two PS minus F grab. Poor firewall. It is not running right. It's just groping for grip. Then why it's not running room. Think about it. I want you to think about think like a system administrator. Why it's not running. Do you know why? Let's go back to our lesson. We haven't start right here. Look, it's a service. We haven't started the service itself. The service that's going to serve the page, the service that's gonna take their question right. That service has to run to actually have the Web server running. So let's go to our tear the party section again. And now start the service system Setia. But before we start, of course, let's check if it's running or not. Issued two p. D. Inactive Makes a lot of sense, right? Yes, it's dead. That's why we couldn't get to our Apache server. Okay, that started. It is started now. Okay, Cross your fingers, go to your Web browser and do F five again. We got our first page. Welcome to my first page. My name is Imron. Absolute. Do you guys remember? This is the same message that I have in my HTML text. Right? If you don't remember, let's go back into a less minus lt are on our directory and you'll see doom or or index. And you see here Welcome to my pay first page. And my name is Imron. Absolute. This is the only two lines I have. There you go. Right. So if you want to modify, let's say V I and I'll say take out this text and just put I did it. Yea, you know you. But yeah, OK, anyway, so you got my point. So let's save it. Okay, so now what? You should see here, right? The message every changed. So let's do a fire. I did it! Yea So that's how you create your first page.
139. Central Logger rsyslog: central Logar is This is a server that acts as a server, and it receives all the logs from every server, every clients that out there to receive the logging information. The purpose of this server is to generate logs within its own self, which manages all the laws in war log directory and also, if it is, has built to receive all the logs, then it could work as a central auger. And the reason we called central loggers because it is a central location just like you will see a lot of a lot of names like Grand, Central or central location, anything that is centrally located to receive all incoming traffic. Whether it is trains are airplanes or buses, you'll most likely hear the word central along with the name off his actual location. So in our links environment, we have the server called Central Logger, and it has a service that runs within that server. It's called RCIs Log, and the name of the service of the package is R CIST log. It is not. It does not have a D at the end, but it's just just just something that you have to get used to it. I don't know why it does not have the some of the service has its, um, off them services don't. But that's OK. You said there is something. You just have to live it. Um, configuration file is located at ceases Lada car file. This is where you go in and change the parameters. If you have to and the service to start to stop its exact Syntex would be since system CTL restart RCIs log and to enable it at boot time. Which means every time you report your system, you want the service to be up and running along with the system. Boo. So you enable it. Picture speaks 1000 words. So that's why I have this picture on the right hand side. If you see in the middle, we have the server which is acting as a central logger. It receives all the traffic from all other servers. Those servers could be any any. It's not specifically silver could be a modem. It could be a windows machine. It could be a Lennox machine. It could be a printer. You could have any of those devices configured to send a slog traffic toe. One server Now, the good question is, why do we need a system RCIs log server or central logger? Well, ask yourself, if you are working environment where there are thousands servers and you having issues with servers every now and then sometimes three server, sometimes tense, ever sometimes 100 servers. Are you actually gonna go log into every server one by one and check the logs to see which system is having issue and where. Actually the problem is happening. Of course not. Right, because it's tedious task. You don't want to waste your time there. You're productive person. So you want to make your life much easier. You want to make your system more efficient, so that's when you create the central logger. So let's go into our legs machine. I have a party session open. Andi, I will go straight into the party session off my machine. I'll just make sure I am rude because you have to be rude to go in and modify those files. The first thing you have to do is check if you have the package installed for RCIs log. And to do that, the commanders rpm dashiki Way, which will list every packages install in your system. And the reason we use grip is because we don't want to list every package that out there. We just We're just concerned about harshest law packet and you run it and you do get that information that you're looking for, excluding all other packages that you don't really care about at this point. So you have the package perfect you. If you did not have the package, you would have to run Jum install or CIS lock and it will install the package. Aziz, long as you have Internet connection and it goes to Sen tox santo s or any red hair repository. Now the configuration file is at sea. Sis Parsis log compa Sorry. In my configuration file on my slide I missed Are is just a misspelling. I'll fix it so that the file is at sea are cisl dot com and then you go in there, you hit enter and anything you see again that starts with hash. You could ignore it. Some of the parameters are by default has been commented out. If you want to have it enabled, if you want to traffic you to be traffic or any of the traffic coming and you have to take out this hash sign in front of it so the parameter would be enabled. The one that we are really concerned about is all the way at the end. Which one is right here? Starts with hash would have to take it out. If you are sending your system, this is your system. If you're sending this system logs to another central logger, you will specify the name, the host name or the I P address off that central longer. This is the port 514 By default, our CIS law communication takes place on port 514 Just like any other services like DNS talks on Port 53. And there are many other services like NTP talks, I believe 1 23 Just like that. Every service has an associated port to it, and it will talk only on that port. So you save it if you want to comment that out and then once you have it saved, you know you're sending your logs. The next thing you do is you run that service before you run the service. Let's check if it that service is already running or not. In my case, in our case it is running. It is active. Perfect. If it is not running in your system, I would tell you to run it by doing system CTL and do start animal Star service again. This is how you send the traffic over to one central auger. It's the best way to troubleshoot for a system administrator, and this will make a life a lot easier to have all the logs and under one roof.
140. Securing Linux Machine OS Hardening: Lennox operating system Hardening. This is a lesson about how can you can secure your Linux operating system Well, there are many different ways that you could secure your operating system, so it it is not vulnerable to the wires is attacks or anything that could harm your system . So this is also one of the most important topic and Lennox, and many times the recruiters or hiring manager will ask you this question about how do you secure your lending system, or how do you harden your operating system? There are few, many different ways you could. Even if you go online, you'll find a lot of different ways. But I think the most basic ones that anyone should really know Rs Fall The 1st 1 is about the account management. How do you secure the user accounts, one of the policy of standard that you have in place. Then we will cover about remove unwanted packages all the package that you have installed in your system. If you don't know need them, then why do you keep them to remove them? Then we have to stop unused services. If a service is running that is not required in your system. Stop it, toss it. Check on listening. Port some off the time we have pores that are listening for traffic for incoming traffic. But we really don't need any off those incoming traffic. So what do you do to stop secure? Ssh configuration will cover their later enable firewall I p tables, which is all the words in and firewalled in the newer version, Of course, again, the Wilco in detail on how we could enable I firewall in our system to make our system more secure as the Lennox A ceilings is in your feature, um, that you'll cover also as poor off this lesson changing listing service support numbers. So, for example, if your report is running on, let's say ssh 22 you could change it to a different port. So the hacker who knows that you know the port 22 runs for ssh when they tried, they are getting refused then, alas, but not the least. Keep your system up to date, so you should have all the security patches itself. So let's cover them all of them one by one, log into the next system. So I have here Lennox Machine. I logged in through the council. So the first thing that we talked about is about user account management. How can we secure that? Well, the first thing that I should include in this is about the naming convention. When you create a user name, for example, oracle or admin, I recommend everyone to know I use the standard Jews UNAIDS because it's very easy to predict those, um, there's used name. So instead of oracle, you pick like oracle. 123 or 123 oracle instead of admin, you pick t admin or s admin. So how do we get the all these names you go at sea? Um, the password file and you will see the listing off all the users that we have in our system . You see here on 1st 1 call them before the colon. We have the user name like Spider Man spider. That's my name. And many other, like NFs scrawny eso. You could change the user name to a different name, so it's not easily guessed. Another way, I would say, is by default. When when a user is created, when you run the command user, add when you create a user. It automatically assigns Jews variety, which usually starts with three digits or are four digits, with 1002 on. So I would also recommend or industry standard that to use anything from 10,000 bucks. This way, it's not hard to guess. Another way is about the password policies now had. Often, your password changes how long your password should be. All the information can be looked at by running the command CH age, which has changed age. If you do, minus L on the user name, which is myself, you'll see right here last password change. This is the time, and I change my password. Password expired. Never password inactive, so passport expired. Never. It's not a good sign, since this is a lab environment is for training purposes. I don't really care. But in a corporate environment and production environment, there should be a date to change the password. Same thing goes for an active password. Account expires. When does it pass work? What expires a number of days off warning before password expires, and so on. All that information can be changed. You could set your own standard. Depending on your company's requirement. You could run ch age commanded. Dash does help to find more information. How you could make those changes for each user. Also, if you go to that see shadow file, you will see um, permission tonight after we root. If you can't out that see shadow file, you will see each user has issues. The name it's past for at the end of the past were in this colon It has these numbers thes are the same numbers that we have defined and change age. You could change by David this command see a change or you could coast directly to the etc Shadow bottom Make the change we'll see here. This seven refers to this seven this 999 1st this 9990 refers to this zero so you could get more information about how you could change whether you could do through the etc shadow R c . It changed age. I would before the Hughes change age. Anyway, um, moving forward also another come another file that you should look at is etc. Log in on deaths. This is to file that she could also define some of the parameters. Andi, those parameters are That's look open the file again and you will see here. Maximum pass from baxam days. Thes are the default settings. You could do it by per user basis. Or if you want, apply to a default setting. You could use it here. See, Pastor, minimum length five. If you if a user is putting a password and, um, for that it's not gonna accept it. So it has to be five. But of course, over a command. Go at least 12 or 13 and change it right here. You could also disabled old password. Another file that actually manages user accounts and security is at sea. Pandey the directory and file system off. Um, and you look at this file. It has a lot of other parameters that you could define. I want you to spend some time here or even look it up online and study every field off this file to understand exactly how this works. Um, next one we have is above remove unwanted, um, packages. Right. So how do we get the listing off all the packages to get to the single packages? I think you should know that if you have forgot, that's fine. R P M minus Qiwei and then you hit, Enter and you had enter. You get a bunch of list of all the packages. Now, how many packages do I have in my system so that it's just like a quiz for you? So tell me how many packages were? Well, the commander's rpm that's Q A. WC minus l. And this will count every line output of our pm que it? I have a total number of packaged 1350. So there are so many package that I really don't need it. So what do we need it for? Won't get rid of them. So to get rid of a package the commander's R P m minus E and the package name. So also, remember, when you are deleting a package, it will ask you that this package has a dependency on another package to be very careful on on that, if you remove the package, it and it and that package has dependencies on another package or other packages. Dependencies. On this one, you will have some corruption and some programs that won't work properly, So just be careful. Then we have. The next one is stop unused services. Okay, How do we kid? What the listing off all the services of your running. If you run system CTL, dash A, this will give you everything active or inactive. So if there is a service that is active and you really don't need it, you could just simply stop it. If a system is serving the pages, why do you need NFS service on it? Right. So that's why we stopped the source's. Then the next one we have here is about check on listening ports. Now, how do we check on the listening ports? Every service that you run has a port associated with it. So if you run, that's that base dash t you in l. P. What? Why am I picking these Pacific options is just that that I've been used to it. You could pick different options to check the ports. When I enter, you will see all the ports that are open and listening right now. See hairs. I p address right here. And this is my local. I'd be and again, this is my local I p. And you'll see everything that after that has of these port 111 53 22 6 31 25 Tell me what 53 is for. That's a quest. Well, if you don't remember, 53 is for DNS. And as I said, DNS, what port it runs on. Also one of the important question. So if you if you if your machine is not serving us a DNS, why do we have a 53 port running to stop it? The next one we have is about securing as a sage configuration. Now, if you know that when you log into system remotely what protocol you use, you use a sous age and on the poor 22. So this could be secured as well. So if you go to CD slash ssh And then there was a file called S H D config. And then you had entered more on it. You will see this fall can be modified, and a lot of its parameters can be modified to make a cessation more secure. And what are those things that can be modified? The two basic ones that I usually make changes to is number one is I change the port. So right now, if you see the port is running on 22 I would change it to 10 22 of which over the port that I would like to have sold. My system is more secure. Another thing that I like to do whenever a building system is I go in and I enable this right now. You see here, this one has hash sign anything that starts with hash. It's a common. So I will take out this hash sign and I'll say, Permit root log in and I have the same No. Why? Because if I'm logging in or if anybody's logging into the system as route, it will deny it. They should log in as themselves, and this way they could become your route. The reason behind this is because every time a user logs in, let's say if I log and my activity will be long dead at the time and I logging in and what time I became crude, so all that tracking information will be recorded and it will be a lot easier to understand who did what to the system. So these are a couple of things I will do with the message configuration. Then we have enable firewall when the firewall, As I said, There are older version of firewall that Courant's In Grete Had six and older is called I P Tables. The newer version Off Firewall with seven and above its firewall D both serves the same function. The viral D has a few and has functions. You could look it up again. If you want to learn more about firewall now, I could tell you what firewall does. Fly woman. You have it enabled in your system. What it does is that you could filter out meaning if you want to only accept the traffic that coming in one or 22 you couldn't tell firewalls. A firewall. Onley. Accept traffic coming in for port 22 or only accept traffic coming in for port 1 23 or 423 Anything that you want to make the changes to firewall anything you want, the service of it running so far, what is like a ah watchdog, said defender, our gatekeeper for your system, which allows someone or traffic to come in or and it allows the traffic to leave the commands that you need to know for firewall, as in Gui in the newer version off Lenox. If you are using Google, you go run firewall dash, convict it enter and you will see it will bring up a gooey. This gooey will let you enable services. That's your navel ports add ports. Remove protocols are at poor cause. If you see if you want to add important, let's say if you enable firewall on your system by default, it will block everything. So once you enable firewall, it's not gonna talk anybody outside. It's not gonna talk. Have anybody talking to you. So how do you enable the communication? You add the ports? Click on add. You put the port number. Let's say I want everyone to talk to me on I'm a DNS server. So talk to me with 52 three. I'm allowing it. That's good. Click OK and good. Perfect. So that's how the firewall or I P table works in your system. And that has cool. What if I do not have agreed? Okay for that, there's another command for Text Bake based on Command Line Command, which is firewall that CMD voyages for command. And then you do help. You'll get a lot of information. How do you find Or how do you square your How do you remove a port in all the words in B Have the command I p tables. So then you had tea tables. You could just to help. And you will see all the information that you have right now if you enable the i p services and then you run i p tables Daschle list of a list, All the services anyway, the configuration file for I p tables, Theo. Older version is at sea This config i p and six convicted complaint file his i p tables convict. And this is a father you could go in and modified. If you don't want to modify through the command line, you can modify through the file and then restart the services. In the newer version, the file name is etc. Firewall the I'm sorry. Uh, that see Firewall D is the director and the fire. What is firewall d dot com? This is the one that you could modified. Then we'll move on to the next one about securing our system, which is change. Sorry. Enabled S e Lennox. Now what is a c? Lennox? Let me read you something really off the Internet are standard definition off SC, Lennox, etc. Lennox stands for security and has Lennox is a security architecture integrated into the $2.6 ex colonel using the living security module, also known as L S M. It is a project off the United States National Security Agency, which is stands for S A or bridges are everywhere. There's and I say and the SL in his community excellence integration in to read had links. Enterprise Voice was a joint effort between the NSA and the Readiness s Olympics. Defines the access and transition. Writes off every user, every application process and a file the system on. So if you have ah, if you know every offering system has an application, it has a process. It has a file, its as user. Right. So we have talked about these user permissions on how we change it. We change it to the change mod right now. How do we change the permission of a process? How do we change the permission of an application, right? No, that's not possible with the operating system. So what we did? We have this SC Lennox which controls the access that the permission, access off process and application. And it goes deep, deep down in the detail and control every access off the pot. The configuration part If you wanted to make sorry, if you want to make a c Lennox enable the first thing you have to do is run as C status to make sure if it's running or not. And if you do s east at us, you see, in my system as e Lennix status is enable Now, a lot of companies that have worked in the past and a lot of people that I've talked to, um, they usually keep S c Lennox disabled, um, which I understand because many times that computers are there in why am I running in a private network so that they really don't need it? Plus, s ceilings is a very newer technology, and it's it is a bit complicated when implemented in your system. So you have to have ah, very detail on better understanding for SLX. So if you want to disable it, you all you have to do is go to see it says config, and you do the I. I'm just doing more for now and you will see right here. Let me clear the screen so there won't be, um, confusion when you look at it. So you see right here anything that has hash sciences, of course, is common. So you see, right here said at Sea Lennox equal enforcing. It means it is enforced and it's enabled. And there are three modes off a salon X one is enforcing, which means the A seal next security policies enforced right then the second is permissive , which is telling that a seal inexistent prints warning but does not enforce policies. So if someone in making any changes, it'll print hate. Something was going on, but it's not going to stop it. Then there's another one. The last one is, of course, is the disabled, of course, which disables at sea Lennox so you could change it here. And once you have it, it is recommended that you reboot your system. Eso to check the parameters of a file, for example. Let's say if I go to my home directory and these are the files and directories I have, So if I just do status or just started just at and I do, let's say I have this file called La La Land. You will see right here. It tells me everything about the ball falls named the size the block the I'll block and right here says access, which is read, write, execute, Right? We already covered that. And if not, then you already know that it is like it could be defined. Changed mod command. Now, if you noticed right here, this is a new thing. Context to this Pacific file is defined, but the object is use your home. So that's how the Assyrians keep track off which directly belongs to which user or rich file. And it also gives you access, modify birth changed on all the different information we could change on Lee the read, write and execute, right? But all that additional stuff, if you want to have it, that could be done with SLX. Anyway, there are other commands that I want you to look into it, which I will not cover here, which is because SC Lennox is a huge topic just for your knowledge or to have you haven't somewhat exposure. You should know what s C Lennox is. So anyway, some of the Commander Vasily nixes C h con which change file Assulin security context. Then we have checked policy Nature is a selects policy compiler and the other ones are new Role set SC bull set SC pool fix files as he manage and so many of the commands that I will not cover here. Also, I have attached some documentation which you could read. So this is about as c Lennox. Now, this second to the last part that I want to color is about change Listing service parole officer with port numbers. Now also, I covered that a little bit on the SC. Sorry, a sausage configuration where you could change from port 22 2 different ports. You could also make the same change to other services. For example, DNS by default run on 53 right? You could make that changes as well to make your system more secure. And the last one is about keep your operating system up to date Now it doesn't mean you just go online and do junk update all and just update everything. All the packages that you have, you don't have to do or you don't have to update every package, but you do have to make sure. Especially anything that is related to security. You have to update. And how do we keep on up to date with the security? Well, one thing is you keep on running on Young Abdel updated. Right? But that's isn't the right way to do it. Well, what I do, I could tell use. I keep myself up to date with, uh, with all the alerts that I get from red hat or sento us or even windows. Every time there is an issue of there's a new pash that comes out, I can't notified. I have an email, so I would recommend you to do the same. Go ahead and sign up one redhead dot com on santo esta. Soon as you get any off those updates going apply. That's how you keep your system secure. Anyway, um, this is about how you could do your system secure or always hardening if you cover everything here in detail. And if someone is asking your question, trust me. You're gonna ace it if you go over this. All right. Good luck
141. OpenLDAP: open eld up installation. This lesson is actually related to Module five were recovered at what? How the juices are created when we need active directory type off doctor services. So I am including in this module is because in this module that's where we have enabled a networking to talk to outside world, which is to have Internet enabled. So if you need to go back to Module five and review what elder open elder is, what are the differences between each off the ah director services? You should go back and review it, and then you could always come back to this lesson anyway. So open held up. What exactly? Open held up is so open. Elder is basically an open source implementation off lightweight active directory access protocol, which is also held up. It is developed by open Elder Project. So there is a company which is the open source. They actually do community work. A lot of people have joined together to build this product called Open Elder, and it is an Internet portal. Called that email and other programs like user access, used to look up contact information from the server. It is released under open elder public license. Um, it is available for all major Lennox distributions. Also a I X android, hp UX, um, OS X, Solaris and even windows are nowadays using open held up If there's a need because it's free and you would have to pay a active directory Ah, for the for the product of Microsoft. So it is becoming very popular, especially in the next world when you have thousands off users that you need to manage, and you need to have them in, ah, access to many different servers. So that's pretty much what open held up is now the open El de. Once we do the installation, it's completed. The service that we need to have enabled and running is called S L a P d. To stop and start the service for open held up it simply system CTL start s l a p d. Same thing if you want to enable it. Meaning if you want the service to start when you computer, are you when you're Lennox Ah, boot up. Then you have to run the command system. CTL enable s l a p d. Of course, I didn't include the stop. I'm sure you would know that. Ah, And also you grew the restart command as well. System CTL restored with the service name. Where are the configuration? Files are located. Once you have the open elder installation successfully completed, then you will find that in etc. Open held up s LAPD dot de This is the directory where you have all the configuration files medical go and make changes to it. So let's go into, um, log into our Lennox machine and we'll go over the installation off open Elder. Okay, so I had this Lennox machine open. Um, I am logged in as myself. I will become route. Okay now. Ah, before you go ahead and do the installation, make sure your Lennox machine can go outside in it. And the best way to find out is always do ping command to paying any server that you like. And if you get the 64 bite back and ah icmp is coming back with the time to pink, then it means you can reach it. You could reach the Google server Perfect. Let's clear this green now The command to install the open elder is jum Install open l tap I believe it's Ah open l dap. Or, um, it's probably open Dash held up, but anyway will try Just open Elder And I want to do asteroid care and as well as I want to do Asterix care the reason I want to put these stars before and after it means any package that man that matches open l David whether the open elder comes after the name or before a name, then they will download all the open elder, um packages. So go ahead and hit. Enter. It's gonna go out and check all the mirrors, all the repositories that are available to us And here it has a list off all the open eld up packages, all the rpm's, and then you could see and installing the packages you will see right here. Here is a list of all the packages that it will install on your system. And here is a quick summary for the transactions and you could see the size is 4.5 megabytes. So is it Is this okay? Yes, of course you want to installed at so hit why and hit enter. So always first, it downloads the packages once the packages are downloaded, then it goes through the installation of those packages. Once insulation is completed, it will clean up any off their remaining things that it's not needed. It will clean up. It will verify the packages are done. It's installed, and it will give you quick summary of the bottom. And then you see the the message right at the bottom says Complete. It means it has completed successfully. So now you have the open held up installation completed. Now it's time to do the configuration. Just one thing I just want to add quickly. I am not going to do the complete installation off. Sorry, complete configuration off the open elder is because it requires a lot of work. It is a completely separate topic because it could take, um, hours and hours, depending on how do you want to configure it based on your environment? It's just a matter off open elder. I want you to have some kind of exposure to it, so you know how to install it. How does it work? And there is a way. If you need to have some kind of directory services in your environment, then that's how you go about it. So now we have a Donald. So let's say if he wanted to, um enable start the service. So you remember to start to service is system CTL start s L A p D Nick. So it has started. And how do you wear five? You could just do system CTL status and you will see that it is up and running. Especially when you have when you're using a gui terminal, you'll see it is active and running and it is in green and all the other packages and package information where those are located where the father is located, everything is here. You could also test another way that if it has, if the service or the process is running and I'm sure you know Bye bye Now that command is PS minus E f And then you grow four s l a p d. And you will see right here the first line you will see Els up use It has been This is a process that is running again. The 2nd 1 is just the process. It's just a command itself. Since I ran the command, it is groping for itself. So the 1st 1 has verified that we have Oh, open held up. Um, process. It's running. Ah, the configuration file are located in at sea Open Held up S l a p d dot de directory. When you do when you go into the structure, you could do simply ls minus. L or lt are. You will see, these are the configuration file. You would have to go into these configuration file modified the way you want to and on your system on your system. Local file system. You would have to actually go to one more file, which is at sea, and the file name is ennis switch dot com file. If you go into that com file, you'll see um, right here, um, for his his password. See, right here it's his files. It means first and every time a user log in it will go to a file And which, while is that that file is at sea password. That is a kind of a local database that is in your legs, machine or local file that keeps the inventory of all the users that are locally created. So the first time you just logs and it will always go to a file and if the user is not found, then it will go to another one. Then you have to. CSS is you have to replace it with L D. A peak l'd up will go to that held up machine. Um and then it will get authenticated. Remember, one thing that l depth we have installed held up on the same machine that we need authentication from. So this is usually not how the environment or the scenario works. Usually system administrators, they install the open L'd apps offer on another Lennox machine which becomes a directory server. And then you could go in and configure on your client where to look up for l dap services. You have to modify your etc host name and few other files. And again, as I said before, there are few configuration changes that you would have to make. And I will include um, an article that I have from online. One of the open elder has the article how to configure it. So if you really are interested in conferring open elder and your open held observer, you could review that article and then you will be able to configure it. So anyway, um, hopefully you have it. Ah, installed correctly. And now you understand the clear difference between all those directories, servers or services that are out there.
142. Tracing Network Traffic traceroute: trace around trace the network traffic. So in this lesson, we are actually going to learn and try to understand how we could troubleshoot the network issues if we are having any network issue in our environment and one of the commands that is mostly used to see where your traffic is going. Which Gateway? A rich DNS server. It's going from one to another to the third. And finally, how is it going to reach its destination? And to view that entire tracing off those network traffic, you have to use a command trace route, and this is a command. I believe it is also available in other operating systems as well. And Windows. I believe it's called Trace R T. I'm not sure exactly what is the command in Mac or other operating system, anyway. We are Focuses Lennox. So let's see what trace route does. The Trace Rock Command is used in Lenox to map the journey that a packet off information undertakes from its source to its destination. One Jews off trace route is to locate when data loss occurs throughout a network which would significant signify, ah, node, that's down. So as it say's if you just need to find the tracing from source to destination how the packet went through from one to another, because each hop and the record reflects a new server, a router between the originating PC and the intended target. Revealing the results of Trace Route scan also lets you identify slow points that made adversely, that made Worsley affection never traffic, so it could be many different PC's or many different machines or gate was in the middle while you're traffic is flowing that affect your your traffic flow. And that's how once you know Hey, I know this is the machine that is the troubled machine that is causing my network traffic to fail. You could find that out if by by running the command trace route. Now the command itself is just simple trace route and the destination host name or the I P address or the girl in this case. So if you are trying to go to a euro, let's say google dot com, hotmail dot com, facebook dot com or wherever you're going or if you are in your local environment. In your corporate world, you probably have an I P or a host name off your machine. Then you could run trace route space. The host name as long as your machine or you where you are running the trace route can resolve that host name, toe I p. If it cannot then make sure you put in the I P address. Okay, let's get into my lyrics machine and then we will try these trace route command on it and see how it works. So I will go into my consul and first thing I want to make sure I am online. So I could just to ping any website so you'll see I'm getting a response back. So I am online now. Let's run the command trace route. No, When you're on it, you have to specify the host name. If you are in your environment in a corporate environment and you are running, um, your infrastructure and you probably have a lot of service, you have to specify the host name if it could resolve it. Otherwise, the i p address. But for us, since you're using the lab and wiring will just to google dot com at Hit, enter and you will see the first hub. It is going to do is it's gonna jump on to our modem. This is my modem, which is also a gateway to my traffics. Of the first hop it is doing is going to my modem and this is the time it takes to go there . And it didn't cause any issue if there was any, um, hand time there, it will tell you this is going to take that much long time to go to the second hub. Second harbors going to another gate were right here, which is most likely my nad i p, which is the Internet I P address or the Internet I. P. The Gateway. I peep. And then it will tell you it did 12 all the way through the 14 hops to get to this I p address, which is the result i p address off google dot com. So this is how you could actually use the trace round utility to find out how your traffic clothes from your source to the destination. The reason it went to my gate emphases because that's how my gateway is defined. And to find out your gateway, you could run the command nets Dad minus R and we and you will see the gateway I have for all my traffic should flow from the gateway 19 to 1 61 That one. It might be different in your environment, depending which environment working on whether you are doing this lesson through you're work. Then you will have a different one. If you are doing from home than most likely, you will have the same i p address if your gateway. So this is about the trace route. Try to find it how you could troubleshoot many times. People also ask what are the different ways you could troubleshooting networking related issue in the opening system. So you could also bring up this trace route command and this is one of the ah main command that will help you. Trouble should never work related issues.
143. How to Open an Image File: How to open an image file. I know a lot of people, a lot of my students have asked me that UV could open a regular file, a text file using VI, cat, more head or any other ways to open, it's easy or even BI the file to open a text file. Now the question that came up was how we could open an image file using the command line. Well, first of all, if you are in a GUI environment, you could simply double-click on that image file and it will open up. But if you do not want to use the double-clicking thing, then you are, you want it to run a command to open up a file and image file. And there is a way to do that. So image file formats are standardized means of organizing and storing digital images. Image files are composed of digital data in one of these forms, as they can be. Rest arise for use on a computer display or presenter. And image file format may store data in uncompressed, compressed, or vector format. This definition is straight out of Wikipedia. I just want to quickly go over it. What we will learn in this lesson is how can we install a program that will allow us to open an image file and command syntax to open that image file and gooey. Alright, so let's go into our Linux machine. I have my Linux machine right here. Now, if you have an image you could undergo, you could just simply double-click and it will open up. But the question right here we have is VY to run a command to open up a mental image. But please do remember if you are getting into your Linux machine to SSH or through putty, and then you try this. It will not work because images gurus and stuff like that do not work on Linux terminals. So for us to try out how you go open it, we have to actually first get an image into our system. So I have my Firefox open. I went to Google.com and I actually clicked on Google. I type Linux. I went to images and it gave me all bunch of Linux related images. Let's pick any one that you like. I will pick this penguin, right-click on this image and click on save image as. This will ask you, where do you want to save this image? So peck desktop, because this is your desktop where you will be saving your image. So scroll down and click save. Now you could go back up. You could close this Firefox because our images downloaded, as you could see it is right here. And if you wanted to open up this image in GUI, all you do is you double-click and it will open up. Image inulin is perfect. Now, again, going back to my question is, now how can we open that using command? So which they are cryo-EM men, I'm home. I have solved. If I go to my desktop and do ls minus l, I do see the file is there, which is 1200 PTX, which the same name as this. If I do cat on it, then what happened? Oops, it doesn't know what it that file is or how to open it. Then would which other command that I can run to open that image? Well, for that you have to install a program called image. So what this document says is basically you have to become root. So let's go become root. And then you have to run the command yum install image magic. That's a package name actually. So let's clear the screen. And before we do the yum install, let's make sure we could get out to the internet. So to confirm that we could get out to the Internet, you could simply Peng www.google.com and we are getting the reply Bad, perfect. Now you could go ahead and do yum install image magic minus y. So it is looking for the package that we want, one of Download it is looking for dependencies. It asks that the package install packages one size is 9.1 meg. It went pretty fast because we have given the option to given the option of y, which is minus y for yes, to go ahead and install it. Now let's confirm if that image RPM has been installed. Rpm grip. So there you go. Image magic. This is the rpm. This is the program that allows you to open image file. Now you are young and now you have to run the command which is displaced space image of the file, the file name actually. Alright, so before we do that, let's get into our directory where that image is located. So that is in our home. I have solved directory. When you do ls minus l, You will see it has all the directories and files, but we had downloaded that image file in Desktop folder. Then do ls minus l, and you will see our file is there. Now you can run the command display, the file name, and hit Enter. And this will open up your image file. That's how it works. If you wanted to use this command to open up the image file. But anyway, I do want to let you know in corporate world, we do not have too much application or its use in a real-world. We don't really use this command or this package. But anyway, I listened to my students as always, and I have included this lesson. So this way, if someone wants to find out how to open an image file to the command line, They would know how to do that. All right, good luck.
144. SSH Keys Access Remote Server without Password: Hello, awesome people in this luxury a going to cover how we could access a remote server without a password using ssh key now remote server meaning if he have a Lennox machine and we want to access another Lennox machine that another linens machine is for us is a remote machine . Now, there are two reasons that we need to access a remote machine without a password. One is repetitive Loggins, meaning if you have a latex machine A and you log into the next machine BB like 10 times or 20 times a day, and you don't want to enter user name and password of gain, and again, then it you will generate Ssh key second reason, which is the more important reason is automation through a script. If you have scripts run that are sitting on on your server A. And you need to execute those scripts on server be so that is an automation that will run on B. But every time you run, run it from a to B able properties and even password. And of course, this is an everyday thing, and you don't want to have any type of interaction it, But it So that is why you create ssh key. So the automation will take place by itself without any human interaction. Now, keys are generated at figures of level, so you could generate keys like your own self for a regular juicer. In my case, you could be generated, as I have solved user. Or you could generate the keys at the root levels. If you want to log in from A to B through route, you can also generate the keys for route next time and you log in as root. It's not gonna prompt you for use anyone password. Now let me put it in a graphical way. So I said this way I could make you understand. What are we trying to achieve here? So let's say you have a server are our limits machine, and I'm gonna call it my first Lennox machine. And by the way, this is the actual host name I have on my Lennox machine. And this machine wants to access another Lennox machine and that host name off that another livings machine, Islamic Santo a seven have both of these legs machine set up and ready for me to do this testing for this lecture. Now, if you have only one Lennox machine at this time, then you can either skip this lecture or come back to it when you have another second machine. Ever recommend you that you should build another Lennox machine and name it? Let's say send learning center a seven or whatever that you want to call It says you could actually practice this lecture on the second Lennox machine anyway. No, the client, which is my licks first links machine wants to access the server than accent Oh, a seven and it access it through. Ssh, right. You open up a party, you go from one machine to another, or from if you're logged into the Lennox machine, you could run a command as a sage to log into a remote machine when you log in or when you executed to stage command to remote machine. Very more machines prompt you for two things user name and password, Right. So you provide those user name and password and then it will. It will let you in now. Now, the purpose of this lecture is what if he wanted to law again of it that are providing the using a passport. Now for that, What you need to do is you need to generate some keys on your client machine. Meaning that is your authentication that includes, like, your idea. Whatever you you generate those keys. That is a comeback, a combination off letters and keys and symbols. When you generate them, you copy those keys over to the server and you tell us ever Hey, this is my authentication. So go ahead and keep that that key that I've generated. Go ahead and keep it and you authorized key file. Then once that is copied over the next time the client tried to log in from my first Linux VM to Lennox Cento a seven over ssh. Then it will not prompt that that that user for user name and password. Now, that is how I could put it. And from machine to machine now, in a regular way in our everyday life to make it more simpler, I'll give you a scenario off a user or someone who wants to access a building or a house. That person goes into the house, and first thing they do is if they don't have keys or access to their house or that building the ring a bell or they meet the, um, the security guard. And then they give them the authentication and make sure it has verified and then you come in. Now, another way you could do is next time you want to come in, you give some type of keys like you already go through your background check. You already go through your verification process, and then you give those verification process to the security team or whoever homeowner off that building, you give it to them. Then next time and you come in, you don't have. You won't be prompted for use in the past where all you have to do maybe flash your badge or scan it. And you you you so to to go to come or to get this process work. We have a few steps that need to follow. The first step is under client machine of a decline machine is the one that trying to go to the server we have to generate the keys. And for that, the command will run is ssh dash kitchen. The second step is copy that key to the server and the command use uses exactly this command, which is Ssh stash copy. Dash I d space route because you generated the keys as root. So you specifies route at the I P. Address off the server. Where you copping it, too? Then log in from the client to serve now. Tried it. Now, you. Since you already copied over, I'll go ahead and try to log in to the server using the command like, ssh route at the I p address of the server or as a stage dash l route and I, p address of the server. Both commands of the same that they they actually let you went from one machine to another or the account route. All right, now, enough talking. Let's go and log into my linens machines and I will go ahead and try this process. Now I have my party terminal open. This first machine is my first Linux VM. And if you do host, name my first Lennox VM. And if you do, who am I? I'm logged in as root. Now, what is my I P address? I could do if config e and P zero s three is the interface where I have my I p address and you will see my i p address off. My client is 1 90 to 1 68 $1.95 Now I wanted to go to my server. This is my server. Its host name is Lennox Cento a seven and I am logged into that host as root and the I P address off the server is zero as three. I'll do the same thing and my i p i p address of the server is one I to 1 $61.58 now from the client. If I log into the servers using the command as a sage route at the I P address off the server and hit enter, you see, it's prompting me for the password. That's what we wanted to avoid. So I'll just control see and get out of it Now I'm back into my client machine, which is my first Lennox machine. Now go ahead and clear this green so this baby could start and run the command in the client. Ssh Dash Ke Jin Hit Enter, It is going to tell you generating public Private Arce, Keep here If you want to know more about our say ours is a mechanism off our authentication level. If you wanted to learn more about it, go ahead and search for it. Enter file in which to save the Keith. Now, by default, it is going to save the key in this directory. But this directory is on the client on this local machine. If you want to change this location, you could specify here, but I would recommend you. You leave it default and just simply hit. Enter. Next step is asking you to enter Pass phrase empty for no pass. Freeze. Now, if you're in the production environment in the corporate environment over commend you to put in the past for is anything that you like could be a password or anything. A combination of letters. Um, but we are doing this test in a lab environment, so I'm not going to pick any pass phrase so I'll just leave that empty and simply hit. Enter. It's prompting me again, saying enter same pass phrase again. So I didn't enter anything, so I'm not gonna enter it again. So simply hit. Enter again. Now it's saying your identification has been saved in route dot Ssh I d underscore r c. So if you can't this file, you're going to see the key as this is the key and your public, he has been saved in root out as a sage idea in to score are saved up pub, which is public. This is a key. Now what we need to do is we have already authenticated ourselves. We have generated the keys. Now we need to copy this key to our server. So this time. So next time and I log in to the server, the server would know and says, Oh, yeah, I know you. I have your key so you could come in without a password, so I have to copy that keys. To do that, I will do. Ssh Dash copy I D Route is there's root account that is on this server. It's not the root on this client to root at the server. I p one I to 1 68 $1.58. You could right click if you're using putty and it will copy it for you now hit. Enter Now it is going to actually ask you for the password because you're going in for the first time. And of course, once you add that key, it's gonna ask you that as just the last time. So go ahead, put in a password for that route account. And now it's saying that that the keys has been copied in are saying now try logging into the machine of it. 18 ssh route at $1.2161.58 58 remembers my server and check to make sure that only the key you wanted were added. By the way, that key is added to this server and it is added to root dot ss aged, authorized keys. You could actually go into that, um, that directory root dot as a sage do ls minus. L and you're gonna see authorized keys. When you do cat on that authorized keys you're going to see this is this entire key has been copied and it's copied as root from the machine. My first, the next PM, So it's already there. Now, if I come in from this machine to this machine, I'm not gonna have any problem, or it's not gonna promptly put using a password. Let's go ahead and clear the screen here and let's go ahead. Clear the screen here and now. Let's go ahead and log into my server. Ssh. Route at 1 90 to 1 68.1 dot 58. 58 is the I p off my server. Let's try again to confirm you see 58. Okay, Now let's go ahead and enter. Bingo. See, I am logged in. It didn't prompt me for any user name. It didn't prompt me for any password. And I'm logged in. And if you do host name, you're going to see I am in Lenox, sent to us seven, which is this machine. You could also do the other command exit out. Now you back into your client. My first links VM You could do the second command as a safe by the board commands performs the same function. 1 92 No. 1 $68. 58 and I'm logged in to the clinic center s Veum. So that's how the logging in tow a remote machine without password works. You have to generate the keys on the machine that is trying to log in. Give these keys to the server. Where you trying to log in to and then once thes keys are passed over, you could try Next time you log in, it's not gonna prompt you for any user name or password. And then you could run many, many different automated scripts and commands without the nuisance off going in and putting in this using a password. And I hope this elect yourselves this purpose. If you have any questions, let me now. Good luck.
145. Linux Web Based Administration (cockpit): All right, So this is the lecture, this is where we going to cover cockpit. A cockpit is a Server Administration Tools sponsored by Red Hat, focused on providing a modern-looking and user-friendly interface to manage and administer servers. Carpet is the easy to use, integrated, glanceable, and open web-based interface for your servers. The application is available in most of the Linux distribution, such as santos, Red Hat above 12, and Fedora. It is installed in Red Hat eight by default, and it is optional you available in version 7 if you wanted to go and install from the repository. It can monitor system resources, add or remove accounts, monitor system usage, shut down the system and perform quite a few of the task all through very accessible web connection. Now you're probably thinking, hey, don't use command line in Linux to perform or manage most of the function and it's a lot easier, yes, for those people who still prefer and would like to use the command line, definitely you should. But this web interface, if you tried one time, I'm telling you you definitely going to fall in love with this interface because you could access your server. If it has this web interface running, you could access it from anywhere remotely. And you could also get the terminal within that web interface. So I'll show you once we get into the cockpit application. Okay, so now we are going to cover how we could install, configure, and manage this cockpit application. So the very first thing we have to do is check for never connectivity because we have to go and download that package from the Red Hat or CentOS repository so we could start the service. So in order to connect to the Internet, we need to make sure our computers, our Linux machines have never connectivity. And for that very easy thing to do is just simply open up your terminal and your Linux servers and ping dub, dub, dub dot google.com, or you can pick any websites on the Internet of your choice. All right, for that, I have two machines, both running side-by-side. One is Red Hat seven, sorry, one is Red Hat, 81 is Santos seven. So let me log into eight, so we'll go through both one-by-one. Alright, so right here on this side, this is my Red Hat eight, and this is my CentOS 7. So let me move this on this side, okay, The first thing we have to do is check to see if we have connectivity. So Peng dub, dub, dub dot google.com. Beautiful. We are getting the response back when you see 65 bytes from dub, dub, dub dot google.com, it means my machine has internet connectivity. Okay, Next here on Red Hat eight, I'm gonna do the same thing, google.com. Okay, here I'm getting a response to. So both of my machines, both of my Linux servers are up and running. Sorry, not the Linux machine up and running, but they are able to connect to the internet. All right, next thing is install cockpit package as root. If you are not logged in as root, then you have to do sudo and then run the command like Yum slash DNF, install cockpit minus y. And that command is used for Red Hat or sent OS operating systems. If you're using a 12, you will have to use App, dash, get, install, cockpit. All right, so let's go back into our Linux servers. Okay, before you go in and do the installation or run the command of installing cockpit, let's check to see if he already have that package installed. So I have right here my Linux red Hat aid machine. I'm going to clear the screen and to check if I have the package install, I will run the command RPM, which stands for Red Hat Package Manager, is just a command which will tell you if a package has been installed on your system or not, then you would use the Option Q query all a, and then grep, pipe it and grep for compact. All right. It looks like I do have the package. All the necessary is dependent packages. Everything has been installed. Great. Now let me do the same thing for our santos Seven. Let's clear this screen. Rpm to HQA and graph for cockpit. Okay, I got the prompt back. I didn't get anything. So it means I do not have that package installed. So what I will do is I'll run the command yum, install. Cockpit and minus y, the option of giving is because if it's going to ask me any dependency, do we need to install the package because it dependent, I wanted to answer. Yes. Okay. It's going to the yum repository. It's checking any dependencies. It got into all the dependency as you saw up there, it started installing. Right away. It's downloaded and installing. And the reason it didn't ask me for the confirmation is because I had provided the minus y option or a beautiful everything has been installed, verified. Good. And I'm gonna go check RPM QA, and grep for cockpit to see if that package has been installed. Beautiful, it is installed. So now both of my servers have the composite package installed. Coming back to the PowerPoint slide. Next one is start and enable the service. So the packages there now we need to start its service, the associated service. And the service name is cockpit. You could use just a cockpit or cockpit dot service. So let's go back into both of our Linux machine. So before I start, I wanted to check the status if we have that service already started and running system CTL status. But okay, here you notice that I have the service loaded, but it is inactive, it's not running. Okay, so I have to start the service here. So system CTL, start, it has started. Now check the status PO4. See right here ran this command, just wanted to show you. And it says loaded and it's active, status is active and running. Let's do the same thing on seven system. Ctl status. Nope, it's not loaded and it's not running, so we have to start service. It is started as check the status. Beautiful right here sees loaded and it's active and running. Now we need to enable it. So this way when my computer or my Linux machine restarts, it starts the cockpit service with it. So I'm just going to hit up arrow key. And I'm just gonna do enable. Okay, for Red Hat eight, I have already enabled the service earlier. So next thing we have to do is check the status of the service. We have already checked IT system CTL status, cockpit to see if it's up and running. We did that. And the next thing is to access the web interface. To access it, you have to do https colon slash slash 192, 168, one dot x. This is the IP of your Linux machine, colon 900, 900. So this cockpit application, the web interface application runs on port 900. 900. So let's go into our machines and let's check the IP address by typing IF Config. And the interface that I have is E&P 0 S3. I could do that E and P 0 S3. And you will see the IP address right here. If you do not remember the interface E&P, S3, then you could just simply type IF config, sorry, IF config. And it will show all the interfaces, but you are looking for the one right here. So 10, 253, 159. For my Red Hat eight machine, let's clear the screen and let's use another command, IP address. Here, I have this E&P S3 and my IP address ten to 15, 18, so one is 118 and one is 59. So let's go into our let me close this. So I had that open. So let me go into HTTP colon slash slash 1053 dot one dot 18, colon 900, 900, hit Enter. One dot 18 is my Red Hat eight servers. So if I go back into my Red Hat Server, I hit 1051 dot 18 for my CentOS 7, I have 59. So I could come here, close this. And I'll type HTTP S for secure slash slash 1053 dot one, dot 59, colon 900, 900. Okay, you have to make sure that the firewall is disabled on your Linux machine as well for you to connect from your desktop machine to your Linux machine. You do not want to disable your firewall. You can simply go to application for Firefox, open up a web browser. And you could simply type HTTP colon slash slash local host or the, or the IP address of this machine, which is 10 dot 253 dot one dot 59 colon 9090, hit Enter and you're going to see will take you to that site. So it means this machine, if I'm not getting an access from my browser, that means a firewall is running. So what I could do is I could go into the Linux CentOS 7 and I could stop the firewall. So for that app to do system CTL, stop firewall D. Okay, it is stopped. Now let's go and refresh a hit. We got that potential security risk message, which means we are accessing through the secure website, port 443. That's where we're getting this error message. Click on advanced and click accept risk and continue. All right, beautiful. So now we have right here, this is our cent, a Red Hat eight, and this is our santos Seven. Alright, so let's go to Red Hat 8. First login as yourself. I absolved. You have a local user or you could just simply log in as root. Let's try the same thing here. You sure you remember the root password. Let's login on both sides. Okay, so here you'll see, you'll get a lot of different options, a lot of different tools. On the left-hand side, this is your host name of your Linux machine. And it's telling you running Red Hat Enterprise Linux 8 for last login, the health status, the security updates are available. So if I click on it, it will go fetch this updates and install them. And it will give me the health update or give me the health of my system, the usage, CPU usage, memory usage. If you wanted to see detail history, we'll click on that system information IPE, sorry, ID up time spent 16 minutes, my host name, system time, domain performance secure and all that information. You could find it here, right from this page. You could reboot the machine or shut down the machine as well. Now of course you have to log in as root to do or perform both of these functions. As a regular user, you cannot, you will not get these two options. All right, moving on to the next tab or next option on our navigation tree. Here we have logs. These are the logs that we have available if you wanted to see error and above, critical only emergency only, you can see all of that. You could modify if you want, if you just want NPO. And above, you'll see all these logs, information, storage. This will tell you your storage information and your device name is amounted to what's the size? This is exactly as if you're running df minus h command, you will get both the partition, see right here its eyes because he targets. And it tells you the total size of your desk, which is dev SDA. And it tells you is 20 gig. Store logs. You have more information about your storage right here. You'll also get more information about your reading and writing performance. Then we'll go to networking. And the networking side you will see it is showing you both of you interface E&P as 003 and virtual adapter. So you could create a bond if you have to interface, or a team, which is both are the same team is just a newer version. Or you could create a bridge or add a v land. This can all be done through this interface. Isn't it cool? Yes, I did find it very cool where you don't have to remember every command. But of course if you are command savvy, you could just go in and run the commands to create your never bonding are teaming. Then this is about the containers. Let's skip that for now, which we'll cover later on. We'll come to the accounts. If you wanted to create more accounts to your system just like that, click on Create new account right now, my Linux machine has only two accounts, which is root and I absorbed. If you have more accounts, it will show up right here. Next is the services. These are all the services we have running in our Linux machine. It could take some time while it's loading will go into our CentOS 7 and we'll see some of the information which is pretty much similar to Red Hat eight. So you could get logs here and you will get networking where you have the same option to add a bond at a team bridge, we land. Same thing with their counts. I had only two accounts on my CentOS 7. Services, this will load, this has loaded pretty fast. These are all the services that we have running, but you could manage which system CTL command C right here, all of them ends with dot service. You could actually, right here, click on it and stop, and stop the service right from your web interface. If you go back to Red Hat eight and you have right here, see it's a static enable, whichever that you wanted to manage the services you could do it right here. Awesome, Moving down to applications. Here we have a list of applications that we have installed or you can remove it. Diagnostic report, this is where if you are troubleshooting anything in your computer and you wanted to collect the logs or configuration files just like SOS report, then you will have to create or generate this report right here by clicking Create Report. And this could take anywhere from two minutes to 10 minutes depending on the size of your system. And once you have that report generated, then you could download and send it off to Red Hat support so they could take a look. Then we have kernel dump information, reserved memory, and where is it located? Selinux functionality can be pulled from right here. You could control your SELinux, how you can assign, you can enforce it or disable it, or provide permissive information. System software updates right here, whatever the updates this available to you, you could download and you could install, you can install all updates in one shot right here, just like as if you're running in Linux, yum install or yum update, sorry, yum update or jump upgrade. Then you have subscription. What is the subscription that you have? It says the subscription right here, Red Hat Enterprise for 86, 64. If I expanded, it will tell me more information when it starts versus status and when it ends. Now, another cool thing is, I know this is the terminal. Let's say if you are, if you're using your web interface, you could run the same command that you will run on your party or any of the console terminal. Isn't it? Cool? This is also one of the coolest feature of this web interface. Moving back to CentOS 7, pretty much all, everything is the same. A few of the options are not there for seven that are available in eight. Then if you wanted to access the terminal, same way you would come here and access the terminal. Alright, so spend some time on this web interface. This is the newest feature that's been added in a newer version of Red Hat eight. But the good thing is that you could also install that on Version 7 if you wanted to use it on CentOS or Red Hat, seven versions.
146. Manage network security (Firewalld): Hello and welcome to the lecture introduction to firewall. When you need to secure your system, firewalls should be the number one things to be discussed as well. So let's start with what exactly the firewall is. A firewall as what it reads. It's it's actually like a wall that prevents the spread fire. So anything that you put it up there, it's now going to let the fire and that's actually the firewall. That's how they got their name. When data moves in and out of a server, it's packet information is tested against the firewall rules. And their firewall rules is actually something that reside on the firewall. So when that is tested against the firewall rules to see if it should be allowed or not? In my words, the way I wanted to describe it is that a firewall is like a Watchmen or a bouncer, or a shield that has a set of rules given. Based on the rules they decide who can enter and who could leave. There are two types of firewalls in IT. The first one is this software firewall, which is actually the firewall there runs on an operating system. So you have a firewall that runs on Linux and you probably have a firewall that runs on Windows or any operating system. It has a little software that is called firewall. Another type of firewall is a hardware firewall. Now that firewall is, is actually a dedicated appliance like a hardware applies with of course, the firewall software running on it. Now that type of appliance more often found on the network side, the network team or the one who actually maintains that type of firewall. But anyway, our focus is what? Our focus is the software side of the firewall, which actually runs on operating system. All right, so let me put in a picture so it will be easier to understand. So we have a server a, simple it wants to go to server B. Now when it goes to serve or be, it sends some kind of protocol or a connection request. And in this case, let's say the server a wants to connect to server B with through SSH port 22. But when there is a firewall in the middle, it will check its rule. And it'll say, Hey, let me check the rule. If server a is allowed to come in on port 22, and that rule says, yes, this server can come in. Then several B says, okay, I have made that clear and connection is established. And the example would be another server wants to go to server B and they want to connect to server B to FTP. And FTP, as we all know, runs on port 21. Now before it goes to establish a connection to server B, it goes to the firewall. And firewall rule says on server be that a server a is not allowed to come in and using protocol or service FTP. Then what happened is over b says, Sorry did I can't let you come in because my a firewall rule says that you are not allowed to enter into my operating system through FTP service. Now you may see this firewall sitting in the middle and you're probably thinking we're exactly sitting. But in reality, this firewall is sitting on server a, as well as there's another firewall is also sitting on server B. So both servers a and B do have firewalls as well. Server a who wants to connect to server B could also have a rule whether this service is even allowed to leave the server a or not. And then when it goes to server B, the server v has his own firewall which will say, Hey, even though it came in. But let me see if this service is allowed to be accepted to serve to my server. So that's how the firewall works. Hello again and welcome to the lecture of firewall and more specifically, IP tables. There are two tools to manage firewall in most of the Linux distributions. One is the IP tables, and that is mostly used in all the Linux distributions. And the other one is firewall D, which has been introduced not long ago to the newer versions of Red Hat, CentOS or Fedora and maybe some other Linux distribution as well. But as I said again, still mostly, most of the Most of the tool, the firewall tool is IP tables, is used in all of the Linux distributions. Now you can run one or the other. So you cannot run both tools at the same time. So in this lecture, we will work with IP tables to manage the firewall. It doesn't mean that I will not cover firewall D, I will cover firewall the in the later lectures. Before working with IP tables, make sure firewall D is not running and it is disabled it. To stop the service, you have to do system CTL stuff, firewall D, or service command if you're using the older version of Red Hat or, or, or Linux, CentOS. But of course, if you're using the older version, the most likely you, you don't have 50, 50 in it. Anyway. To disable it, you run system CTL disabled firewall D. And to mask it, you run system CTL mass firewall D. You will need Mac. So other programs cannot run that or you don't start that service by accident. That's why you mask a service. Now check if you have IV table service package installed. Nice. Because before you start the service, what if it says, Hey, would service you tried to install, so you need to make sure you have the service installed and to check if that service has that package installed to you. Do RPM dash key, QA and grep for IP tables, their services. And if it's not there, you will use the yum utility to install IP table Services. Once you have it installed, you'll start that service, but start IP tables command. And then you enable it to check IP table rules. You'll do IP tables Dash L. And to flush the IP tables, you do IP tables dash F, meaning if you wanted to start from clean from scratch, you don't want a predefined rules in the IP table. You do IP tables dash F to flush it. Now, let me go into my Linux machine right here and we'll try all the things that we have code right here. So first thing first is we need to start IP tables, but do we really have IP tables? First check our PM QA. Ip tables, Dash services. No, we don't. But of course before we install it or downloaded, let me stop the firewall D. So to check if I will, d is running because our focus is the only IP tables you do status. Firewall D. Yes, you see it is active and it is running. Let me go ahead and stop that service first. Before I even work on IP tables. It is stop. Now go ahead and disable it, so it won't start at reboot. Okay, now go ahead and mask it so you don't start it by accident. Now go ahead and check the status. And you will see right, hey loaded mask and current status inactive and instead beautiful. Okay, we're following our instructions along. And now we are. Next step is to install the IP tables. Remember we checked it is not installed, so the command is yum, install IP tables, Dash services. Now make sure if you want to install it on your machine, can go out on the Internet and go to the repos that needs or that has the IP table service package. It found it and it tells you the size. Now go ahead and hit Yes, I'm sure you're familiar with the yum utility. And now you could go ahead and install it again. Once it is installed, you will see a complete message, installed message it is there. Now go ahead and start the service system, CTL. Start IP tables. It started now go ahead and enable it. It is enabled now go ahead and check the status. It is up without any error messages. Yes, you see it? It says active status with the process ID. Awesome. Now, the next step is that you wanted to check what's inside of the IP tables that come out of the box, which is IP tables Dash uppercase L. And by default it has few rules already in place to allow SSH except and also ICMP to the host level is prohibited. And some of the rules in there, we want to start from scratch. So I want you to flush everything out by typing IP tables dash F, it is flushed less, verify everything is gone. And then you run it. You can see actually these three different chains. One chains is input. This is chained forward. And the third chain says output. Now what is it chain or what is this whole thing? And what is each column means? Don't worry, I am going to cover that next. The function of IP table tool is packet filtering. The packet filtering mechanism is organized into three different kind of structure. And those structure is table which I just showed you. It has chains and it has targets. Now what are those? Let's get into the details. Tables. Table is something that allows you to process packets in specific ways. There are four different types of tables. Filter, mangle, NADH and rho. Now I have bolded the filter and then the line, that one because our primary focus here is filter and that's the one that is mostly used in the Linux operating system. So each table has chains attached to it. These chains allow you to inspect traffic at various points. There are three main change using IP tables. One is input. That is a rule associated to it that says income for incoming traffic forward going to a router and then from one device to another, which is rarely used again. And the third one, output it is outgoing traffic. So focus on these two input and output, meaning incoming traffic and outgoing traffic. Now, all non these three chains that you see has rules associated with it changed, allow you to filter traffic by adding rules to them. And the rule example is, if a traffic is coming from this IP, then go ahead and define the target. Now, okay, I have a table, I have a chain, and these three chains are there and chain have a rules defined. Now what happens when the rule is met? That I did find that IP address coming in. Now what do you want me to do with that IP address? Then you come in and define the target. And there are three different types of targets. One is except of course, to accept the connection if the rule matches. Second is reject, meaning don't accept it, but do send a response that hey, I'm rejecting it, I'm not accepting your your request. Maybe some of the responses, some meaningful information. But anyway, the third one is dropped, which is meaning like a harsh drop. I don't want to tell you why I am not accepting it. Just you are not allowed at all. These three are the simple targets. So again, to recap, IP tables has tables, it has chains. Each chain has input forward in an output. And then based on those rules defined into those chains, they are targets and those three targets or accept, reject and drop. If you still having a problem understanding it, let me draw it out for you. The table looks like this, but of course it's not exactly look like this, but I'm just, I just put it in a graphical way. This is a table. The table has what chains and those three chains are and put forward an output. And all these chains have rules associated with it. Meaning if the IP address is this, are poor, is this, and so on. Then what do you wanna do? Then I want you to accept it. No, drop it. No, it rejected whatever the target is. You will define at the target level. Now, you will run IP tables Dash L to actually see the table and to run that and you see the table which is like this. As I have seen, showed you a few minutes ago. As you see this, there are three chains yet you could see chain input, chain forward and chain output. This whole thing is called a chain. Now, each chain has input, forward an output, then it has a target. We all know up until now I'm sure you are. You have explored in this, you know, all these strings. Now let's go into little more detail which is under Rule level. This field that you see here, it means protocol such as TCP, UDP, ICMP, or all. Anytime a protocol that you want to define, it will be defined right under it. Then optional, this is rarely used. This column indicates IP options. Source, meaning which IP is it coming from, and then destination, where is it going to? So when you see a rule right underneath of this, you could easily translated, this is the meaning of this rule, meaning this protocol coming from this source and going to this destination and the target is dropping. And that is for incoming chain or incoming traffic because it is associated with chain input. So anyway, guys, this is all about this whole lecture I covered is explained you how you could download, install the IP tables, how you can run it, and what does IP table dash put looks like. So you need to understand before you even do the administration on the IP tables, which we will cover in the next lecture to do certain practice, to run certain commands, to say tune. Okay, so now it's time to work on Firewalls. Specifically the tool. The firewall D works the same way as IP table, but of course it has its own commands and command that it starts with is firewall dash CMD. Make sure the command firewall, the first part of the first word does not have d in it. So it's just firewall, dash, CMD. It has a few predefined service rules that are very easy to turn on and off. And those services such as NFS, NDP, HTTPD, they are already there in an XML format. All you have to do is add those services into the firewall di table and the rules. We'll cover that in a later lecture of course. Then I'll show you how exactly the XML file works. Then the firewall D also has the following table, chains, rules and targets. Set table chain rules to Argus. You guys already know table is the one that has all the information about chain rules and target chains, or the ones that has outgoing, incoming, or forward traffic information. And the rules are associated to those chains. Like if incoming traffic is matches or does match this rule, then what to do then comes the target. That target would be either drop, reject, or accept the traffic. So again, as I said, it works similarly as IP tables. And if you need to refresh all these different table change rules and target information, you could go back to IP tables to find more information about them. Okay, so you can run one or the other, meaning either IP tables or firewall deep. It is not recommended it to run them both at the same time. Make sure IP tables is Stop, disabled and mask before you start firewall D. And of course to stop it, you will use system CTL, stop IP tables, then a system CTL to disable it so it won't start at boot and to mask it so you won't started accidentally or any other programs ONE started. Then after they stop. Now you need to check whether firewall service that you're trying to start has the package or required package installed in your system. But as I said, if you're using CentOS 7, redhead, fedora seven and above, by default, it would have firewalls installed. By the way, I just checked. In the third line, you see a file wall d, it's just a mistake eyes instead of l, I should have our anyway, it's just the honest mistake. Then to check if the package and install you run RPM dashed QA and grapher firewall D. If you don't find it, then you will run jump command to install firewalls. And once it is installed, you will start the firewall D by using the command system CTL start. And then firewall D. The next command would be system CTL enable firewall. You cannot run all that in one command. I just put it in one to save some space. Then to check the rule of firewall D, what's inside and what is defined. You will run firewall dash, CMD, dash, dash, dash all. It will tell you what services are unable, where rules are in place, what type of chains in place? Getting the list of all the services for our Baldi's aware of. That's the services I talked to you about in the previous slide, that there are services predefined by firewall D, and they are written in XML format and you could simply add those services and remove it in one single command. And to get the listing of all the services you run the firewall D command. So if I will dash command, get services to make firewall D reload the configuration at it. Meaning if you add a rule in firewall D, you will always have to run the command firewall dash, AMD, dash, dash, reload. So your firewall process would know about the new rule or new information that you added into the table. All right, so now we're gonna go into the Linux machine and we will try all of that. So first thing first is first make sure the IP table is not running. System CTL status, IP tables, and you see it is running, it is active right now. So you will have to stop it up, hit up arrow key, and replace status with stop. It, it stopped. Now, disable it. So it does not start at boot time. And then mascot, so you don't or any of the program started by mistake. You could check the status again and you'll see right now it is masked and it is inactive. Perfect. Now it's time to check if we have firewall D package installed. So RPM dashed QA and a graph for firewall d. Okay, so it does have this as a package. We are concerned about. Make sure this package is there and if there are more firewall D, the system file system level, you could also install that, but most likely it will get installed with it if you just type yum install firewall D. Okay, so now it is installed. Now the next step is to start the firewall system, CTL. Start firewall t. It says the unit is mask, which means it is not allowed to start by mistake or by any other program. So we have to unmask it. So unmask. It is unmask. Now you could go ahead and start it. It is started. Perfect. Now go ahead and enable it. So it starts at boot time. Okay, now go ahead and check the status. Now. It is running. It is the current status is active. Nice. Clear the screen. And now I am going to check what's inside of my firewall rules. What comes out of the box. And for that, I will do dash, dash list. And you will see this is the table, it's a public table, it's active and it has this service is by default, SSH, DHCP, V6 client. These two services are already enabled, that's firewall. The services every time I start up and by default, SSH is allowed to come in. And if you see, you could define ports here. Any specific rules that you have, you could, you could put them in their rituals, which we'll cover in the later lecture. So if you add something, you could run the command by a wall dash CMD, followed by the correct syntax to add a service report to get the listing of all the services that firewall D is aware of, you will type firewall, CMD, get services. Okay, So these are the list of services I've talked to you guys earlier. These are the predefined services and all of them are separated by a space and they are written in alphabetical order. So a, B, C. And if you are looking for, let's say SSH, you'll see an SS, an S section C SSH is here. Smtp services here. If you're looking for FTP, you go into F Section. F is, this is f and you see FTP. So all these services are actually predefined in. There. Doesn't mean that it is already part of the firewall rules that it will allow all these services by default be enabled. It's not that it's it's telling firewall The Hey, you have the service, all you have to do run a command. Tell me this is the service you want to enable, and I'll go to its configuration file. I'll find our port it runs on and I'll enable it for you. So I'll cover that XML file in the later lectures. So for now, just make sure you start your firewall D, it's up and running. And it has the services listed as right here, the predefined two of the services. Let's get into some practical examples. On firewall D. The firewall, these had multiple zones. To get a list of all zones, you have to run the command firewall dash, CMD, dash, dash gets zone. So let's go into their Linux machine and we'll run it here. And we'll see how many zones and the listing of zones if you could get so tight, firewall, CMD dash, dash zones. And you will see it will give you the list of zones, block DMC, drop, external home and internal public trusted work. You could use any zone that is required by your company or your, or your policies. Most of the time that I've seen is the public, is the zone that is used most of the time. So our focus on this lecture will remain on public. So that's how you get the listing of zones to get a list of active zone. Now to see we have all those zones and which one is the active 14 that will run the command firewall, cmd and get active zones. This is listing that the zone that is active and that is active in terms of in firewall, we're firewall is getting all its rules. Configuration is public, and the interface that is attached to the zone is our default interface. You might have a different one if you're using a different type of Linux, has a physical or virtual. The next one we'll talk about is how to get firewall rules for public zone. So now we know that we are, the public is a zone that is active. Now how to get a list of that zone? You can run a command, firewall, CMD dash, dash zone equal public dash S list zone. But if you notice when you ran the command, get active zones, it only gave us the public zone. So when you only have one zone active, then you really don't have to specify the zone name. But just to practice, if let's suppose you had multiple zone, then you will have to specify it's only good public. So let's see. In that case we'll do firewall, CMD dashed as zone equal, public and list all. This is the zone which has by default out of the box if you are running your firewall D for the first time, this is what you're going to see. And you'll see, the main thing that you're going to see is this zone is public and is active. And the services that is default service that you get is SSH, DHCP, V6, and client. These are the services that are enabled by default. Again, what I meant was if you public zone is already active and it's the only one that you don't have to specify. You could just simply run the command without specifying the Zona get the same result. Now, you could also, as I said, you could do without zone as well. So also says are predefined by a firewall, as explained previously, you have a list of all those services. Now the question is, I do have the list of all the services I could go in and enable and disable it and turn it on. But what if I want to add a third party service? And SKA will take an example. Let's say if you want, if you install SAP application in your Linux server and you wanted to allow that application to be on and off. Then you have to go into user lib, firewall services. And all those services that are predefined are in that directory. And all you have to do is simply copy any data XML file and change this service and its port number. Now when you open that file, that XML file, this is how it's going to look like. By the way, this is a smaller version. There are many files, XML files in that directory that have a longer description. So the shorter descriptions a test I'm showing you is when you cat that file, any other file in that directory that ends with dot xml. You'll see it's version though in the first and the second, you'll see that service entire information about the service. And you'll see that the service, what type of services that you'll see is SSH and what description that you wanted to put it, what exactly this service will do. And of course, the port information and the service name which is in this one is TCP. And the port number is 22. This is how it looks like. But in the next slide we are going to make a customized service, which I just mentioned, SAP dot xml. And I will show you how you could make it firewall D aware. So let's go into the next slide and let's see if you wanted to add a service, let's say http in your firewall. For that you have to run the command firewall dash, AMD, dash, dash, add dash, service equal HTTP. So right now when you run this command, you will see there is no HTTP service and services. So if you have Firefox and you could open it up and you could try to access your HTTP service. You will see that it will not be accessible. But of course, in order to check that first you need to make sure your HTTPD services running. So let's see system CTL status, HTTP D. Okay, it says this mask is inactive, so we have to activate it in order to test our firewall rules when we add them in. So we will do is first I will unmask it. Then I will start the service. Services started. Let's check the status. It is active. Now, I will go ahead and open my browser to make sure I could access my Apache server using HTTP protocol service. So my, okay, so now my IP address of my machine, the Linux that I'm using is one, IT 161, 162. So when I reload, you will see it is saying problem loading page and it is spinning. It means it will connection will say as timed out as you see, it's taking too long. This is the message you will get. So in order to, in order to get to your server through that HTTP service, you have to enable it. So let's go to our firewall D and let's add that. So let's clear the screen. Firewall type CMD, dash, dash, add what service you want to add. Http. Okay, that's services added. And when you do list again, you will see and the service section. There's this last survey that's been added. Now let's go ahead and verify it by going into our Firefox machine and then refresh the screen. And you got the splash page as ATP, meaning we could get into our splash page and it works perfectly fine. Good. Now one more thing is if you I want to remove that. You could simply hit up arrow key or go back to the same command and type remove, and it will remove it. You could check the status, whether it's gone or not, by looking at your list all and you'll see it is gone now. So that's what to remove the service is about. Then to reload the firewall configuration. Meaning let's say if you added some service and now you just want to clear the entire firewall D configuration, whatever that you added. And for that you have to type firewall D reloaded. So before I do that, I'll show you first when we added that HTTP service is added. Now, if you do list, you will see it is there. But now when you go in and reload, reload and check that firewall, you will see that HTTP service that we edit, it's gone. So it's kinda like a way of firewall D to flush whatever the temporary rules are in there. So if you want to add any rule permanently, you have to specify permanent and the end. To add or remove a service permanently. You will run the command firewall, dash, AMD dash, dash, dash Service HTTP equal permanent. And that will add it permanently to that zone, which is the public zone. Of course, to remove it for permanently will run the same command with Domo and dash, dash permanent option. Now let's talk about the third party application we talked about in the last slide. What if there are services that you wanted to add? It's not is it didn't come predefined or as a default service in firewall D. So what we have to do first thing is you have to go into this directory. Users have been firewall D services. You could just simply copy any data XML file, and make the name of the new service file and change the service and port number inside of that file. Then you have to restart the firewall D, and then simply add firewall. And then simply get the get the listing of those services to confirm to verify that services there. And if it's there, it's working, then you can run the firewall D command to add that service. So we'll go and we'll go through that exercise now. And, uh, let's see. And as I said, we'll use, as an example, we'll use a service, SAP. And SAP, I believe runs on port 32. So I'll go into user lib, firewall D services. And by the way, if you're doing that for the first time, I recommend you do. Take a snapshot of your virtual machine in case things go wrong. Okay, Now, in the services and there are a bunch of services, if you run ls minus l, you'll see all those services that you get when you run the command or command, you run firewall, dash, CMD, dash, dash, get services. All these services that you see are actually firewall these, pulling them from these files. Now, again, we want to add as SAP going to go ahead and take any file. So in this case I'm going to do copy SSH XML file and I'm going to copy it to SAP XML file. Okay, verified, it's there. I'm going to do ls minus l TR. It's there all the way to the end. Now, I will go ahead and modify that fall BI SAP dot xml. And you see it has that version service. The short description is SSH and I'll remove it to SAP. Okay, now this is a description. I will remove everything that is listed for SSH service description, and I will put the third party description, whatever this service will do. This is a third party application service. Okay, good. Now the protocol is TCP or whatever that you wanted to specify. And you could use the port 32. So of course you need to know these things, but it's a TCP UDP port number. It is what service? Now, you could go ahead and save that file. File Save, you could verify SAP dot xml. And you see it is there with all the settings that you have specified. Now if you want to see that SAP in your listing, meaning when you run this command and you wanted to see it there, then you will have to restart the firewall D, the system CTL restart firewall. D. It is restarted. Now when you're going to run that gets services, you should be able to see your SAP service. So let me, what I will do is I will firewall dash AMD get services. I'll just simply do grep. Sap. And there you go. So see it's highlighted for us, it's easier for us to know where exactly it ended. So now this SAP service is in there. Nice. Now we could go ahead and add it as a service to the firewall configuration. So to add it simply firewall, CMD. Add dash, service, equal the name of the service. You will add it. And when you do list, you will see it added that SAP service. Now if you trying to add any other services that is not and that dot XML file, it will just simply fail is not going to work. So for example, if I'm trying to add service call m1, it says invalid service and run. It went into that the user labor firewall, the services directory. It looked for the M1 dot xml file and it didn't if it doesn't exist, That's why it's not able to add that. So it's a good feature of firewall D This way you could just simply have to add or remove services that are defined in that directory. All right, so moving on. By the way, let me remove this service. So this way I have everything cleaned up or I could just simply do what? Reload if I have not added it permanently. Success, let's verify it is a stair. It's gone. Good. Moving on now. Now what if you want to add a port to your firewall D configuration? Simply you run the command, which is firewall. Dash, CMD, dash, dash, add, dash port equal. I pick this one, 1, 0, 1, 1, 1, 0 as a random port. You could pick whichever port that you wanted to open and the protocol hit Enter, verify that. And you will see it is going to show up. And the ports, TCP 10, it's added. Now again, if you do not specify dash, dash permanent, then it will go away. That moment you do firewall, CMD dash, dash reload. Okay, so that's how you add a port. And of course to remove a port, you would do remove port. So let's go ahead and remove port. At port, I will do remove port 0 dash. It is gone. Let's verify it. And it's no longer there. Beautiful. Okay. Now to reject incoming traffic from an IP address. So again, it is, is kind of a scenario where you have someone coming in to your machine with an IP address and you don't like that person or you don't like them machine, whatever the reason you just want to block any traffic coming in from that IP address. So you will run this as a rule. It's a long loop rule, but it is added in the rich rule space all the way at the bottom. So let's go into our rule. You see when you run firewalls, AMD dash, dash all you see rituals all the way at the bottom. This is where you have to add this rule. So I'm going to do is I'm gonna make this smaller so I could grab this up and read the whole command. I'll just make this bigger as well so I could be able to type everything in one line. So firewall dash, CMD, dash, dash, add you adding a rich rule. And that rule says equal, what is the rule about family within IPV4? And which IP address are you trying to block? There's a source and the address of that source equal coat, 192, 168 dot 0 dot 25. And then what you want to do, remember the Target thing that we talked about, UI to reject and close. It has been successful. Let's verify it is there. And you will see this rule is added as a rich rule all the way at the bottom, which will reject all incoming traffic if the matches this IP address. Now to block and unblock ICMP traffic. What if you do not want people to pengyou? So you could run simply this command. So let me go back in and let me go ahead and remove that ritual that I added. So instead of just add, I will do remove or I could have just do firewall, dash AMD reload anyway, it's gone. Let's verify it. Yep, it's gone. Now, I wanted to block all incoming traffic firewall. Cmd, I mean, all incoming pink traffic, not all traffic. Add dash ICMP. As you know, the pain comes on the protocol ICMP, dash, block and inversion. That is edit. Let's verify. And you will see ICMP block inversion is set to yes. Now, if I go into my, any other machine, let's say I go into my Windows machine and I have a DOS prompt open and I try to ping my Linux machine where I have enabled this rule, went to 161, 162. This is the IP of my machine. And you'll see it says host unreachable. Now, if I go ahead and remove that rule, meaning instead of add, I'll just to remove. And now if I try to ping it, I should be able to ping. That's how you block or unblock. And ICMP traffic. Now is to move now to block outgoing traffic to a specific website sash IP address. As an example, I'm going to use that example again. What if you want to block all the traffic that's go, that goes outside to Facebook. You just don't want your kids or whoever you are you're dealing with. You just don't want the person to go outside to Facebook page or any page for that matter. But for that you have to find out what is the IP address of that page and define that you have to run the command host dash T a, then the URL to find that IP address. I have already found that IP address and the IP address 311370 and 36. And to block that outgoing traffic, this is the command you will run. So let's run that command. So I have this Linux machine right here. And again to find the name of the host. So I define the IP address of www.facebook.com. You'll see that's the IP address is already there. Confirm now I need to block that firewall. But before I blocked there, let me pink that IP address just for now, just make sure that I could go out. Yes, I could go out. I could get a response. Now I'm going to go ahead and block that direct. Add a rule IPv4 filter. The output. Remember the output is that outgoing traffic is to disable to going to the source 3311371 and 36 is the IP what he wanted to do. You want to just do the target which is dropped. It is successful. Now you could go ahead and ping that IP address and you'll see it would tell you the operation is not permitted because you're not allowed to go outside. Now, if I go ahead and reload my entire for firewall D. And now if I ping it, I still cannot ping. Let me see if I have what's inside my list rule. It is still there. It's not there, but I cannot pink that I guess I have to restart my service here. So that would be system CTL restart, firewall. D, restarted. Let's try ping it. And now I'm able to ping it. Maybe it wasn't cached, we have to just restart the entire firewalling, but that's okay. So now this is how you could block outgoing and incoming traffic. And these are a few commands that we have covered. And this is pretty much very close to what the commands we ran in IP tables. Hopefully the entire firewall D lecture, that was, I split it into actually served its purpose and you are able to understand how firewall D works.
147. Tune System Performance: Hey boys and girls and welcome to tune system performance video. Linux system comes fine tune by default when you install it for the first time. However, there are a few tweaks that can be done based on system performance and application requirements. In this lesson, we will learn how to optimize system performance by selecting a tuning profile managed by tune the demon and prioritize or deprioritize specific processes with nice and recognized commands. What is Tuesday til Monday pronounced as T-I-O-N. And D at the end. Tune is for system tuning, and D is for demon. And as if you remember, demon is something that continuously run in the background of your system. It is system disservice that is used to tune Linux system performance. It is installed in CentOS, Red Hat version 7 and 8. By default, tuned the package name is tune D, as its name sounds. The 2D Service comes with predefined profiles and settings. The list of profile we will be discussing in the next page, based on selected profile that is given to you by tune disservice, it automatically adjusts system to get the best performance. For example, TRND will adjust networking if you are downloading a large file like an ISO file or something like that, or it will adjust IO setting if it detects high storage read and write. So tune DD MM and apply system setting when the service starts or upon selection of a new tuning profile. So what are those profiles that are given to us by default when you install or when you have cuny service or daemon running. It gives you some of the predefined profile out of the box for you. The first one is balanced D, which deals for systems that require a compromise between power saving and performance. Desktop profile drive from the balanced profile provides faster response for interactive application throughput performance to use a system for maximum throughput, latency profile performance networking, network throughput power, say oracle, which are called Database or application related virtual guest. If you run in your machine as a virtual machine, virtual host tune the system for maximum performance for their acts as a host for virtual machines. So these are all the tune profiles they are. There could be adding more depending on the application. For example, let's say if you are running SAP application on your system or any of the application, you could actually get the profile from the vendor and add that to your tune, the system to manage it. Okay, so moving on. How do we check if tune the package has been installed? The command is simple, is RPM minus key ways to query all which will give you the list of all the packages, then you could just simply put T1 d. So let's go right into our system. I have my system open right here, and my terminal window is already open. I had two terminal windows open. If you don't, you can open another one because we will be testing some other commands and check it from the other terminal. Anyway. Let's start with the first window terminal. And we will check if we have package installed, which is rpm dash QA, and grab for Tuesday. Okay, So we got the result back and here is the package and it's version of the package, and it's right now, it's telling me that is Enterprise Linux 8, that's the name of the package or operating system is installed on. Okay. So moving, going further down, install tune package, if not installed already, so we already installed. If it didn't have it, we would have used this command yum install 2ND or for newer version that DNF install TMD. Then check tune the service status if that's services running, the command is system CTL. You'll check the status, enable it started or stopped at the tune d. So let's check the status of our cuny system, CTL status, D&D, and write heres is loaded and active. Running. Beautiful. Okay, moving on. And to enable the tune the service to enable it at boot time, which we already have. So command to change setting for tune the demon that is tuned D ADM, that's the command that is used to set the profile based on your system requirement. So to check which profile is active right now, that tune D is using. The command for that is tuned D dash EDM, space active. So let's run that command and we will do tune. Let me clear the screen, then our run 2D that ADM active. And right now it's telling me current active profile that's been active is virtual guest. So my machine right here where I'm running the Linux machine, it is running as a virtual machine. So by default, it has selected this profile and it will, the system or the operating system will find here on or changes the setting based on the profile it has selected. Then we have to list all available profiles that we have, the profiles that we listed in the last slide. We'll see most of those profiles listed and we run this command. So let's go back in and run clear the screen again. So this way we'll have a clear command visible. So tuned D dash ADM list. Okay, see right here you see all these profiles that we talked about in the last slide, balance desktop and there are few more Intel latency performance are the same one, network latency network throughput. I want you to read every one of them and understand what is the purpose of each profile and whether you should select a which profile based on the system requirement. If you really want some of the network performance and you are downloading ISO or big image file, then you probably want to go with network throughput optimized for streaming network throughput, generally only necessary on older CPU or 40 plus kick network. So read through it, understand each one of them. But this will give you by default all the tuning settings that you want to enable, instead of you going into the configuration file and making your own changes. Okay, Then moving on to the next slide to change to decide profile. So if I wanted to switch to a different profile or you have to do is T1 dash ADM profile space, the profile name. So let's do that. These are the profiles that I have available. So I provided to change it, for example, to desktop or balanced for example, I would do T-I-O-N ADM profile balanced. It'll take a second and it came back. Now if you run the command tune dash ADM active, and you will see the profile that has been selected is balanced instead of what we had, we had virtual machines selected before right here, sorry, virtual guest, that that's what it was selected. Next one we have check for Cun De recommendation. So sometimes you change certain things, but then when you run this command, it will tell you what profile you should select them based on the system that you are running. Okay, let's go to our system. Clear the screen. 2nd ADM recommend. I recommend me the profile that I should be using and it's telling you you should be using virtual guest. Yes, it detects that I'm using a virtual machine. So it should that we should select virtual guest profile. Okay, turn off, tune the setting demon. If you don't want the system to select any profile, you wanted to do things manually, you could turn that off. So you do Tuesday and simply off. Now if you wanted to check which profile has been selected, you will do 2D ADM again, same thing to active and will tell you, you know, current active profile. Then we have change profile through web console. So we could also change the profile through the GUI, the web console that we could get access from the cockpit package, which allows us to get access to web console. So how do you have to login? You could just simply go to http colon slash slash the IP address of your machine and the port 900, 900. And then you'll go there and select overview, configuration, and performance profile. So let's quickly check. I have my Firefox open and I have already entered the IP address of my machine, which is 10, 253, 118, port 900, 900. And it will prompt me to the login page. I entered my username password and it brought me to this main dashboard. So if you wanted to check the IP address of your machines so you could enter it to your browser. You can just simply do IF config E&P 0 S3. I know the interfaces using is E&P as three, so you'll run it and you'll see it's ten to 531 dot 18. When you enter that IP in your browser and you're not getting access to this page, then most likely your firewall is. Enabled up and running. So to check the firewall if it's enabled and running, you do system CTL status firewall D. Okay, by looking at this, you could see it's loaded and it's inactive. If it was active, then most likely I would not have access to this page, then you actually have to go into the firewall and allow that port 990 to get access through the web browser page. So the easiest way if you are doing everything on non-production or your lab environment, then I will suggest then simply go ahead and do a system CTL, stop firewall and you will be able to access your web page or web portal management. Okay, anyway, coming back to the web portal, right here you go to overview. In the overview grid configuration. And in the configuration you will see right here it says performance profile virtual guest. Click on this one and select a which profile you wanted to select. So let's say if you want to select a balanced and click Change Profile, and it will change it to balanced profile. You don't have to reboot the machine. You don't have to make any changes whatsoever. And it will be applied right away. Okay, the next thing is another way. Okay, So pretty much going back. This is all about system tuning through, tune, a D demon or the service. All these profiles are available to you or you have to do is select the desired application or desired profile based on your application and enable that profile. All right, moving on to nice and recognize and other way of keeping your system fine tune is by prioritizing process too nice and recognized command. If a server has one CPU, then it can execute one computation or process at a time as they come in pairs like first compass. So while other processes must wait or they have to wait, That's how one CPU would take the execution of a process one at a time. So of course, it does run other processes one by one and a round robin way. But what if you wanted to prioritize that the process, that comment because one process could be more valuable or more important than the other. So with nice and recognized command, we could make that system to give preference to certain processes than others. This priority can be set at 40 different levels as yes, there are many different levels on that priority. The nice level value range from minus 20, which is the highest priority, to 19, which is the lowest priority. So the minus the negative sign gives you the highest priority. And by default, processes inherent there nice level from their parent, which is usually 0. Okay? To check process priority, you can run command top that will give you which priority of each process is running. So when you are going to run top, you're going to see two columns in the top. So let me go into the Linux machine and I will run the command. So let me clear the screen and I'll run top. Now here in the top command you're going to notice that first column paid, which is the process ID, the user who's running that command. The PR and the n i. So the PR is the system priority level. Then the NI is the actual user setting, the nice level that you actually set. So what are the difference between this one and that one? What is the difference? So let's go to our diagram right here. And you'll see in the nice level we have higher priority minus 20, lower priority 19, but system has its own priority that actually aligns it to the user nice level. And that goes from RT minus 99 all the way to 39. So nice value is a userspace and priority uses space. And priority PR is the processes actual priority that is used by Linux kernel. And Linux system priorities are 0 to 139, in which 0 to 99 for real time processes, and 100 to 139 are for the users. So hopefully you understand that for the nice level you only have from minus 22, 19, whereas the system has its own priority alignment from 0 to 139. Okay, process priority can be viewed through ps command as well with the right options if supplied. So what are those options? Here are the options ps space AX 0 paid a comma c o m, m comma nice, comma c ls dash S short equal minus nice. So let's go and run that command. Clear the screen. Psa 0 comma, comma, comma nice, CLS, dash, dash. And what is to that short equal, nice. And you will see all the processes that are running in your system with priority level assigned to them. As you move up, you're going to see starting from 19 to phi 1, 0, 0, all the way to minus 20. Okay? Then get into the real commands. If you want to set the priority of a process, to set the priority of a process of a desired process. If you have one process running, for example, Oracle process, and you want that Oracle process to get the highest priority, then you have to run the command nice with minus n, the number of the actual number of the priority and the process name. So for example, nice minus n, minus 15 and top, top is actually a process itself. So let's run that. And now Linux machine. And here we will use two windows. That's why I had two windows opened. Let's clear the screen. So I want you to run just top right now and hit Enter. And you're going to see the top command itself is being displayed in the priorities as system priority to 0 and nice level to a system, system prior to 20 and nice level to 0. Now what if you wanted to change it to minus 15 priority? So just quit out of it. But by hitting just Q key, go back here. And I want you to go to the other window. I want you to type nice minus n fifth minus 15 because minus 15 is the highest priority and then run top. Okay, it is running that top command. And you're going to see right here, this is our top command. The system assigned process priority is five. And the user assigned nice priority level is minus 15. Now, what if you wanted to change that? You don't want to stop the process, but you wanted to change its priority. So to change priority, you have to use the command recognize. Same way with minus n priority number and process name. For example, reenergized minus N 12. And in this case you cannot use a process name. You have to use the process ID of that process that's been running. Okay, so let's go to our machine again. And here. If, if I'm coming here to the nice command right here, sorry, to the top command. It has five and minus 15. The only way we could change that if you could find out this process ID and it's process ID is 9360. Beautiful. Okay, so let's clear the screen here and do recognize minus n. And instead of minus 15, we wanted to change it to 12 for example. So what was the process ID? I forgot. Okay, 9360, sorry, 9360. Hit Enter. And right away you're going to see 9600 process ID, old priority, mine it was minus 15. Now the new priority is 12. Let's verify it. They go. So the user assigned nice number is 12, system assigned, priority is 32. So that's how you change the priority of a process. And that's how you make your Linux system do the fine tuning and get the best system performance out of your box.
148. Run Containers: Hey beautiful people and welcome to the lecture where we are going to discuss everything about containers, running containers in a Linux environment. So first thing first, what is a container? The term container and the concept behind it came from the shipping container. Yes. If you'll look at this picture right away. This is a physical container which holds all the different type of cargo shipment. And it actually can transport it to everywhere in the world. So these containers are shipped from city to city and country to country. No matter which part of the world you go to, you will find these exact same container with the exact same size or measurement. You know why they are built with the exact same measurement? Because around the world all the docking ports, ships, trucks, warehouses, are all of them built to easily transport and store them. So they don't have to buy different trucks, they don't have to buy different lifts that will lift them up to store them. So everywhere you go in the world, It's exact same size. And that's what makes the transportation a lot easier. So that's visualize it. So you take that container and you put it in a truck. And then that truck goes to the docking station, put that onto the ship. Then what happened is the ship has to be transported from one end of the world to another end. And then on the other side of the world, it actually picks, lifts that container and actually put it on the truck, which can hold the similar same measurements size of that container and it has shifts over. All right. So that's what it was about in a very basic or layman's term, how the container came from. Now let's look at the container in IT world. Now when we're talking about containers in IT BY or fulfilling somewhat similar purpose in all day. So there was a developer. She would write a code in her laptop. And while she's writing a code, the whole purpose of writing the code is to create an application. So once the code is written, the application is built. She tested it on, on her laptop, then she copies that same code or that same software to a production server. And the production server, we will open up that package or install the package. Then we will try to run it, and somehow it won't run. Then what will happen is the developer will come back or the program will come back and says, Hey, Iran's on my computer perfectly, but it doesn't run on the production. That's why the main reason this, these containers were bone. So then came the container's technology which allowed IT developers or programmers to test and build applications on any computer. Just by putting it in a container. The container is built in within the software, the software code, libraries and configuration files, and then run on any computer regardless of its architecture, it doesn't have to come are shipped with the operating system. So you can move that application within that container anywhere without moving its operating system. Which is just like moving the actual physical container which will discussed anywhere that will fit on any dock, yard, truck, ship, or a warehouse. So an operating system can run a single or multiple containers at the same time. To summarize, again, I'm sure this, these two slides have made it a lot clear what a container is. It is just the combination of your source software code libraries and configuration file and no operating system. You could move that container anywhere, one machine to another and it will run flawlessly. Okay, here is a note that you need to understand. Container technology is mostly used by developers or programmers who write codes to build applications. Now, Zhou, as a system administrator, your job is to install, configure, and manage them. Your job is not to write a code and package it together and create an application out of it. All right, moving on. What are the container software? So let's talk about what are the software that are available that actually manages these containers. And the very first one end the line is the Docker. I am sure you have heard of Docker many times. And again, this Docker concept came from this same way as a container. The container where you actually land. These containers are the Docker yard. So they got the name Docker from this same dock yard. So Docker was developed by solomon hikes in the March 20th, two thousand their teeth. Docker is the software used to create and manage containers just like any other package, docker can be installed on your Linux system and its service, or demon can be controlled through native Linux service management tool. By the way, Docker is not only specific to Linux, there are other versions of Docker that can be installed on Windows to, to provide the same container technology. All right, Then comes in POD man, which is the focal point for us and for this entire lecture or the rest of this lecture, part man was developed by Red Hat and it was released, the first release was sometime in August 2018. The Pac-Man was developed as an alternative to Docker. Now why they made it and why didn't it unlike the Docker? I cannot answer that. Anyway. For those who are using Red Hat Linux, you should know that Docker is not supported in Red Hat Enterprise Linux 8. So you will have to go to with PODD man. Okay? It is a demon less open source Linux native tool designed to develop, manage, and run containers. Of course, just like Docker. But it is red hats own developed software to actually run containers. There are many other containers, applications, engines and softwares are out there, but I'm only covering Docker and pod man. Wanted to learn more. What are the other software? Feel free to search it online. All right, moving on. Getting familiar with the Red Hat Container technology. Now we're getting into the actual red hat. Now we are moving away from Docker, so now we are focusing on Pod man. So what are the Red Hat Container technology? Red Hat provides a set of command line tools that can operate without a Container Engine. These include pod man for directly managing pods and containers. Images, for example, running, stopping starting PS, which is checking the status attaching the containers, et cetera. You use this utility called pod man. Then you have another one called buildup for building pushing and signing container images. And you have scope you for copying, inspecting to leading and signing images. Run C for providing Container run and build features to pod men and build up. And the last one is C run an optional runtime that can be configured and give greater flexibility, control, and security for rootless containers. Containers are the containers where you do not have to be rude in order to create or run these containers. Anyway. From this point on, our focus is only going to be under pod man, which will be used to basically create and manage the containers. All right, now, next thing is getting familiar with PODD man container technologies. So when you hear about containers, then you should know the following terms as well. The first one is the images. Containers can be created through images or from images, and containers can be converted to images as well. Just like for those who understand the term template in virtualization environment, you could create a virtual machine from template, or you could actually convert a virtual machine into a template. The images works as same as those templates. Then the next one, pods. Pods are the group of containers deployed together on the host or on a hot spring system. In pod men logo, there are three seals grouped together, has a pod, you see this logo, That's the logo. And these three seals that represents the group of containers running at the same time. Alright, now let's get into building a running and managing containers. Let's get our hands dirty and run or create containers. All right, The very first thing we have to do is to install pod man against. Man is a command line tool that allows you to create or manage your containers. The first command you have to do is jump or DNF to install a package. So you will have to do DNF install pod man and minus y option to, to say yes to all the questions that will be asked during installation. You are doing a Docker installed. You could do the same way. Yum install Docker with minus y option and that is only put Dockers. So I am, what I am going to do is I'm going to start up my computer, which runs, of course a Linux machine. I have Red Hat aid and I also have Sant R7. So we will run both of them at the same time. And some of the commands I'll cover in Red Hat eight and some of them, our cover incentives seven. All right, so the Mr. me go to my Oracle VirtualBox. This is where this is where my virtual machines are running. This one, my first Linux VM is my Red Hat eight, and this is seven, which is running CentOS 7. So very first thing I want you to do before you even powered on or startup, I want you to take a snapshot. So right here it is already on the snapshot menu. And click take, and you can name it before containers. So in case you wanted to revert back, something goes wrong while you're downloading, you can always revert back. Click OK. Same thing with seven. Click snapshot. Take the four containers. Okay, perfect. Now let's go ahead and start both of these machines. This is eight and this is when I'm covering both a N7. So those who are practicing Linux or Linux containers on seven, they would be able to understand how these commands are similar and can be, can be run on both operating system versions. Okay, so I have my Red Hat right here, and I have my sent to us seven right here. So I'm going to leave them right next to each other side-by-side. First, we will run the install command on Red Hat eight. And I will use the command DNF, install pod man with minus y option. So it could answer yes to all the questions during the installation. Similarly, I will run the same command except I've replaced DNF at these yum install, pod man minus y. Okay, So depending on how slow or fast your computer is, it could take anywhere from a minute to five minutes. Right? On RedHat aid, the download and installation of odd man has been completed. On CentOS 7 is almost they're running transaction check updating, and it should be done in any minute. Anyway. While we're waiting for that, let's go ahead and run the next command, which is to create alias to Docker. Now this command is only for those who have a Docker running on the Linux machine. Now they wanted to use POD man. So you could simply create an alias for your Docker to pod man. So which will still run all the commands a Docker, but it will run through pod men. So we will leave that as is because we never had Docker running before. The next command is check pod man version. So the pod man that we have installed, let's check this version. We're running. We go command pod man minus 3. The version is Version 3 does 0 dot t2. Let's check the other machine is still updating, let it run. The next thing is getting help. So if you need any help regarding pod man, what options were commands to use? You could use either part man, dash, dash help, or simply go to the manual pages of PODD man. So if you, let's clear the screen. If you type pod man, dash, dash help, and hit Enter, you will get all these different options. And if you scroll up, you will see all these optional commands that are available. With the command pod man, you could attach, attach, build, commit containing a copy, create, the export. All these commands or options that are available with your pod man command. You can also check all the options that have available to you by running the command man, pod man, it's just a regular man page. Hit Enter. And here you will see, it will give you all the documentation about pod men, simple management tool for pods, containers and images. As you scroll down by hitting the space bar key, you will find all the different options that is available under pod man. Let's go check on a CentOS machine. That's where the installation has been completed. Beautiful. Now we will run the same command here, pod man minus v to check the version. This one gives us a different version because it is running on a different operating system version. That's fine. Same way pod man at dash, dash help, give you all the help that you need. You can also do man, pot man. And you will get the manual page, just like as we do unsaid or sorry on eight. Then moving down to new other commands, check pod man environment and is registry repository information. So when you run Pac-Man info, so if you are trying to load a container image, then it will look at the local machine, then go through each registry by the order listed. Now what are those listed registry, let's take a look. Let's do pod man info. And here, you could just scroll up a little. And you, right here where you see registries search. If you wanted to search for a specific image, it will go to its local machine to see if it has any images that you're looking for. If you can't find it, then it will go to registry dot access to our red hat.com. Then it will jump to registry tot red hat dot io. And then last it will go to Docker Hub wherever it could find the image that you're looking for. So here, the same way, let's clear the screen, pod man and poke. And same information will be given to you right here. It just treat three different locations where you could get your images. All right, then the next command to search a specific image in repository. So let's say you build a machine, you already have a pot man, the tools that you need. Now it's time for you to run a container. But before you run a container, you don't have to go in and build a container. They are pre-built containers out there. And those are packed together in something called an image. So we have to look for the container image. So in this example we will look for HTTPD image. So let's come down, clear the screen. And do pod man, hey pod man, search for a sorry, not containers, sir. Search for an image called HTTPD. And again, it will go to all those repositories, registries that we looked at when we ran pod man in PO. And it will pull the information. So right here, pull all the information about images there where you could find the HTTPD. Now let's go up. And right here when we run the command, here is the title of this table. The first one tells you this the index. This is the name description. These are the stars. The stars the actual user had given to this image is that of facial. Is it automated? All information is there. So as you come down, you'll see there are 0 stars. Probably never know nobody has used it. We will go down and look for the stars that has the highest stars. So for example, right here, this is Docker, I owe. The image that you're looking for is can be found in docker dot io slash library slash HTTPD. And it has 36 16 stars. So right now at this time while I'm recording this video, it is showing 36, 16. Maybe by the time when you run this command, you will have a different number. Anyway. So we know that this one is definitely a lot of people have checked it out. They have downloaded this image, so we will use this same image or same location to download the image. All right, for that what you had to do. So let's go to the next screen and here to list any previously downloaded Pac-Man, Pac-Man images. So before we pulled this image down, We, let's check if I already have any images running on my system. I'm sure there isn't because I never had pod man before. So just to show you the command to check is pod man images. And it is telling you the title of the image, tag the image, but there isn't any information underneath it means there aren't any images available. Similarly in Santa seven, pod man images and nothing will be found. Perfect. Now moving on. Now, we already verified we don't have any images. So then what's the next step? Next step is to download the available image and that available image can be downloaded, will look for HTTP. And we know that image is available on this registry. So to download that, you have to use the command pod man with the poll since we are pulling it down. Let's clear the screen and do pod man. Pull from where from Docker dot slash library. By the way, this URL that I'm putting it down or this registry information putting down I got this information when I ran the pod men info. With the stars, remember 36, 16, That's exactly what it is. Slash HTTPD. Hit Enter. It will go to the registry and pull the available image that's already sitting here on this URL and it pull it down. Same way here. Clean the screen. Pod man, pull docker, dot io slash library slash HTTPD. And it's going to pull it down. Okay, By the way, up until this point, you guys have seen and confirmed a few times that all the commands that I'm running on eight are pretty much working the same way On seven. So what I'm gonna do from this point on, I'm just simply going to minimize seven. And all the commands that I'm going to run up to this point will, I will be running on eight. So it doesn't matter. If you have only seven, you could just follow along. All right. So the pod men pull docker image has been downloaded. How do we confirm it has been downloaded? You can run the same command, pod man images. And right now this is telling you, hey, I got this image. This is the image ID and the repository came down. This is the repository is tagged as layers. It was created 51 minutes ago. Wow, someone has modified and then the size of this is a 142 megabyte. Beautiful. All right, so we already checked the images. Images have been downloaded. Next command to list pod men running containers. So we have the image and now we need to run the container. But of course before we run it, let's check if he had any existing containers running. Of course we don't, but we still wanted to check because I want you to learn the command how to check the existing running containers. And for that you have to run Pac-Man PS. Again, just like Padma and images, we have the title line up here, but we do not have any other information, but the container is telling me the container ID image command create a status pores EMS, but there is an actual container, so we have confirmed nothing is running. Now, what's the next thing? Now we have to run the container. To run a downloaded http container which we just downloaded. This is the command we have to run. It's clear the screen. Pod man run. And by the way, let me just quickly go back and tell you more about these options. D for detach, meaning I want my terminal back, T for terminal TTY shell, my prompt shell. And p minus Option P is for the port that I'm specifying for this http container. And then of course we will run pod man ps to check if that container is running. Our pod man Rhonda minus d t minus p for port 800, 800 colon eight, put TCP, sorry, 80 for TCP. And then where is the Registry? Docker, dot slash library slash HTTP D. Now how do we check if we have our container successfully running? Good question for that, you have to do pod man ps. And here it is, your container ID. The image where it actually downloaded the image from the command create a 19 seconds ago, that's when I ran this command status up 18 seconds ago. And this is the port of the IP, which is a local host. This is the port that we specified for HTTP, the TCP, and this is loving worlds and whoever actually named this image to whatever they wanted to give. So you could give it any name as well. If you want, you could give, when you create a container out of image, you could give it any name you like, which we'll cover in a second. All right, beautiful. So we have confirmed that the container is running. There is another way you could confirm whether the container is running by going to your Firefox. And type localhost colon 8080. Localhost is the IP address of my machine. I could have used 000, 000, 000, That's fine. And the port 8080, remember the port 8080 be specified for this HTTP. Hit Enter. And right here, I got the page essays. It works brilliant. So if you are here and you follow me here exactly up to this point, it means you got your container, your very first container running. So congratulations. All right, let's close this. We have confirmed that it is. Up and running. So let's close this down. Now. Next thing what we need to learn is to view POD man logs. Anything that we wanted to learn. Its pot man is not running the container successfully. You could definitely check the logs, Pac-Man logs, and it's L, and it will tell you all the information that you need as to when it started, how it's working, and all the information that you need to troubleshoot further, let's clear the screen. Let's go to the next slide to learn more about building, running and managing containers. Now, to stop a running container, you could just simply do pod man stop and container name or container ID. So how do we know what is the container name or ID for that? You could just simply run pod man ps, which gives you the status of your container. And the container ID is right here, which is the very, very first column. If you want to stop this container, all you have to do is pod man, stop. And this container ID, you can just right-click copy, Come back here, right-click and paste and hit Enter. And it should stop by giving you your prompt back. How do you confirm it actually has stopped? If you have answered pod man ps, then you are absolutely right. There you go. You just ran it and now you don't see any container running. Awesome. Okay, Moving on, we check the pod man PS, okay, now to run multiple containers for HTTP D by changing the port number. What if you wanted to run two containers are the same image. You can run the same command, but you have to specify a different port. So just like that, I'm picking 8081 and in the second one I'm putting picking 8082. So let's clear the screen. I'm going to bring back my previous command by hitting the up arrow key, which will bring me the command that I ran to start or to run the container. So I'm going to do 80, 81, enter. This has started and I'm going to do 80, 82. So now this is going to start to containers out of that one image error. And how do we check? If I have two containers running pod man, ps? And here you have one container right here. And this is the second container right here. This is on port 8081, and this is on port 8080 two. Now, if you go back to your Firefox and specify localhost 8080 one and another on another tab you specify ideally two, you will get similar result. All right, we check the Pac-Man status now to stop and start a previously running container, you could just simply do a stop which we already covered. You could stop it and you could stop it as well. So just took over this piece, we could just simply stop one container. So because stop 80, 82. So POD man, stop. And the container ID copy and paste Enter. It should stop. How can you confirm pod man ps and only one container is running at this time now. All right, moving on to create a new container from the downloaded image. Okay, so pay close attention. When we downloaded the image earlier, we actually ran that container straight out of the box. Now what if you wanted to download, make certain changes to that image way that you want it to look or function, or maybe instead of it works, you wanted to put your name M1 apps or something like that. Then you have to change its code and then create another new image out of that. Okay, So for that, what you have to do, let's clear the screen. What you have to do is you have to type pod man, create dash, dash name. Now, what name do you want to give it to? Here? I have given HTTPD. You could give your name as well just for fun of it. But anyway, to be consistent, we'll use HTTPD. It doesn't have to be HTTPD. It could be anything. Now where is the registry? A registry is docker dot io slash library slash HTTP D. All right, it has created the container. Now, how do you check the container? We do pod man ps, so it is running only one container, which is recursing less code, not HTTPD. So that means it actually creates the image out of that pot man container and create the container now. How do I start that container that I just created out that image, this one. For that you simply have to do pod man, Start. And the container name of which is HTTPD. There you go. It has started beautiful now you should have two containers running. One container is the container you gotta running right out of that package, that sorry, that image. And this is the second container that you're running that you created yourself. Beautiful. Now, to start the newly created a container you could do start HTTP. We are one step ahead. We already did that. Beautiful. Now what is next? Now next step is what if you want to manage your containers, meaning when your computer boots up, what if you want your computer to boot up that http container with the system? So of course, as you know that to boot or to control any boot processes that is managed by a process called system D. So we have to notify system D process, hey, there is this new process that you have to run every time this system boots up. So for the very first thing we have to do is to first, you have to generate a unit file. A unifier can be generated, the pod man, why do we need a unit file? Because if you come down, there is this directory called Etsy system deed system, you have to put that file which call Uniprot into this directory in order for system D to know, hey, there is this new service, it has to start. So let's clear the screen. Let's go to at SI system D system. And when I do ls minus LTR or less my eye cell, whatever you wanna do, you see all these targets, all these services have been defined in this directory to be started during boot time. So I had to create this service file which is called unit, and I have to copy that into this directory. Very simple for that. What do you have to do is we have to run the command pod man because pod man will generate the uniform for us. Generate system d, dash, dash, dash, dash, dash, dash name, and what name do you want to give? This will be the name that you have given to your container. If you had given in the previous command when we created the container from the image using the command pod man create. And we given the name, you have to use that same exact name. Hit Enter. And right here is telling you the container at SI system, the system container D, It's stare it's already been copied over, which I did previously. If you do not get this message, you most likely you will get the message that it is in slash route slash root directory IM, and you do ls minus l TR. It will tell you, Hey, it is in this directory. Anyway, if it's, if you don't get it, then it means it's already in there. So let's go at SI system d slash system, do LS minus LTR. And right here at the bottom you see it has created the unit for our HTTP container. Beautiful, beautiful. Okay, then what do we have to do now enable the service? Because we want this service to store a boot, so we have to enable it. So system CTL enable container HTTPD service. It has, it has, it is creating this symbolic link. Perfect. What's the next step? Now if you remember, you have to start the service. To start the service, you have to do system CTL, start the container unit file, hit Enter. If you don't get an error, it means your service has been started. Now how do you check the status of that service? You could just simply do status. And you will see right here, it is active and it is up and running. Excellent. So we learned so much in this container video. You should know what a container is now how do you build it and run it and manage it? And Linux environment. Good luck.
149. Kickstart (Automate Linux Installation): Hello. In this video, we are going to learn kickstart. Kickstart is an automated way of installing Linux
operating system. So Kickstarter is a
method to automate the Linux installation
without the need for any intervention
from the user. With the help of kick-start, you can automate questions that are asked during
the installation. And those questions are like
language and time zone, how the disk drives
should be partitioned, which packages should be
installed or removed. And if you go back to the
insulin installation wizard, you remember while going
through the installation, the very first
screen that comes up is the vault come
to santos Linux. Here you select the language and the region of the language. Then on the next screen, you go through the
localization like a witch keyboard
language support and time that you have to select
based on where you are, the software that you
will be installing, the source media and
then the system, the installation
destination, the k dM network host name,
security policy. All that information has
to be provided while you are going through the
operating system installation. Now to eliminate all that where you have to answer
every single question. That's when the kick-start comes to kick-start per winds you. An automated way of answering these questions based on
your predefined parameters. Now, the purpose, you're
probably thinking, Okay, so that's good. We have defined
the parameters of kickstart during
the installation or it saved me a
couple of minutes. That's not really
too much saving. Well, let's suppose if you
have a computer or a server, of course, you need to install
an operating system on it. And our case, we are talking about Linux
operating system. What do you do if you attach the ISO image or insert
the desk and you go to the installation and at the end of the
insulation that you completed your rebooted and your operating system is ready. Beautiful. Now what
if you have to do the same procedure for
maybe another ten servers, or 20 or 30. Or in some cases in bigger
corporate companies, there are thousands
of thousands servers where you have to install operating systems on almost monthly or quarterly
basis, then what do you do? Do you really have
to go through each one of the computer and attach the ISO image file
and go through the installation one-by-one. No. That's when the
kick-start comes. This will allow you to have those predefined
questionnaire answered in a configuration file, attached the ISO image
to all these servers, and let the installation
around on its own. Everything is
completely automated. All right, to use
the kick-start, here are a few things that
you need to keep in mind. Very first thing is
you need to choose a kick-start server and create
or edit a kick-start file. Now what is a file
that is something we will go and drill down more in detail as to how the kick-start file or
config file works. But for now you need to understand that you
got at dedicate one computer or one server which holds or has
that kickstart file. Then make the kick-start file available on the
network location. Make the installation
source available. Make boot media
available for client, which will be used to
begin the installation. And the last start to
kick-start in solution. Now, if you still haven't gotten a complete picture of how a kick-start
server should set up. Let's visualize it. Here we have a
computer or a server. We actually are dedicating this computer or a server
as a kick-start server. Very small server with the Linux operating
system running on it. And we will create
a kick-start file. And we have dedicated beautiful. We are here up to this point. On the second step. Make the kick-start file
available on the network. Once we create that kickstart
configuration file, which has answers to all the questions that are being asked during
the installation. That file has to be
available on the network. And that network could be
either on the NFS share, FTP server, HTTP or HTTPS. Okay, so in our example, we will go through HTTP. You could go with
any of these network shared doesn't really
matter as long as you are sharing that
configuration file with other clients who needs to have the operating
system installed, can have access to
the network share. All right, so as
up to number two, this is where we create
the kick-start server and we create a kickstarts file and make it available
on the network. Now, number three is make the installation
source available. The source is the
ISO image file, which has all the packages, which has all the
operating system. That is actually
saved on somewhere. A source, that source has to be available either on
the kick-start server or you could attach that
to your client right here. This is the number of war. You could combine step
three and step four as one, or you could separate
them by making the installation
source available only on the kick-start server. And the client can read
from the kick-start server. Or you could directly
attach that ISO image to the client where you want to have the operating
system installed. Up to this point. If you have everything is
ready, beautiful. Now, the next step is to start the kick-start
installation. It's just that easy. All right, moving on a few
things we need to clarify. Centos or Red Hat seven. The kickstart program
can be downloaded, which allows you to define
parameters through the GUI, meaning that program, once you install it on your computer, you could use a JVM installed system dash
config, dash kick-start. This is a program which
allows you to bring up a GUI. And you could define all the different
parameters that are needed to answer the questions. If you're not familiar with the format of the
kick-start file, lot easier and you
could define it there. Or you could use the installation
kickstart file which was created during the
first installation. Yes. What that means
is every time you install the Linux
operating system, more specifically Fedora,
Santa's or Red Hat. It creates a file on your
computer in slash route. And the filename is
Anaconda, KS dot CFG. And it has all the answers
to your question that you have typed in during
the installation. So it's already there for you. All you have to do is take that same config file and
make that available on the network for a second
or third or fourth server to have the installation
exactly the same. In CentOS eight
or Red Hat eight. This program, that system
conflict kickstart program, which starts up the GUI
that is not available. You could simply use the
anaconda dot KSR CFG file, which is created while
you're going through the first installation and you can modify it based
on your preference. Why changed? Why did
they not include that System Config
kickstart program in eight, now they had it in seven. Well, the reason is that most of the systems
nowadays are virtual. You could, in virtualization, you could create templates
that can be used to have mass installation of
operating systems on thousands of
virtual machines. Or you could use automation
software such as Ansible to do the same type of insulation on
multiple servers. But I will still say
kickstart is still used in many of the
corporate world because it's a lot easier
to use and it's a good tool to have for our
physical system installation. All right, Now let's get our hands dirty and
we'll go through step-by-step procedure for
kickstart configuration, setup and do the
actual installation. Very first thing we have
to do is to identify the server that will be used
as a kick-start server. For that, what I did
is I have already picked my server
and I have picked, for example, Santa's seven. It doesn't really matter. You could pick santos
Eight or Red Hat eight instructions is exactly the
same, except the eight. You cannot install the program that allows you to edit the
config file through a GUI. All right, so this
is our server. Now the next step is take
a snapshot of the server. Very good idea every time we need to make any
changes to the server, it's always good to
take a snapshot. So for that, I have to go to my Oracle VirtualBox
snapshot manager. This is my VM that
I'm gonna be using. And if I go right here
on these three dots and snapshots and click on take. I would say anything that would let me identify the state. So that would be
before Kickstart. Because at this
point on I am going to work or installed
kickstart. Click Okay. There you go. It is done. Literally takes a few seconds. And it has taken this snapshot. If you go wrong or if
you make a mistake, then you could always. Restore it back to
its original state, which is right now
what state it is in. Alright, so that is done. Let's minimize this moving on. Install kickstart configurator, and that is again for
only virgin seven. And to do that, we could go back to our machine
and simply do yum install system, config, dash, kickstart. It is asking us to confirm
click Yes, Hit Enter. The installation of System Config kickstart
program is completed. You go verify by running
the command RPM QA, and grep for kickstart. You will see right here, this is our kickstart file. Now, if you do the
same thing or if you try to install
the same program in our version eight, Santos. Version eight, RedHat. Let's see what happens. This is the terminal. We do jump or DNF install system dash,
config, dash, kickstart. Right here, you'll see
no match for argument. This unable to find
a match is because this configuration file program is not available on eight. Alright, so we just
confirmed that going on, start the kick-start
file configurator and define parameters or
user root Anaconda, the HGS dot CFG. Let's go back to our
Linux seven and to start, all you have to do is run
System, Config, kick-start. This is going to open up a GUI that lets you
define the parameters, whatever that you wanted
to make changes too. So if you notice right here it says kickstart configurator. You could define any of the parameters that are any of these questions that are asked to you during
the installation, basic configuration
installation method, how you wanted to install
CD-ROM, NFS, FTP, http. Hardly see these are all
the things that I have covered that you should have the configuration
file to kick-start configuration file on
to this network share, bootloader Partition
Information Network and all those information. If you wanted to change
it during distillation, you could come here and do it. Now as a set, of course, this system can kick-start configurator is
no longer in use. And the best way to
do it is that you simply use the file
that is created for you when you did the
first time installation. And that is, let's
clear the screen. So let's go to route
and do ls minus l TR. And you will see there is this file anaconda
dot dash, KSS, CFG. If you do more on this. And this one tells
you exactly all the parameters that you picked when the first time
you installed this, see this operating system. It created. It picked my
host name that I defined. I pick the language
that I defined. I wanted to use graphical
interface system with GUI. I want to use a CD ROM where the source of the ISO images there, I define the password, it took the root password, encrypted it, put
it into this file. And it has all the information predefined formation
into the file. So it's best to take
this configurator file. All right, As I said,
start the kick-start File, configure it, which we did. And this is for those who
want to use that and define the parameters or use their
route Anaconda, KS, CFG file. Now for those, for
those of you who are thinking, what
does Anaconda? Anaconda is the
name of the wizard, the installation wizard that are given to you when you go
through the Linux installation. That installation visit
is called an Honda. By the way, once that is done, that's what it creates a
file with the same name, dash KS for kickstart dot
CFG port configuration. Now to start the
configurator system dash, config dash, kick-start. We
already went through it. Perfect. We will use the
Anaconda installation kickstart file and change
the host name only. It means when we create a new server with
this kickstart file, we don't want to have the
same host name, right? That's why we need to change this my first Linux OS to
change it to different ones. So for that what we
will do is we VI slash, route slash anaconda
dot CFG files. Excellent. Let's go down. And right here I will, what I will do is I will
put simply kickstart Linux. Is that simple? Save it. Perfect. Next thing is make sure
HTTP package installed. If not, then install the package
and start HTTPD service. Let's go to our server and let's see if you have HTTP
package installed. Rpm does QA and
grew up where HTTP? Nope, it's not installed. If it's not installed.
And what do we do? We yum install HTTPD. Yum install HTTPD while it's
going in and installing it. Let's come back to our
Red Hat or sent us eight. And you will see in
this server we do have the same file slash
route ls minus l TR. And right here is
your Anaconda file. This is the one that is created automatically
for you when you were installing the Linux
on this horse will machine. If you do more Anaconda and you will find
the same parameters. And you could go in and change the host name the same
way we did it in R7. Right here it says
my first Linux VM, you could change it this way. The newly created
virtual machine does not have the
same host name. All right, anyway, let's
go back to our seven. And here it's going
to install HTTP. It's asking us to confirm, yes. The HTTP has been installed. Beautiful. And if you have
already HTTP server installed, then you are good at this time. Then you need to make sure your HTTP server
is up and running. So for that you have to do
system CTL status, HTTP PD. Right here, my service is loaded but it's disabled, so
I have to start it. If yours is not started, then you have to come
here and start for that. You have to do system
CTL, start HTTPD. Excellent, to verify the status. You can run it and you will see right here it says active. Now you need to enable. It would enable means that you want this service to
start at boot time. For that system, CTL
enable HTTPD. Excellent. All right, That part is done. Moving on to sixth step
copy kickstart file to HTTPD directory and
change the permission. Alright, so let's move on
to our copying direction. So for that you have to do is copy slash route slash Anaconda. And where are you, Where do
you want to copy it? To war? Www dot HTML. And this is the default
directory for our HTTP server. You have to copy it
here so it could be accessible over a network. All right, copied over, let's verify the war. Www slash HTML. Beautiful. It's there, but it doesn't have all the read
permission for that. The next step should be to define or to give
the read permission. Let's go back and let's
give the read permission Change MOD for all read
permission to Anaconda file, verified, and there you have it. Everyone can read this file. Now. Moving on. Now, make sure your firewall
is stopped on the server. If you do not want to
stop the firewall, then you have to allow HTTP port 80 to go or accessible
through the firewall. For now, since we're doing
this only for the lab, that's why I'm going to
disable the firewall. But of course, check with
your security administrator before you disable the firewall on your production
server system CTL, stop. Firewall. It is stopped and I want to disable because I want it I don't
want it to start. At boot time, it's removed. Also another thing is check
SC Linux status for me. I have the SC status
right here and enabled, but I don't think it should
have any problem for us to access the
Anaconda file right? Now in order to make sure
we could access that file. Check file through the
browser on another PC. Meaning I could go to my
PC browser right here. Oops, number, how
is it like Firefox? And I could check that server. And if file is available, what is the IP address
of the server? If config IP is 10251
dot one dot 61. Alright, let's go here. 10.253 dot one dot 61
slash and conduct, conduct dash KS CFG. Once I hit Enter and
I wouldn't be able to see the content of
the Anaconda file, then it means, there you go. It means I could access that configuration file over the network and it is available. Beautiful. Make sure
your Anaconda file is also accessible or your HTTP and we have
just confirmed it. Excellent. Now you can minimize
this or close it. Next step, create a
new virtual machine and attach the OS ISO image. Alright, so we're creating a new virtual machine
where we want to have the kick-start install the
automated operating system. For that, we'll go to Oracle. Virtualbox will pretty much
create the same setting off. Other words, when
machine, meaning if I go to Details, go to Settings. And this machine has
system of one gig memory, processor, one
processes storage. We have 20 gigs, so we'll keep the
same consistent. Let's go in here. Oracle VirtualBox, create a new machine and we'll call it a KS Linux,
kickstart Linux. Next, memory one. Create a virtual
disk, create default. Default here changed
the eight gig, 220 gig, be consistent. And it is done. Now what you need
to do is start. While it is starting up. It already started. So Lao, go ahead and
attach the ISO image. So click on this folder. I have already attached
my image earlier, so it is showing up right here. This is it. Centos
seven DVD is 4.6 gig. Perfect. You might have a
different size depending on if you're
installing a or seven. Click Choose, and start. As soon as it comes up on the
screen, you see right here, automatic boot in 55 seconds, it will give you one minute to choose
what you wanted to do. You do not want to choose
any of these options. Click inside of this
window and hit Escape. Once you get this brute option, then let's go back. What do we want it to do? Minimize this, and change the network adapter
to bridge adapter. Oh, yeah, that's another
thing we have to do. Let's go to our KS Linux, and let's go to Setting
and go to network. Right here is NAT. Let's
click bridge adapter. Excellent. Click, Okay, that is done. Next, hit Escape,
which we just did. And now type this. This is the path
we have to type. Right here is our boot. Let's move this up and type Linux kickstart equal which
network are we using? We're using HTTP server, right? Colon slash slash. Now the IP address of
our kickstart server, that is 10253161,
that is the IP. In my case, you might
have a different, so check by running
the ifconfig command. So 10253 dot one dot 61 slash
and kick-start the CFG. Hit Enter. And what's
the next step? For NFS? You have to run this command. And the next step is weighed and enjoy the automated
installation. All right, let's see
where we are right here. This could take anywhere
between a minute. To five minutes
until you actually see the Automated Installation. I'm going to fast forward it. Right here it is at the
installation summary. Pay close attention. You'll see it has already defined the date
and time for you. It has already selected the keyboard, the
language support. It is already checking the
installation source for you, the dependency, where is
it getting the ISO image? That image is attached to
this Linux virtual machine. We attached it when
we started on. Then it's actually going through the software selection based on our pre-defined settings and parameters into our
configuration file. That's how it's going
in and checking it, then coming down. But anyway, if he had gone down, you probably have seen
more settings that is going through it already picked
the root password for us, which we had created for our very first Linux
virtual machine. Then user creation,
user I absolve. Yes, because it already
has that user that I created when I first time
I did the installation. And now it's going to starting the package
installation process. This is going through
the packages is gonna count probably like
131400 packages. And it's going to go
through the installation. Isn't it so beautiful
when you automate things? Yes, it is. You don't
have to sit here and wait and answer every
question of the installation. You could just define
all your parameters into the configuration
file and let it run. Now if you wanted
to change any of the other configuration
parameters, you could go in and change to the file which is sitting
on your HTTP server. Right here. It is sitting
right here on our HTTP server. You go to Anaconda file VI at modified and change any of the parameters based
on your requirement. All right, excellent. Now you're probably thinking
one more thing. I do want to clarify that. All right, so we did
automate one Linux machine and it's going through the installation right
now you see it's 1300 packages that
has to install. Now what if I have to do or install another Linux machine? Now, do I have to wait
for this to finish? Very good question if that's
what you're thinking. No. The reason behind this is because the ISO image
that you attach to this can be read by as
many virtual machines, as many physical
servers as you can. Because once it's
reading the file, it doesn't matter
how many servers reading that file. Same way. It doesn't matter how
many configuration or how many servers are reading
this configuration file. So you could actually run
this one time on one server. Move on to the second, third, fourth, fifth, as
many as you can. And you probably noticed
by the end of the day, you probably have installed
hundreds of server. That is great for
your productivity. Anyway, I'm not
going to go through the entire installation
to complete, but I'm sure at this point, you have a good grip of how the kick-start server
works and how you could automate your installation
of your Linux machines. All right, So for
those of you who actually are in corporate
environment and you assign IP is to your Linux machines or your
clients with static IP. Then how you can
manage the Kickstart. Because so far we
learned the kick-start. You have to have a DHCP server. What if you do not
have a DHCP server? Then how your client is going to communicate to the kick-start. For that, you will
run the command same as you will run
for DHCP server, which is boot Linux kickstart the path and the kick-start, which is right here, KS dot CFG. Now after that, after
you put a space and then you have to define
these extra parameters, which is KS device equal ETH, IP address, net
mask, and gateway. Whereas the KS device is the network adapter
off your client. You have to know the name
of the network adapter. If you are installing
your operating system to kickstart to a
physical machine, then most likely you
will have ETH 0. Of course it depends on the computer hardware
manufacturers as well, but most of the time
it will be ETH 0. If you are doing it for your virtual machines
on Oracle VirtualBox, then it will most
likely E&P 0, S3. You define that. Then next thing you do is
you define the IP address. This is the IP
address that you are going to assign to your client. So it could be on the network and read configuration
file from kickstart. Pick the IP address, you have to get that
IP address from your network administrator
or wherever you get that IP, which is not in use, then you enter the net mask. And that mask is a subnet
mask for the client. And most of the time
based on slash 24 subnet, it's to 55 to 55 to 5, $5. And then you have to define
the gateway of that network. Once you put that
information in, then you hit the command, then your client will be
assigned that IP address. Then your client will
wake up and it will be able to communicate to
the kick-start server. This is the instruction
for those people who do not have a DHCP server
in their environment.
150. DHCP Server: Hey beautiful people. In this video we are going
to learn DHCP server. I have a few students
who have reached out to me and asked me that I created
a video on DHCP service. Now please keep in mind, DHCP servers is
something that is managed by network administrators
in corporate world, which company you work
wherever you go you will find that DHCP service
is being managed by routers and network devices. No system administrator or Linux administrator
managers, the DHCP service. Why I'm creating this video? It's because I do take my students feedback
seriously and they have requested that I create
a quick video on DHCP so they could
understand how DHCP works. Anyway, before we go any
further into this video. One thing I want to
clarify, in this video, I will show you how to setup DHCP server conceptually only. Because if you want to setup DHCP server on your
Linux machine, then you will have
to reconfigure your router or
modem in your home, which can route then
all the traffic to your new DHCP server. Now, reconfiguring the
router modem will make all your devices at home lose
the network connectivity. If you do not know how to
reconfigure your router modem, then I would say stay away from it because my instructions right here does not include
reconfiguring the router modem because
there are different router, different manufacturers,
different setting. My instructions right here
only include setting up the DHCP server on
the Linux machine. Alright, let's spend a
few minutes with me. Let us understand what DHCP is, how it works in case we should know something about
it or something comes up, down, down the road. All right, DHCP, first
of all stands for Dynamic Host
Configuration Protocol. In order to communicate
over the network, a computer needs to
have an IP address. And I'm sure by now, you should know that
without an IP address, your computer cannot
communicate over the network. Alright, so we're clear
up until this point. Now, DHCP server
is responsible to automatically assign IP
addresses to your servers, laptops, desktops, and other
devices on the network? Yes, it is response, but every time you
buy a new device, for example, you
get a new tablet. You bring it home,
you start it up, and you connect to your WiFi. And then you get
to the Internet. The reason you get to
the Internet because it, it has an IP address. That IP address is randomly
assigned by your DHCP server. Alright, so you're
probably thinking, hey, wait a second. Right now in our home, how IPs are assigned
to our devices? Well, let's quick question. The answer is the
router or gateway that is given to you by
your ISP provider. You probably paying
a monthly fee to your ISP or Internet
provider every month. They are the one who
gave you a router or gateway or a modem that
is actually in your home. That router isn't responsible, or it has a DHCP server
is already running on it, which actually hands
out or assigns IP addresses to
all your devices. That's good. Now I know how the IPs are
assigned in my home, but how about corporate world? How IPs are assigned
and corporate world? Well, to answer that
question, in corporate world, they have dedicated
routers that run DHCP service to assign
IPs on the network. Now, DHCP service is a
service that assigns IP randomly to devices. And if a device shuts down
and it boots back on, it can get a different IP. It will not get the same IP. Dhcp shuffles around
the IP range, it has an assigned IPs. But if you wanted to
assign a static IP, then you do not get the DSC PIP. You'd tell you or your
client, your computer. You assign a static, a fixed IP to your computer. So a want changed then
you don't need DHCP. And I'll tell you this 95% to even I would say around
approximately 98 times. 98% of the time, the IPs and corporate world are assigned and static
basis they are not assigned on DHCP
because they want to have all of their server
have that one IP. They could have it
on the DNS as well. Anyway, DHCP is mostly
used in a home network. So that's why we are learning
more about it morning on step-by-step
instructions on DHCP. The very first thing
is in order for you to run your own DHCP server. Of course, you have to pick a Linux machine which
can run a DHCP server. Once you identified
that Linux machine, then the next thing you do, you take a snapshot. Always take a snapshot if
it's a virtual machine. This way, if you make a mistake, you can always revert back to the time when you
took this snapshot. Alright, let's assume
you have picked ABC to have that DHCP
service running beautiful. Then next thing is assign a static IP to that DHCP server. Yes, That's requirement's. You cannot have that
same DHCP server. There will be handing out
the IP to other servers to rely on another DHCP
server as well. You have to assign the IP. You pick an IP for your choice. Of course, as long as
that IP is available and hard-code that onto
the DHCP server. So it won't change this
way when the clients, your client who needs an IP, when the client goes up
on the network and says, Who is my DHCP server? I o, this is the IP
address that I need to go to get my IP. Dhcp services. Hi, yes, you call me. Here's the epi. But what if the IP changes
of the DHCP server, then the client will
know that's why you have to assign a static
IP to the DHCP server. Then what you do is once the IP, sorry, this is the
instruction to assign the IP, you modify the FCC's
config network and the interface file
and then assign the IP. Or the best way is that you
simply run NMT GUI command. It's a GUI tool to
assign a static IP. Once you run that
command as root, of course, you will be
given a GUI manual. The very first thing is right here you'll get
three options added, a selection, activate a
connection set of host him. So of course you
pick the first one, pick the Ethernet
adapter that you are going to assign
this static IP to. For example, in our case, we will pick E&P x2, x3. And once that is selected, then you come here and
assign the IP address. For this one, we picked the
IP address, for example, when I to 160,015
dot one and slash 5454 means that this will
provide the range of 256 IPs. All right, so once the IP is
assigned to our DHCP server, then moving on, we will install
the DHCP server package. Install a package. You run the command
yum install DHCP. Now this is the command you
will run with the options in, in red how our Santa's
version seven, if you are running eight, then you will run a DNF install DHCP server version eight. The next thing is edit the configuration file
with desired parameters. So you have to set the parameters of how the
IPs will be assigned to the clients that
you have to modify Etsy DHCP slash tcp.com file. If you do not have that conf file or if you
cannot find the current file, you could copy it from the
location user shared doc, DHCP version, TCP.com, that
example to the location. Then once you, once
you edit that file, then you define these
exact parameters. Of course, you could
change these parameters based on your requirement. The very first
thing you define is the DHCP server will release the IP address for at
least ten minutes, sorry, not released reserve. Which means is if it is assigning the IP
address to the client, it will keep it for ten minutes. Well after that, it will keep it as long as the
server is running. Once the server shuts down, then it could reassign
a different IP. Same thing. The DHCP server will reserve the IP address
for max of two hours. Then right here
at this parameter defines the subnet
range of 256 addresses. Dhcp server is allowed to
assign up to 256 addresses. Because we have assigned
the subnet off slash 24. Next one, this is the range. Even though we have slash 24, you could actually modify and
limit that range as well. From 256, you could come
down and define the range. So right here we have
a range of 50 to 200. So it means we want this DHCP server to only
assign up to 150 addresses. You could broaden the
range or shrink the range. It depends on your requirement. Then a router
defines the gateway, the default gateway that will
be given to your client, the subnet mask that will
be given to your client, and the DNS name server, which will be assigned
to each host that boots up and needs
that IP address. Then we have started
the DHCP servers. Once you configure, once you done with the
configuration file, you input all the parameters. Now it's time to
start the service. And it's just that
simple system, CTL star d SCPD. And you need to make sure
you enable that service. It can get started at boot time. Then disabled a firewall or allow DHCP port
over the firewall. If you don't want to
disable the firewall, It's simply to
disable a firewall. You'll do systems CTL
staff firewall D, or to allow the port of DHCP while the
firewall is running. Then you run this command, firewall dash command dash, dash Add Data Service. Which service? Dhcp. And you wanted to
have it permanent. Of course, once you make that
changes to the firewall, you would have to reload
the configuration. Once that done, the service is up and running
on our DHCP server, beautiful a switch
DHCP servers from your router modem to
your new DHCP server, login to your ISP
provider router modem that you have at home, disabled the DHCP
on that modem and enable the DHCP forwarding
to the new DHCP server. Now once again, as
I said earlier, this type of setting is differ
in each modem or router. If you are not familiar
with this setting, I want you to learn first
how you can make that. Maybe you could call you ISP service provider
and asked for help. But if you do not know this, I would definitely
research first before going into and
setting up DHCP server. All right, I hope this
lecture serves this purpose. It gives you a conceptual
understanding of DHCP for those of you
who wants to try. And actually, I would say try it on your lab
environment, of course, do not try this at home, which especially running your
devices that are critical. And especially you
have kids and who are running laptops and games, and they will be very upset. I tell you that. I'll see
you in the next lecture.
151. WELCOME TO MODULE 8:
152. System Run Levels: system run level. These are the run levels in the system in an operating system that brings the system in a different mode. Um, and Windows, you do have, ah, safe mode. That's one of the motor system brings up and it doesn't have networking is just bring you a single user mode and another up ring system have different more just like that In Lennox, we have six different kind off system run levels. The main run rap levels that are significantly used many times. But system administrators is the 1st 10 Every time you type zero, of course, proceeding with the command in it. I an I t followed by space and zero it was Shut down your computer or halt your computer completely. It will not reboot. Oh, completely powered off. Then you have in it. One. It is a single user, more usually a liest as s markets as our upper case, as you could type in its space s or a per case is, it will function the same way as if you type one. Then the most commonly used is six. When you type in its space six, it will reboot your system this command is equivalent to command as if typing reboot the other level run levels or from level to which will bring the system in multi user mode without no working. There won't be any network. You cannot communicate to other computers. Then you have Level three, which is a multi user mode. Vid networking, which is most of the time, is the one that is used by us, but it does not have gooey and the run level five, which is multi user mode with networking and with gooey, um, for our environment. We do have a gooey so most of time Peyron level as five. But if there is no going, you gonna see that you will be rebooted into their own level. Three. So we'll try a couple of thes run levels in our Lennox machine. Let's log into it to run any off the system, run little commands. You have to be route. You could verify it if you are ruled. Of course, by running, who am I and the first command? You have to run zero, which is in it zero space minus zero. This will completely shadow my computer. It's not gonna re but I have to go into my oracle worship box to power it on. Or if it's a physical server, you actually have to be in front off the computer in front of the Iraq. Wherever is, it is racked in the shelf. You have to power on to bring it back online. If you type in it one, it will bring down the system and rebooted back in a single use. A mode. Sometimes you do need to bring your linens machine two senators a moat If you wanted to troubleshoot some issues or reset a password or so on, and then we have reaped in its six, which is just like as a few typing reboot. Then the other unlevel is multi user 23 and five. Now how do you find out which wrong levels you are in the command to find out? Is who Space minus R R. It's the option that tells you what you run level you are in. You will see here. It's telling you you are in run level five. Why? Because they're gooey. If I wanted to bring it into run level in a three Vadodara gooey, I could do in a three, it will reboot system and there you go. See? It brought it back to run level three. There is no gooey. I wanted to type it in my log in credential. And now if I type who minus are you'll see now that the run level has changed three because there is no gooey. If I wanted to just type in its six, it will automatically bring the system back online, and it will be automatically in run level five. So that's about system run levels. You could try every single option that you see it here, tried out, practice it and, of course, one man on in a command.
153. Linux Boot Process: Lennox boot process. So this lesson we will learn how the system boots up. So I'm sure you probably wondered that when you press the power button on your laptop or your computer, then you after a few minutes, a few seconds your computer come up, you get a log in, prompt and your system started. But have you ever wondered what exactly happens under the hood? Meaning you start up your car and it ignites the spark and start of your car, right? But what happened exactly behind the scene? So I want to cover that because it's one of the very important lessons and some off the things in this lesson are important. In terms Off interview. A lot of people ask you questions about what happened or tell us the sequence off boot process. In this picture, you will see exactly the six steps that a system takes place in order to bring your system to a level where you will be able to log in. The 1st 1 is every time you press the power button on your computer, it goes to bios. What Bio stands for is basic input and output off a system at this stage. It performs some system integrity checks, loads and execute boot loader program. It looks for boot loader like a floppy disk or CD room or your hard drive. It tries to find out how to boot. Where is it located? Where do I have to go to bring the system up? The next thing that it does it goes to M B are now NBR stands for master boot record. It is located in the first sector off the Buddha ble disk, typically like Dev HD A or SDA Lennox. So this is the first sector on your disk that is located. To start. The computer nbr is somehow like 512 megabytes and just bites and size is very small, and this it contains information about grub. The next step it does. It's goes to grub Grub stands for grand Unified boot loader. If you have multiple colonel images installed on your system, you can choose which one to be executed so there could be older version off. Colonel. Newer version off your colonel you could started on any of the kernel, and that option is given to you by grub and the good grub configuration files are located in slash boot slash grub, and the file is grub dot com. You can modify it if you want to change the order off your system star the next one after the grub comes the Colonel. The colonel is the one that mounts the root file system has specified in the root equal and grabbed our comfort. That's exactly in the grabbed accomplice. Is it actually execute the innit program? Colonel, execute the slash s been slash and it program. Then it starts the initial ram disk and initial ram disk, which is I and I t already is used by Colonel as a temporary root file system until Colonel is boarded and the real for root file system is mounted. It also contains necessary drives compiled inside, which helps it to access the hard drive, petition and other hardware. The next one goes through. The boot process is in it. It looks like the slash etc. In it. Tab. This is the file to decide the limits a run level. So if you wanted to boot your system in a different run levels, let's say there are six run levels, actually, seven room levels there zero for halt one for single user mode to for multi user three for full multi user mode and five is unused. If, uh, sorry Foreign unused five is to boot the system in x 11 and six is to reboot. These are the run levels that are defined inside off the in it slash innit? Tab file. Once it does that, then the run level program begins to start. And every run level program has its own directory, and that directory is at C R C D R C, and the digit, which is run level digit and dot de every file, every boot order as in these files. So here are the run levels a week ago were a few off them in our Lennox environment. So the meat log in to my Lennox machine, clear the screen. I want to become route because some of these files can only be access to root to the 1st 1 is bios, which is located on the disc. The 2nd 1 is nbr and let's go to the kernel, which is has been in it. So we'll go at sea. Sorry has been in it then. You have other run programs we could go to the other run programs like at Sea R c dot de. And here you see all the run levels if you want to start your computer in run level five. So let's see. Ritual level we are in who minus R V in run level five. So we'll go into R. C. Five D, and here it's telling it to start the consul, which is the gooey and start the network, which is network. So this is what exactly run Level five is, and that's how your computer is started. You get the log in prompt, and there are also many, many different documentation online. You can find out about how the system puts up, and, of course, I will encourage you to go look them up and understand exactly how the next boot process works.
154. Linux Boot Process (Newer Versions): hello And this lecture, we are going to cover the Lennox boot process, especially the process that has been utilized in the newer version. Off legs are burning systems. The boot sequence changes in Santo US and Red Hat seven and above and some of the other operating systems as well. So if you're using right had five sent to us five or six, you probably gonna notice that it has or it uses a different boot process in the in the newer version off Santo s or red Had it actually utilized a different boot process. And this is what we're going to cover? The System D is a new service manager in Cento s and Rail seven that actually manages the boot sequence. It is backward compatible with system for in its corpse. Sorry system. Five minutes. Scripts is used by previous versions. Offer Red Hat and Lennox, including rail five as well, so you could use this boot process to run that could run on the previous versions as well. Now, every system administrators needs to understand the boot process, often operating system, I would say whether it's Lennox windows or whatever the opening system is in order to troubleshoot more effectively because what happens if the system doesn't boot? Then you need to understand all the sequence of where it goes through, how it goes through which file it reads. So you could troubleshoot and go through each of them toe, identify the problem. So let's go into the next light, and I will show you in a graphical way, how this boot process works. The first thing first is as soon as you power on a machine or computer. It actually has a phone wearing it. And remember that from where has nothing to do with the operating system. That firmware actually comes in with a machine pre installed by that manufacturer, that phone where is called bios, which is referred to as basic input and output setting. So it starts up, it takes the power on, it starts up, and it goes to the post process. And the post processes power on self test started meaning it starts up. And then it goes through the all the hardware that is attached that makes the entire computer system. It goes through every one of them and checks hate you. Okay. You okay? You up. Are you up. Are there any problems with the harbors? It goes through that post check. After that, the NBR is loaded. NBR stands for master boot record. The information is saved in the first sector, off the hard disk that is referred to as MDR, which indicates where the grub two is located so it can be loaded in the computer ram. So bias looks up. What does The Post? And then it goes to the first sector off the desk and finds out that NPR NPR has information of Grub two and the corrupt to stands for Grand Unified Boot Loader. And it is is, um, called as to meaning Version two, and it predates words in one which doesnt have won it on it. But it just says grub. So basically, grub to job is to load the colonel, the links Colonel, and that information is in a slash boot slash grub to slash grub dot c f g, which is the config fall. So you when you boot up your links operating system, you probably don't see the BIOS and pull post because it goes through your screen so fast and nbr is probably not noticed because That's the time your machine is looking for that sector. But you will see at one point on your screen on your black screen, it's going to show up as Lennox colonel, and sometimes you probably going to see 123 or five different kernels. Um, that it's needs to loot needs to boot from. So you could at that time also move your cursor up and down and select the colonel. You want to load or let the system decide which colonel it's gonna loaded depending on the grub configuration art. So now the colonel comes up. Colonel says Okay. The grub asked me to to start. Okay, The colonel is the core off the operating system. So what it does? Is it loads to require drivers from innit rd dot I am G fall. Now, this is the colonel's job is to load the driver. Meaning every hardware that is attached to your machine, it In order for it to work, the colonel has to communicate to that hardware. So the colonel, in order for colonel to communicate it has toe has that driver that talks to the hardware. So it loads up all those hardware and then it starts. The first very first office are opening system process that is called System D now System D . As I said earlier, it's a new process introducing the newer version off Lenox. So it starts up the next step as the last step. The system D sorts up. And, of course, this is the first process in the system, and by default it is given a process I d off number one. As the other process starts, that gets the incremental numbers off the process. It's then start all the required processes that is needed that were enabled at the boot time. Then it reads at sea System D system default on target files. This this to bring the system to the run level. Now every system every Lennix system has a total of seven run levels that goes from six through his heart, zero through six, which defines where it's gonna start. It needs a networking single user mode or if it's actually needs to shut down. All those run levels are actually defined in default to dot target file. So it looks up that in that file sees which target file it has to start, which run level. It has to start, and that's how your system becomes online. So this is the linens boot process. And as I said that this is a newer processes introduced lately in your worsens. So definitely go through this. This is one of the important things that every system administrator needs to know. Needs to remember while they're troubleshooting the issue. Good luck.
155. Message of the Day motd: message off the day. It's simply a message that will appear on your screen. Every time you log into a limits machine, it will tell you Hey, welcome. This is this machine. It's host. Name is this And please be careful whatever the commands you run or whatever the message that you wanted to be seen two for the user. So maybe you have experienced something when you when you actually connect to different servers or more servers, the first thing comes up eyes. A security warning. They'll tell you, please be careful. This is a very critical server. One of the commands that you run, everything is being recorded Everything. So message with the Tate Dake file is located in etc. M o t d. It stands for message off the day, so let's see how it works. I will log in to my linens machine and the file. I'm gonna modify his V I at C m or T D. Right now you see, it's empty. I'm just gonna type something here. This is our first Lennox machine. We used it to practice Lennox commands. If you are not authorized, then please exit out just that three lines that I want to type. That's save it. Which is calling, right. Quit and bang. Let's verify if it has everything that we type. Yes, it does. Now, how do we verify that every time you log into the system, it will show that message? We will. We will check that. We will verify that by logging in through from our party section. And, of course, if you want to log in from pretty session, you need to know the i p address of this machine by tapping if config and the I P addresses 1 90 to 1 68 for $1.14. I'm gonna go into this machine 19 to 1 $68.1 dollar, 14 enter. It's just a security message. You could just Yes, log in as yourself are as root they go see you. See your message. It says right here. This is are I made a mistake with our but that's okay. You got my point. Right? And this is the exact same message that you typed in that file. So, um, try that and changed the text and see if it works for you or not.
156. Customize Message of the Day: Customized message of the day. We know how to add some content into the file at C, M o TD. And that content will be displayed, that simple text message will be displayed on the screen. So that is Message of the Day. So once again, message of the day is the first message users will see when they log in to the Linux or any Unix, Linux related machine. And you have to add that simple text message into that file, which is at C, M, O T, D. Now what if you wanted to add some kind of commands in it? Like when a user logs in UI to show user which host named a logged in, what's the operating system version they have, or what kind of kernel they are running, or any commands that you wanted to pass along to the message of the day file that will show up every time a user login, right? Wouldn't be, wouldn't that be cool that you put that in one entire customized script into one machine and just copied over everywhere, then it will show up different messages, different host name of course, right? Instead of you going into Etsy, MTD fall and modifying the host name by yourself manually. So the steps that we will take to customize our message of the day file or the message of the day that will appear on the screen. The first step is we will create a new file in ETC. Profile dot D M O T D. This is the file we will create. The file name will be M o TD dot SH. Then we will add the desire commands into that file, which is a motif d dot SH, while. Now we'll modify the ETC, SSH, SSH D underscore config, which is, which is the SSH de process config file. And we will actually added the line that says print M, O T D yes to we uncommented and put no, it means we are telling it. Don't display the message of the day anymore. Actually go into the ETC profile and look for this message of the day fall. Then we will have to restart the demon SSH D, which is the service, and to restore system CTL restored SSH d dot service. These are the substrate will take and this will customize. This will enable us to customize our message of the day on the screen when the user login. Alright, so let's go into our Linux machine and we will try that. These steps to modify our screen. I am logged in as root. You have to log in as root because you either have them displayed to everybody. And in order to modify anything that is in ETC. Directory, you have to be rude. And West host URN UR and your own host name, perfect pitch deck to you are in. We are in our home directory, which is slash route, which is the root home directory. First step. First, we will have to create a file in at sea profile dot D M, O T D. This is the file name. So first go to, let's go into Etsy profile that D And in this directory we will create a file MO TD dot SSH. Now to save some time, I have already created that file in there already. And that is M0 TD dot SH. I used the vi editor to create that file. Now remember the fall has to end with a dot S H because this will tell the operating system that this is a shell script file which has to be executed. Now, you could VI that file and you'll see what I have inside of that file. First, this is a basic SSH shell script. You run as a regular commands and stuff. So first you put pound, bang the bin and batch, which is the shell. Then it is just a pound. And then echo minus e, which is, I'm saying that whatever I'm typing right below should be displayed on the screen. So it's just that simple. You don't have to, if you don't want to put minus e option, you could put echo followed by all that stuff that you have underneath. Anyway. Then I just picked hash sign, which will display on the screen. I pet Welcome to host name. Host name is actual, the command itself and we type hostname. It actually show me the host name of my system. So I make sure that host name command is actually surrounded by the tech. And tick is right on the left side of number one, or right below the button which has the curly tilda, which is right above the tab. So start with that tic, end with that tech. Then the next line I have system. This system is running. Again, this is the command and I'm carrying out the fall at sea. Red Hat dash release. Again, this is surrounded by the ticks, ticks, dark tick. And then the next line I said kernel is, again, this is the command union minus R. And I surrounded with tic. Just empty line. Now this one is, you are logged in as who am I? You know this command right from part. So you are, my command is surrounded by again tick, and it's just simple. Hash signs, pound signs. And then at the end, don't forget to close the double coat because we started the double quote right here, right? So ended with double CO. Now, if you are having problem typing it in or you made a mistake, I have attached a handout in my handout section, I have attached a document that has all the information how you could customize your message of the day. Anyway. So this file has been customized, has been added. Now the next thing what we have to do is we have to modify the ETC, ss h and SSH, underscore SSH D and describe config. So I have to do VI, But before I would tell you to modify that, it is very, very sensitive file because if you make a mistake, it will probably not going to let you login. So first, what I would do is I'll make a copy of it. So do CP slash SSH slash SSH D underscore config. Then again. The destination at sea, SSH, SSH D underscore config, and I'm gonna just put dot ba K as in back. So now when you do ls minus l and c SSH, SSH, D config asteroid. You'll see both files, the original file and the backup. Now you could go in and modify the original file. So now in case, sorry. So now in case we make a mistake we already referred back to adopt backup file, hit enter. Now hits lash. To find our exact syntax that you're looking for. An exact syntax is print M O T d. So slash p r i n t m, uppercase O T D, hit enter. And it will take you exactly to the line that you have that you wanted to modify. Get rid of the pound or hash sign, and replace the yes with no, which means do not display the SCM motif file anymore. It will go into at sea profile Daddy and it'll display whatever. And what TD dot SH, We have a deer. Perfect. Now go ahead and save it. Colon WQ, bank, and hit enter. Now it has saved that. Now the last thing we have to do is restart the SSH dot d service. So the command to restart is system CTL, restart SSH d dot service. Okay, we got a prom back. Perfect. Now I will, when I will log in from another terminal, I should see that message that I have created in ETC, profile dot d slash, oh, TD dot SH. I will see it there. So I will login from my party terminal for before I do that, I'll find out my IP address. My IP address has changed now it's 100 to 168, 1.2x nine. So I'll open up my party terminal. My party terminal IS PUT TY pari in my search, and I'll type in 190 to 1681 dot 29, hit enter, log in as myself. Now, there you see that message, how it came up. It is so cool. So now all that stuff that we have added in there now, it is customized. So welcome to. This is my host name. Remember, it is actually running the command. The system is running. So now this is running the command as cat was the commander was cat at sea Red Hat release. This is exactly what it's displaying right here. Kernel is, this is, we put it in as you name minus r, and that's exactly what it is showing right here. And the last one we added that you are logged in as and the command we had was Who am I, and that is my username. So anyway, that's how you modify or customize your message of the day file. So hopefully this will help if you have multiple systems and you wanted to show that to your users when they log in, they will machine there have logged in. You can also put in a lot of different commands to check what memory it has, which displace it has a whole bunch of stuff that you could put it in and put customized scripts as well.
157. Storage: stor age. Okay, what is storage? Storage is, of course, is Ah, hard disk in your computer, right? When you go by a computer, what do you look for? You look for memory. You look for CPU and that their thing. You look for how much this space it has. So there are three types off storage that are attached to your computer. The 1st 1 is local storage, which is inside of your computer, which comes pre both pre configured inside of your computer. The second type of storage is san. It stands for storage area network. What it does it attaches to your computer through fibre. Cable fiber cables are now coming in with a gig off speed and 16 gigabit off speed. So anything that is attaches to your computer through fiber cable and your fiber cable adapter that is for storage area network. And the 3rd 1 is now, as which is network attached storage, which it means anything that you attach it to your computer through NFS or through an I P or through a cat five cable. Anything that is attached, that is NASA also in windows. Samba is attached through the I P and the folder, and it is shared from our more computer. And then you mounted to your computer and that type off Attash storage is called nasty. The reason I am including this storage lesson in this in this training is because many times you will be asked in your interview that what kind of storage you have worked on or, if you know anything, about what San is or what Nass's. So please be familiar, spent some more time and Google it if you have to find out what exactly these storages are .
158. Disk Partition Commands: disk petitions. In this lesson, we will learn Ah, couple commands that are used to show which ah file system has been petitioned. Where is the petition to and what is your local file system? Disk size? The first command is DF, which tells you your disk information. How much disk is used? Where is it petitioned to? And the 2nd 1 tell you how much the disc total size is and how many petitions has been created out of the disc. So let's try both off thes disc for a commands in our Lennox environment. The first command I want to type is just DF and just by typing DF the first column is tell you where is this file system is coming from the size use available and percentage and mounted. You could run DF Minds H command and you will get the human readable output which will be in gigabytes percentage in which where is it mounted to? The next command is F disk F disk without any option is now gonna give you anything so often times it is used with an option minus l. When you type f dis minus l, you will see right here the disc size. Let me do, um or let me make this a little bigger. Okay, So when you eat type F dis minus l, you will see that the discus petition to slash dev slash sda Just one petition and it is 10 gig off space. And right here it is telling you it is mounted on SDA one, which is Lennox, and the other one is sorry. The 1st 1 is to swap into the one is the actual disk, and it gives you some more information about the desk. What, as each size mounted before, If you notice here the 1st 1 the 2nd 1 here. It's a center west wop and I created a swap for one gig. And that's what it's telling me that that sec through the first petition, which is right here it's mine monte or swap, and the rest is mounted on our Deb mapper cento US route and which is almost 8.5 kick. So that's why these files these commands are used for it is very useful when you want to add a new disk to your system and then after adding it, you want to initialize it. You want a petition it and you wanted to mount it to you to your mom points
159. Add Disk and Create Standard Partition: adding disk and creating new petition. Now, this time you're gonna talk about how can we add a new disk toward existing Lennox system and then create a petition and, of course, mount that petition. The purpose behind adding a disc is most of time. You run out of this space, or sometimes when you your computer running multiple application. Maybe one petition is required for one application, and the other petition is required for another application. So that's where you add a new discs and, of course, the commands that we will be using in this lesson in organ DF and disk. Before we get into the next mission, I want you to open up your Oracle warship box because that's where we're gonna add the virtual disk. Since we do not have a physical server that we're working on in physical system, you would, of course, have to pull the server out at a new disk if you have a slot and then bring the system of. But now, since we're working on abortion warm, it's a lot easier to add disk. Let's go into our virtual box. Okay, this is our worship box. Before we could do anything I want you to If you are not on this screen, um, if you are on this green, I want you to go to Snapshot, click right here and create a snapshot. And just name it. Anything you want that will make you remember, um, snap shot before adding disk click. OK, The reason I'm creating the snapshot is in case you make a mistake while adding a disk. This will make your system unable to boot, so it's always easier to report back to your original snapshot to this where you don't lose at anything. So now, since you have the snapshot, it's done. Now I want you to go to setting and then go to storage, click on controller and then click on Add U Disk, and it will ask you optical disc, which is CD room, or add a new disk. So just click on, add a new disk. It will ask you, Do you want to choose an existing disk or create anyone's click on create new disc? Leave the default beady eye or should box disk image click next dynamically allocated that it's OK. Keep a default and pick a name. Any name you like, let's call it data disk. And I want you to pick two gig instead of a gig to does Irv's Aerospace G B click on create . So once you create, you'll see you have a new disk. Now click. OK, so now it's time to power on your machine to click on start. Okay, Now, I want you to become moved. Okay, Um run D if my stage command and you'll see right here This is the what main disk that we have It is mounted on route now run F disc minus l um, you could doom or because it will come up with additional information. So when you doom or you'll notice the first test that we have that we added while we were building the system, the first time is for 10 gig, which is here, and it is deaf SDA and it has two petitions, one for swap and one for regular clinics. The M, The second, STV added, is right here. You notice this disc has 2147 megabyte, which is about two gig and has unit sectors and all the information there. The other two information This one is about the partition information about the first disc . This one is telling you that center was rude petition and the swap petition. So we have to work on this one, which is the new one that be added. Now, I want you to run f disk slash dev slash sdp, which is the name off the disk. We are using your utility F disks to create a new petition so you hit, Hit enter. When you hit enter, you'll notice it will bring up to the F disc menu are at F desktop oral pills. Tell you welcome to the F desk. Utility changes will remain in memory only until you decide to write them. Be careful before using the right command. Of course, we are careful. If you make a mistake, we could always reward back toe a snapshot. So now in this menu, you have ah, different commands. But type helps. You will see the different commands that are available for us. Here are the list of different commands you could review with one by one. The one that we need to pick. Is this one new because we are creating a new petition, so click end for new now What is this petition type this primary or extended? Be a primary doing it with doing a new discs. Click P or just hit. Enter because by default is picking P. Then primary petition number. Default one. Pick one, type one or just hit. Enter the sector 2048 Yes, I want to leave the default to zero for eight. The last sector is 419 40 03 That is finally with default. If you want to change the size of this petition, you see right here it's a size. So let's say, if you want create to petition and each one gig than you could do is plus one G, and this will create one petitions, and we want to use the entire desk tools disk for one petition. That's fine. So hit. Enter. Now it's done, says it. Petition one of Lennon's type a type of next end off size. Too big. It's set now. It is not created until we do WC right here, says right table to disk. And if you remember the beginning when we were an F disc, it says it will be in memory until you do w. So it w hit Enter. And it has done calling upto to re read petition table thinking this done. So now the discus done. If you run f disk again on, just do the minus l and you'll see right here Deb as D B one automatically. When you created one petition first petition, it assigns the number one. Now, this, um, volume is created. Now we have to assign ah, file system type. So if you remember, file system types are like a different type of file systems. We have x e x t 234 x fs antifa anti fs There different types of file system the latest one that we have in the next is X fs. To make that file system, you have to run command M kay F s make file system dot except fess. This is the command. And then you have to specify your volume S de de one, which is a boot device, of course, and you hit. Enter When you hit enter, you will get all that message with all the details how the follow system created one of the other information size, sector and a whole bunch of stuff. So now it is created. Now what do we do with that? Now we have to mount it to a certain mom point. That's why we make We're gonna make a user if it right. So I want you to create a directory. And Katie, I are under root and call it data it. And now this is creative. If you do a little myself on the slash, you'll see it is created right here. How are we gonna mount that? To our petitions of the command would be mount slash Dev's left STB one, which is our volume space data. So we amounting that? The petition that created toe our file system toward directory that we just created slash data it better. It is mounted. How do we verify? Now you run to the F minus H and you will see right here the bottom. It created our petition. There you go. See? So now we could write to wait. Whatever that you want to do now, every time your system reboots, it will not mount this. So how can you make make it enable that it will get mounted at a system reboot is you have to add an entry fee I into fs tab file. Fs tab has all the information about your petitions you hit enter, come down all the way to the bottom pit. Oh, and used to add a new line, then type slash death s d B one. Remember, this is the volume, right? We created new partition tab. Where are we mounting it To the mounting it to slash data, right? Yes. Then tap the next one column is what type of file system is It is X f pest follow system tab, then the arrest. Leave that default and then tab zero, tab zero. Um, those two zeros that I added means something. These are the options that it would run while system check when the system boots or not. So you could look into it in more detail by running manifest tab Command. Um, just type manifest tab, or just search it online, and you will find meaning off every field. It make sure you don't make mistake. If you make a mistake, you will have a problem booting your system. Then you would have to revert back to your snapshot. That's why I asked you to create a snapshot again. read it again and make sure you are typing it corrected. So now it's done. It escaped, right? Quit and better. So now when I do in its six, you will see the system a boot. And when it boots up, it will have that slash Data Mountain. Okay, When you log in, open up a terminal and now DF minus h and you will see right here That s D B one is automatically mounted and the reason it is mounted is because we have that added in our slash fs tableau two ungrounded. If you want to unwound, for example, just become route and it and to pass would and type you mount slash data the mom point hit Enter and you will see it is gone. It's no longer there. If you want amount back in mounted again, you have to run mount the whole command or you could simply type Mt. Finds A What this will do is it will go into at CFS tab and see what are the mountains. What other filed petition that I have to mount. And it was a mounted, all of them. You see the bottom, it mounted back again So anyway, you could leave that data in. You. Believe this disk if you want to, or you could remove it. It's up to you. But if you had made a mistake and your system is not coming up, you could always go back to your Oracle warship box and then you could stop your machine and revert back.
160. Logical Volume Management LVM: L V M or Logical Wally Management. This is the term of'em you probably have heard many times, but let's look over how exactly this functions. L. V M allows disk to be combined together, and it is a software based. So again picture speaks 1000 words. And that's why I have laid out this picture. It'll go word one by one. If you see if you look at the first disc, this is one disk, and out of this this let's say, if it's 100 gig out of this 100 gig disc, recreate a group and that group is called. Whatever the group that you wanted to be called, it is that group Assoc is associated with one disc. Once that group is created, that group has created out of L. V M software. Then you could have as many petition out off it as you want, and if you look at it on the right side, you have a petition for system swap home. Or you could have mawr like war or temp as many petitions you want, just like in windows, you will have see you have D and you have E or efforts, he or all the way to the sea. So this is how you partition a disk, right? You have one disk and you petition that disk. But in this case, you create one volume group. Now, in the next section, you will see at the bottom exactly why we do need to create volume groups. You have three disks. Now each disc is 100 gig, 100 100 100. So that makes it 300 gig. And instead of few, take one, get one disk and assign it to one petition or one mount point. You take all three days combined together and make it ah, volume group and call it whatever that you want to call, Let's say in this example his data V g, which is volume group. You combine them together. This group the size of this group that comes 300 gig because all three disks that you have on the left hand side each has a size of 100 gig. So that becomes 300 gig. Then you create. Sorry. Then you create on the right hand side, you create data 123 and four and different petitions. Now the advantage of L V m the main advantage of L B L V M is what if you run out 300 gig that you have created the blow, then you could add 1/4 disk, and without breaking your petitions or your file system, you could at that desk to your group. Your volume group, which is at this point, is data V. G. You can add that extend that group and the group size becomes 400 gig. And then you could associate that size to data one if data one disk space is run out of space. So this is what logical volume is, for It is very useful in a corporate environment because you have to extend the disk space or petitions off your mom points all the time. Because if you have given a server to a developer and the size off your route is 100 gate and the and the developer runs application programs and it fills up the root petition really fast and it becomes 99 gig. So you're 99% full, right? So what options you have left while the only options you have left if you have physical servers popped the tray out and take, add another disc. But what if there is no capacity to add another disc? You're out of luck, right? So in virtual environment, specifically, you could add another disc or extend a disk in virtual machine. Once is extended, you could extend your group, which is right here, and then you could petition that or extend your data one or route from 100 gig to 200.
161. LVM Configuration During Installation: Now you do have some understanding of how L v m works, which is, of course, for logical volume management. And we will go through our Lennox OS installation, and we will configure L V M for the very first time while we are doing our the next installation. So let's, uh, open up our package and attach our eyes image to R V m. So let's go into our washing machine. Click, undo. And this time put um l v m Lennox. Oh, this It doesn't matter. You could pick any, um, any name that you like the type she should be. Lennox. And aversion is the 64 bit click. Next, leave the memory as one gig, create a new Horschel disk. Next, even default for the virtual physical disk. This is the name off your folder where will be created. And this is the, um, the size off your disk off your hard disk. Okay, so now you have to washing machines. One you have already running previously. And the 2nd 1 you just created. So that started. Okay, we have to specify where is our sent os? I s O image is and click stored. Okay, this is going to boot the system and 54 seconds. The 1st 1 is installed Center Where? Seven. The 2nd 1 Test this media and installed Always don't pick that. Click the up arrow key. And who would install Cento a seven? Okay, uh, the first thing that you will see during installation is welcome to sent over seven. You leave that default ISP, English and English and you click on continue on the second page, you will see the date. Leave that default as America and New York Time. If you are in a different region, you could pick according to your region. Keyboard will also listing getting the list of keyboards and I will have it set to default , which is also going to be us English language support is English to the United States. Again, the 1st 1 as the localization. You should pick these settings according to your location. The next one is a software installation sources the local media which we have already attached to this installation. And on the right hand side, you see softer selection. You will keep the softer selection to minimum, which means there will be no qui installed because This is just the demonstration off the L V M configuration. Que Adam is enabled Security policy. Leave it as is, that's picked the host name and no work. If you scroll down the host name is right here. I want you to pick any hosting that you like. I will just pick host 123 and click on Apply and you see on the right hand says it's his current host named Host 123 For now, you believe the network setting as disconnected and turn off like done, then go to installation destination. This is where you would have to specify your discs, your partitions and what kind off L V M petitions you will be configuring. Okay, we have our disc set to eight Gig of memories to select that When you have this check, Mark will have the option neighborhood the bottom and this is automatically configure petitioning. No, this time you will check. I will configure petitioning myself once you click on it and then go to click Done. Once it is done, it will bring you to a page where it would ask you then you sent or seven installation and it says you have created any mom points for your cento a seven insulation yet, so we have to create it. Of course, create new mom points by clicking the plus button right here. Before we click, the plus button will ask new My points will be those used to falling partitioning scheme, which is L V M. You could click standard petition, which will not be Elby and related. If you click on L V M and Click plus Sign, it will actually apply the L V M configuration to the petition. And you picked a mom point. For example. You want to have home directory and make two G leanings to gig. You want to give it to your home directory? Click Had my point As soon as you click. Add mild point on the right hand side. It will give you the mom points national capacity that you have picked the device type O P L V m again. You could change it if you want to, but we are working with L V m so relieved that slbm the group name is Cento US under school host 123 This is the host name a group named that is being picked by the installation itself. You could modified if you want to give it a different name by clicking model file system type is except test, which is the most latest one. And Lennox, you could pick a different ball system if your desire to then the label you believe it, as is in the name, of course, is home. So you have given to get to this and you have left with six kids. So let's pick and other partitions and click Plus, and this time you will think War War I wanted to give to giggles well to G and click. Add more point and same thing as we had for home. It is giving us mumbling war two gig L V M Cento US host 123 Volume group is the same God one group that has the whole entire eight gig assign commodity by to change it again. But anyway, now you see, we have four games left now. Simply What you could do is you look like adhere. And if you wanted to add swab, that's ex swab. Sew up as a virtual memory, which is just like a regular memory in your disk, but this will be used to to be available when the physical memory is run out of space. Click on Add Mom point Again and again. There is no mount point for straw because just social memory, everything will be the same. And now you have three gig left, so plus again, and this time you picked the rest, which will be slash everything else that is left on your desk space will go to slash directory. So if you see has here t 00 60 Done 97 You could type all those numbers or you could just simply type off and you type all it will take the entire displace and left and assign it to your last month When would you slash and long point and confirm the configuration on the right hand side. The device type is I'll be hemmed. The group this same. The name off that petition is gonna be a hoot. And it's You see, we only have 992.5 kilobytes this base left so you could just leave it, as is the system media needs to leave it out. And now you just click done. It will just tell you the summary off hold changes that you have done that it will create thes home directory sets. Okay, click, accept changes. And now it's his error checking stories configuration this and this could come down again and just confirm one more time. Everything looks good if everything looks good, So let's go back again. Urgent Click for details pressed Done again to continue the boot file system cannot be off type l B. Um, yes, there is Truth. I forgot to pick. Boot also has to be picked, so I moved. Heck, so I will remove this first because we need to create from board first. So the last protection that slash that we were picking I removed that Now I will add food first and I will give this a C 500 make you just half a good That is added same thing except fastball system. Now the rest I want to give it to and just assign all everything is added. Just make sure no, her messages click on done except genius Custom partition selected. Everything here looks good and no ready. Letters off error messages. Perfect. Not begin installation. Well said the rule password. Real quick anger is a creation if you want to, you would have to click done twice because the password that have entered is weak password . So in asks us to click the done button twice just to confirm that you are huge were aware that you have picked their own paths under big past. Anyway, if you notice the bottom, we'll see we have 300 packages that it has to go through and it is applying all those packages I will fast forward from here. The installation has been completed successfully. As you see, the bottoms has sent us is not successfully installed and ready way for you to use. When you come down, we'll see the option to reboot. So just go ahead and simply reboot. Okay? The system has been rebooted and we got the log and prompt. We'll go ahead and again. Okay, Now run DF mines. H dis command will give you all the petitions that we have created doing on installation. We will show you the size and the used space in available space. The first line if you notice we have the root ball system and you see it is. It has a false system starting with Dev Mapper. So anything that you have in L v. M, it will start with Dev Mapper. Anything that is not what l b m or just a swab space does not have a petition file system. So on the right hand side, you will see it is mounted on slash slash death, which is the swab or thumb or so up the next one that you will see from the from the list is slash home slash war slash board. Those are all three petitions are mounted. Sorry only to home and war amounted under L V M. Where's boot does not get mounted under the MSs 200 file system. And let's look at our other next machine. So the difference between but this machine and other machines this mission has going get a one. We did not install the queen because we just wanted to cover how the obeah is configured your insulation so runty of minus h and this one you will see the first lined right here. It's his death member. They're cento a stash hoot. Now, if you notice this machine is also configured with el viene it did the configuration on its own because we did not partition it ourselves. So by default, Lennox insulation will create your file system under the L V m. Unless you specifically tell it to use a standard petition. But in this system, you'll see we don't have, uh, slash boot. Sorry slash war slash home slash war. You don't have those petition because we actually included all those partition within the first petition. And this one You could still have everything under one petition. Sorry, this one. You could have everything under one protection. We just slash But the reason be picked, separate partitions slash home. Such war is just to cover this lesson. So you understand how L V m is configured for each mounted petition.
162. Add Disk and Create LVM Partition: adding disk and creating a logical Wally manager petition. You look at this picture now, at the bottom of the picture, you will see we have hard disk, hard disk one as D A. Hardest to hardest three. So every hard disk we created a petition on top of it. Now, if you are doing L v m on top off it, then you would have to create physical volume. Physical volume has to be created for each petition. Then we create a volume group. This group will represent that entire physical volumes that that will be coming cow off those disks and then we will create logical volumes once we have the logical volume, which will be exactly the same as a standard volume. But of course, this will be for under L V M. And then we're gonna mount those logical volumes to our file system. So this is how it works. Let's get into our links machine and we'll try how it works now gain. Before we get into linens machine, we have to goto Oracle worship box and we will add a new disk to arca worship box. Okay, so this is our market works with box. It is powered off, so make sure it is powered off. Okay, go do this setting. Click on storage, going controller Seda and then come down here and click on add and u disk at a hard disk. Look on creating your disk. Leave the video default dynamically located Default. Pick a name. Any name that you like? Let's say we're gonna pick disc Oracle. So if you if your database guys coming to you and telling you cannot have an additional space and you believe that it according to the application but again doesn't really matter and the size of the disc I'm gonna pick this one gig. Then you click create, so now is created and you simply click. OK, now, once you're gonna boot up the system, it will have the new discs. Let's start our system. Okay, so once you log and you open up a terminal Now go ahead and become route, okay? And Ron DF sorry. F disk my spell to it more. The first disk you're going to see a ZA 10 gig is the one you created during the installation. The second issue have is for two gig that you created previously and and its petition information. And now that they're disk, you have If you notice it has the third letter S D C. Which is right here for one gig. So the first gets always starts with S t a second STV and the 3rd 1 S d. C. So we already have the desk. We confirmed that to know. Let's start creating the petition. So now if you notice from the background to go back to the our slide, the 1st 1 is hardness. We have confirmed we have the hardest. Now let's create the petition. So we are going to the petition. If you see if you look at the picture, we'll see on the green once, right about the discard the prediction real. Go ahead and create those petition. So to create the petitions f disk space slash dev slash s. D. C. Because we are going to create this quarter third petition for the third disc and you hit dinner, click on New and to create a new protection p for primary petition. One is the first sector partition. Sorry, first partition that you want to create by default. It's one to leave it as people and just hit Enter the sectors all the star for 2048 And it is giving us by default to zero for eight and leave a default hit. Enter now the size of the petition you wanted create. I want to give the entire size Said automatically giving me the last sector off the disk so I'll just had enter and I'll pick the deep ALS value. So once that is done, go ahead and click Peak. So this will tell you that your petition has been created, but again, this petition has not been written to the table yet until we do w which is to write. But at this time since we are doing L v m, I want you to type T because we are going to change the type off this partition. Why? What is t four? If you type just help. You'll see. Right here T is change petition system I d. So we wanted to change it to L V m. So I want to type t and it better. And here I want you to type l to see what are the hacks court associate it with L V M so L V m is associated with eight e that I know. So eight is somewhere here, right here. It's his l v M 80. So just type eight. Sorry. Eight teeth and hit Enter. So now it's has changed. Type off petition the next to LV. Um, so head P again to confirm. Right? See it right here. It says Lennox L V M. Now, now it is done. Now go ahead and type W to write to it. Now it is sinking the disc. Good. So now are, um Ah. Partition table is created. Now, the next step, the next step is to create a physical volumes right here where it says the blue ones Deb s d one. So the third, uh, step is to create physical volume. To create a physical volume, you have to run command p v, create physical volume, create and the name off the volume which is dead stc and the name of the petition number one. Then you go ahead and enter, and it says successfully created to verify it, you could always do PV display, which is to petition Elin display. And it will tell you that it created the volume of information The P E size, the P Reef, new physical volume size 10 20 megabyte, which is one game now we have created the the physical volume. Now it's time to create the volume group. So we are on the fourth step right here. It says right here if you notice volume group. So we're gonna create volume group. We want to create a volume called The Command is V G Create and the name off the volume group that you want to sign. So we're gonna continue with our example. So we're gonna example of Oracle. We're gonna pick Oracle underscore LV. You could pick any name, but I'm just being consistent. So l v stands for quality volume. Sorry, I should pick VG volume Group said this was identified. This is this group is for our And now we are assigning this volume to death STC one right. So I want you to go ahead and create hit Enter and it says volume group Oracle underscore pg successfully created You could go head and verified by running the command BG display and give the volume name which is Oracle underscore v g. And it will give you the information about that group. Now we are done with the volume group. Now, the fifth step is to create logical volumes right here. Logical volume, which is also just like a petition. So now, to create a logical volume, you have to run the command LV create, then minus end New particle underscore V. What is the name off the oracle? Underscore l week the size they took size as one G. Because we have the size of bungee. And where is gonna associate it to? To Oracle Volume group. You go ahead and enter and it says volume group Oracle V G has insufficient free space. 2 55 cents to 56 required. Okay, I picked exact same one. So what I could do is instead of that, I could just pink 10236 You know, there's one or 24 um, megabyte makes one gig. So let's try that and hit him and hit better. I'm still not enough. So I'll just picked 1000 because it does need some off the space to hold its as the M information. Okay, so it is the logical volume Oracle underscore LV is created. He could verify it by running kelvey display, and you will see right here it is created for that group. Okay, so now that is done. Now we have to format the disk a sign the file system to it. So make while the system except this to death. Oracle, the G underscore Oracle L V. This is the group right here in the middle. And this is the logical volume that we just created. So we are assigning xfx file system to this partition to hit Enter it had created. Now, now it's time to mount this logical volume to our directory wherever Dart our director is. So I'm gonna go ahead and create a new directory m k r m k d i r. And call it Oracle Dr Created. Now go ahead and mounted. So how your amounted? We have two mounted slash death slash oracle at beachy slash Oracle, LV Mountain. Where to Oracle. It has mounted. Go ahead and do DIY of my age, and you will see um, the DF minus age. Uh, yes, right here. All the way to the bottom. It has a sign. Um, this volume to this directory. Um, you could also amount of a human command. Anyway, this is how you create. Um L V m knew this petition. Some of the commands are there. You just have to remember those commands how to run them. What is the order That you have to run them again? The order always goes by the layout that we have. So first we have hard disk, then petition, then physical volume and volume group logic of all dependent mounted to the file system.
163. Extend Disk with LVM: this lesson is about adding and extending disc using logical Wally management. Now, why do we need to extend a disk? So if he have a desk already in our system analytic system? And let's say if that disc becomes full, it's 100%. So you have this disc that is mounted on slash Oracle and the disc space off. That article is one gigabyte, and now, after, let's say, six months of the year, the database administrator comes back to you and say is, Hey, um, I need more disk space for slash Oracle because we've been doing a lot of work. The productive ITI has been increasing every day. The data is increasing every days. Of course. Eventually the databases gets bigger and bigger, so slash Oracle gets bigger. So what options do you have? Well, you could look at a few options. Number one would be like delete some off the older files to free up this space, right? That's what the basic thing is. So if you have your room that is fully cluttered and you don't have a room to walk around, what do you do? You take out the oldest stuff and throw it away, right? I hope so. Right. Okay. So the other options that we have is add a new physical disk and mounted to slash Oracle to meaning that if you have a physical system, then you could add a new disk in this physical system if and only if you have the slot, an extra slot to add an extra disk to that physical system. If you have it perfect, you could petition it. You could configure it at at your raid level, and then you come mounted on slash r slash oracle to or if you have a virtual environment, which is the perfect scenario. And that's why I love virtual environment, because you don't really have to actually pull your server out, open the top and add a new disk. So if you have a virtual disk, all you have to do is go to your VM and add a new disk, and it takes literally a few seconds to do that. So and then once you add that you do the same thing, slash Oracle to now, I wanted to extend my slash oracle. I don't want to create another petition or other another Mount point like horrible to then what do I do? Well, you will be out of luck if you had not used L V M. Initially. If you have, then, my friend, you are in luck. Then you would extend your slash oracle through logical volume manager. So no matter how Maney desk you attached external disco are until this doesn't really matter, all you have to do is create a petition of the disc and then Attash that disk within the same group that you created for slash Oracle Mount Point. The heart is at work. Let's get into ah Lennox machine only. Find out now, before we get into a Lennox machine. Let's add, Let's zoom that we don't have a death space and we want to add a new disk to our virtual machine. So let's go to, um, our machine powered off. Of course. Make sure it's powered off every time you have to add a new desk or at resource is go to setting good storage and then you'll see you have three disc. The 1st 1 you have is about your own Linux operating system disks that you created. Initially, I think it's like 10 gig the 2nd 1 you have is about the data disk. And the 3rd 1 be added Oracle Data Oracle, which is one gig. So that's click here and you will notice right here. The devotional disc size is one gig, but of course it is running out of space. We could extend it. Now, remember one thing, Um, other torture environment, like a enterprise that will be in where or even Oracle Red have or to environment. You will be able to extend this this space right here but by clicking and clicking on extend disk. But I believe since this is a ah PC version ah, person version off Horschel environmental. You cannot extend that. So what do you have to do? You click on your controller, add a new disk at hard disk, create new disc beady eye next, dynamically allocated next. And the name you could just name the same way as the other one. Data for a cool. And put one here because, of course, sorry. You cannot name the exact same because it will be a conflict. So now this is the second disc. Uh, you know what? It's better you put too. So this way is easier to differentiate the 1st 1 in the 2nd 1 So this is a to and I want to give it another extra one game to get one gig in click create. So it has created two discs. So basically what we're doing here is we are combining Oracle data. Sorry. Data Oracle with or Data Oracle too. So that is done. Now click. OK, go ahead a hit. Power on or start. Okay, so we have logged into our links machine. Go ahead and become route. Now, let's run the DF minus age command and the dis space or the petition that we're trying to extend Is this right here? So if you look at it right now, this petition is mounted on slash Oracle and that this size is 997 which is, like one gig. Use history, dream eight and available. It's 9 65 Now we are assuming that right now the usage is instead of four. It's 100%. So once we gonna add additional this space to it instead of 997 megabytes will become too gay. So let's go to our command at desk slash l. That's piping tomb or and let's see, what are the disk we have available? De s t A. Which is the root disk. Very did Insulation. STB is where we did. We created our ah data disk. Then we have S d C, which is the Oracle disk that we used. So now we should also have the new one, which we just created with the label S d d. Let's see. Hit, Enter. See you here. You just have to be very careful because sometimes it throws so much information on the screen you can really see where your diskettes anyway. So that's the disc S d d. This is our new desk with one gigs and are we gonna do we gonna petition that disk the same way every petition, any of the disc whenever we create a new one. So to petition that disk, you run f disk slash dev shares s d d. And this is going to be your new diskette and end for new P for primary disk hit, enter for default or just hit one. Whatever you like it 20 48 or just hit. Enter to default. Hit. Enter again for default value people petition will see right here it is empty. As soon as I assigned e to it, it will see Lennox L V m so hit t again and elegant. And you see, this is a list of all the available for all types of he could assign to it. So we just pick eight. He again for legs L v m hit. Enter again. And now you'll see Lennox L V m. This is the system that's using its, ah, type of while it's gonna be assigning it to now you hit w two. Um, create that petition so that petition is created. The petition is S d d one. You could do F disk again. Hit l and do pipe it to more and you will see STD one. So right here. STD one. It is created. Perfect. All right, So now you could just reboot the system real quick, so it is updated to in the system again. Okay, Once you have your system back online, you go long back in and become route. Do a disk, my cell again. And this time, just type depth, STD one. Just to make sure it's there, it's there. Now it's time to extend the false system slash their slash mapper slash oracle BG dash, Oracle underscore Elway You're extending this one so the fall system gets bigger. So first we do PV display. This will show us, um, which group is associated with which disk. So our concern is right here. This one s d. C. One and it is associated with a group Arkle slash weegee. You could also run PDS. It will also give you the same pretty much the same information this disk is associated with this group. So you want to add a new disk within this group and once we add that new disc that we created s DD, then we'll extend the group and we'll extend the logical volume as well. So, um, let's do BG display and let's do on our oracle underscore VG. This is our group, so you'll see. It also tells you the volume group size is worth 10 20 megabyte, which again, of course, is one gig. So now let's create physical volumes. OPV create slash dev slash s d d one because we always have to create physical volume. So it is successfully created. Now we do the G extend you're extending the group with which is a group name, Oracle V G. And we are associating that two s slash s sorry, Deb s d d one. Okay, so now it is extended with that disk petition, because if you just save e g extend Oracle underscore V G, it will say, Hey, I I will extend it. That's fine. But which disk I should leverage on or step on or include that discover than me to extend. So you have to define that the disk is slash dev slash as d d one. Okay, so now that is done. Now, let's do logical volume extent. So logical, William extent is right here. So you have to specify the size, which is the commander's my cell on plus the size. So +10 to 4, which is one gig to just put Meg here. And then you specify Dev mapper, um which is right here. What I would do is I just move that go up to our F disk command and I'll just copy this entire thing so it won't make a mistake because this is the logical volume that eventually want to extend. And now we come down and paste it right here. Okay, so now we have extended and it says logical volume Oracle underscore VG oracle on the school LV successfully resized. Awesome. Let's extend the file system and the command to extend the follow system is X f s underscore gro file system and then you paste hit her and that should grow your file system . Um, DF minus h And now you will see slash dev slash mapper underscore v G two Gig 33 Arkle is now two gig. Remember we had it. One gig now is too big. That's how you extend a false system. Once you extended, you go back to your oracle guy, tell him you have added a new stories to your existing mom Point. You did not have to create slash Oracle to
164. Add Swap Space: Hi. This topic is about adding or extending swap space. Now, what exactly swap space is are swappers. So, according to sent O Estado orig, suave space in the next is used when the amount off physical memory ram is full. If the system needs more memory, resource is and the ram is full. Enacted pages and memory are moved to the swap space. While swaths based can help machines with small amount of RAM, it should not be considered as a replacement for more. RAM. Swap space is located on hard drives, which have a slower access time, then physical memory. So this is a very easy and straightforward definition off a swap. In my own words, I would say every machine has a memory right. It comes with a memory. One. Get 10 gig up, whichever the number off memory that you have in your laptop when you run out of memory. Then there is a way that you could add a virtual memory to it, which is not like a physical real memory. It's abortion memory that comes from your hard drive. So in that virtual memory and Microsoft Windows environment is called Forster Memory in the next environment is called Schlapp, so the recommended swap space by the operating system. It's twice the size of RAM, which means, like, let's say, if you have to dig off physical memory in your system, then you should have a two gig of swap space. So the the idea is, or the formula is if m is less than two, by the way, AM is let's let's take an example of em equal tomorrow off RAM and gigabytes s is the models to our space and kick a bite. So if m, which is the ram, is less than two gig, then the size of swap, which is S is with memory times two else swap would be memory plus two. So that's a general rule of thumb. Um, the commands that we will be using to extend the swab space R D D to create a file, make swap so up on our swap off. So let's do that by logging into our machine on Lenox Terminal and see how the small space works. My terminal opened the Lennox Council Koolwijk. Now, before we get into a swap, I want you to run DF minus H command and in this command, you will see you'll get then tired this space partition, right? Your file system has a total size off 10 gig, so eight gig is assigned to root. One gig is assigned to boot. So that is nine. So where the one get go So that one gig is actually assigned to swap space. So that's what base, plus the one gig is its own physical memory. So if you add these up for 84 96 4 96 4 96 and thes 200 100 all of these six of them and you're gonna add them, it's gonna equal to two gig now, why two gig? The reasons why it's too big is because one gig is actually the physical memory. We actually allocated that physical memory when you were actually creating a virtual machine and the one giggle swap was automatically created and we built the Lennox operating system. So that's why we only have eight gig care left. So when you run free minus M, that's a command. To check how much memory we have, you will see the memory. This is a physical memory. We have a one gig which is estimated numbers uses to 56 Freeze 81. The swap, which was added during installation, is tens 23 which is also equal to one gig, 25 as use, and this is a free space. Now we are assuming here that this swap space right here and this memory they are reaching almost full. They're getting full. They're all the utilization is almost 100% now. How can we extend or add more sauce base? Well, one way Is that you again? If you have a physical system, you could add a new memory dim to your system. A dim is is actually a physical, uh, slice off memory, so you could add that to increase more memory. If it's a virtual machine, you could actually power down your machine and increase diversion memory. That's perfect. But what if you do not have those options available? Then what you could do is you could slice some off that disc from your disk drive and use it for swap. So let's say if I wanted to increase the size of this walk, which is 1 to 10 to three, and I want to add another one gig. So how it's gonna work First, I have to take one gig. Let's say I want to add one more. Get to it. So I wanted to take one gig from my Dace base and dedicate that to swell. So to do that, I have to run the command, De de. By the way, to run that command, I have to be ruled, so become route. Okay, Now the command is d d space. If equal sign de zero space o f equal sign slash new swap. Now, this is the name that I'm picking if you could pick any name and I'm putting it in under slash So this is the name of the file. Be s means the size, the bite, size one, Meg and account equal 10 to 4. Now, let me explain you this command how it works. Most of the time you would have to write this command, as is why it is written like that. Well, that's how it is. It is what it is. That's what usually people say. So to explain your DD is just a command toe. Create a new file if it stands for read from filed instead of standard input, which is Deb zero. You have to have the spite default off meanings. Write to a file instead of standard output. So you're going to write everything about your virtual pages. In this file, B s means read and write by types at a time. So and the count is the total size of the file, Of course. So when you hit enter this should create a file with the size one gig. See, you have information coming here is records in records out and the file sizes create 1.1 gig, which is, of course, approximately one game. So let's go to a CD slash and do ls minus. Lt are, and you will see right here. This is our new fall that is created. Okay, now, when One thing you should be wondering, Hey, why we cannot create that fall just with the touch command. Well, that's a very question. Was touch command creates an empty file. You don't want to assign an empty file just dropped right? You want to take away some chunk from your disk and dedicated to that swamp? And how do you do that? You would have to use a DD command. That's why you cannot use touch anyway. So now you see, this new space file has been created. The second step is to just the permissions. You don't want to allow people to read that file. You don't want to allow others. And sorry group and other Serie de file. Um, the owner, which is ruled, read and write is Okay, So to do that, you have to do change my the group and other minus or you swap. Now, this should take away to read and greed for group and from others. Another way you could have done is by changed mod 600 then the name of the file, which would perform the same function anyway. So the correct permissions have been assigned perfect now to make swap. What do you want it to do with this file? Now it's just a empty is just a file that that is holding a space from the disk and that space from the disk is one gig. So what you wanted to do with that, right? So let's makes swaps to command. To do that is M K swap space, Neil. So up hit, Enter and this will tell you setting up a swab space version one size this in the ad label . No label Usual I D and give you some information about the news. So now run free minus m to see if it's this new swap is added. No, it's not added. Why? Because you have to enable or turn on the swap. So the swap You're telling this operating system that this is a file and this father be used for swap right? You created a file system, which is make swap. But now what do you want to do with that? You wanted to give it to swap. So type the command swap on new Stop it enter and this should add the swap space to said Now Deuce free minus M and you will see now the fall. The size of the swap has increased before. It was 10 to 3, and now it's 20 for seven. If you want to have the swap space be enabled during boot time, you would have to specify that file in the eye and at sea. First fall, you'll go into the file and then you come down all the way and put a new line. I put new swab space deposits anti. We just swap. That's sorry. Where is it gonna mounted to swab were not mounting. It is just a swab. What type of file system is that? It is a swap again. Defaults 00 had escaped and see the felt. Be very careful with that Sief Fs tab. If you make a mistake, you will. Your system will not boot up, so make sure you type in correctly check it a couple of times before you go and report your system. Now you could go and rebuild your system and you could verify that your swap will be added again at your boot time. So this is how you create us for up space. Tried out with different values. And this will be very helpful in corporate environment. When you grown out of memory
165. Advance Storage Management with Stratis: Hey everyone. In this video we are going to learn how we could implement a vast storage features in a Linux system. Red Hat 8 introduces the next-generation volume management solution called stratus. Of course, that same feature or that same solution is available in Santos 8 as well. It uses thin provisioning by default. Now by the way, if you are using Red Hat or santos Seven, this feature is also available in santos 7.5 and later. The stratus combines the process of creating logical volume management, LLVM, and the creation of file system into one single management in LLVM. Let's compare it with the LVN in LLVM. If a file system gets full, you will have to extend it manually. Well, whereas in stratus, it extends the file system automatically if it has available space in its poor. So in LLVM, we have a volume group. So when the volume group, let's say have 20 gig and your file system has 10 gig and it gets full, then you could actually go in and run the command LV extended to extend their file system. So, but in stratus, it has made it a lot easier that as the file system grows, it will grow automatically. You don't have to do nothing. So in this lesson, we will learn how to manage multiple storage layers using stratus local storage management. Okay, so here we have LLVM. In LLVM, if you notice the first on the left side, we have these physical disk. So in my example, you have, for example, this two, there's three, there's four, there's five as many desk you have. Then what you do is you combine all those desk and then you create a volume group. With that volume group created it. Then you go ahead and create a logical volumes. With the logical volumes you create file system off of each a logical volume and mouth those file system, right? Well, in stratus, you have all those disks. Same way as you have an LLVM, you combine them and you put them in a pool. For example, if you have a pool, these three get three disks that we see on the left-hand side. Let's say if they have 10 gig each. So we combine them, we create a pool of 30 gig. And then on top of that, we could simply create a file system, starting with, for example, 10 gig. Now, as we are adding Spacewar file system and just keep growing and growing. And when it hits ten gig and needs, for example, another one giga, Two gig, it will automatically extend that. You don't have to go in and run LLVM extend command or anything. Any manual process is needed. It will automatically extended up to this size of that pole, which is in our case 30 gig. All right, move on to actual workshop. So to install the stratus package, we will have to run command yum or DNF installed stratus dash CLI, and another package, stratus D, which is the demon. Then we will enable and start the service. Then we will add it to five gigabyte new disk from our virtualization software, verified at the OS level. So to do that, we have, we are using Oracle virtualization software layer and we'll create two new desks. We'll check that with the listing. By listing the block disks. Then we'll create a new stress poor and verify it. And then we will go through extending our poll by adding the second disk. First, we'll create the pool of 15 gig, then we add the next one, which is another five. Good. All right, so first thing first, let's go ahead and install our stratus packages that are needed to manage it chemically the screen. So the very first thing we have to do is install the package. So we'll do DNF or geom. I would prefer that you do DNF so you could get used to it because DNA is going to replace Yom eventually install stratus dash CLI. This is the command line that you would need. And the demon stratus. D minus y, meaning install all the dependency packages. Just don't ask me, just simply go ahead and install them all. But of course before you run that, make sure your system has never connectivity because it's going to go online under repositories and download those packages. Okay, that's pretty much it was quick and the download and installation of these packages have been completed. You can verify by running the command RPM def keyword, and a grep for stratus. Alright, it is there, sure, as DES their entry iris dash CLI, is there. Beautiful. Now let's go ahead and enable the strata service. So for that we will use system CTL enable so it could start a boot time and do stratus D. Check the status and it is loaded and inactive. Now we need to start the service. Services storage, check the status again to make sure the service is loaded, active and running and it is. Okay, good. So we got the required packages and services up. Now next thing is now we need to add a two new desk through virtualization into this virtual box. Okay, Here we will go into Settings. Okay, there is one thing before you go into setting, what I want you to do is I want you to create a snapshot. So in case you do some kind of misconfiguration, you could revert back to your snapshot to fix what was done wrong. So click, click on snapshot and click Take Snapshot, name the snapshot, whatever that you not want to do. Snapshot, for example, before stratus, click OK. Ok. The snapshot is done. Now, in order to add the storage to your Linux machine, you have to power off your Linux machine. So go ahead and simply click on X and make sure you uncheck the restore state and simply power of the machine. All right, So machine has been powered off. You could see right here it says powered off. Now you go to settings, Storage. Click on the Control or SATA where you have your main primary desk. You might see different desk names depending on your system, you might see couple of different other disk that were carved out earlier for LLVM practice anyway, go ahead and click on right here. Disc adds new storage attachment and hard disk. And here I want you to click on Create VDI virtual Box Disk Image. Click Next. Dynamically allocate, leave that as is. And I want you to pick five and click Create. Same thing, create another one. Sorry. Create VDI, same process. And click F5. Okay, So make sure you choose this one that is added and 12 is added. You need to add the second one again. Click here again, and right here. I'm sorry, we picked two. Now we need to pick three. So both of them are at it. Perfect. Just make sure it's right. Size five gig file, get. Awesome. Now go ahead and start your virtual machine. Okay. So verify those two disc has been added by running the command ls list block device. And you'll see right here as dB for five gig SDC, 45 gig had been added. Okay, so now we're going to create new stratus pool and verify it. So for that you run the command stratus pool. Create the name of the pool will just picking pool one and the device Deb as dB. And that's pretty much it. And hit enter. Okay, you've got your prom back and verify that you got your pool creative strategy pool list. And here you have the list. Okay, so you got your pool created. Your pool name is right here, the size is right here, and the physical size is right here. Okay, now, what we need to do is we need to extend our pool, meaning being wide to add this SDC. Into this pool port that will do stratus pool. Add dash data, which pool we adding tuple 1 and which device as DC. All right, now verified by running the stratus pool list. And you will see it will show up right here as ten gigs. So now our pool has been extended to 10 gig. All right, moving on to the next slide, we will create a new file system using stratus. Create a directory for mount point and mount file system. Create a snapshot for your file system and add an entry to FS tab. All right, Going back end. So let's create a new file system now. So let's clear the screen and type stratus file system. Create hole 1 and fs one. So I just picked the name of the file system. You could pick any name you like. What did I do wrong? My stratus command is wrong. Okay. Serratus file system create pool one, fs one. Now let's verify it. If that file system is created successfully, file system list. All right. It did at the pool is right here, the file system is here and the file system size is 546, which means first path system. We'll start with 546 because it does the thin provisioning. It always going to start with that. And it will grow as you are adding more data to your file system. Now it's time to create a directory so we could mount this file system to a directory. So I'm going to choose a name. Big data as the name of the directory. Hit Enter. Now mount the file system stratus. Okay, Sorry I missing in my slide, I'm missing Deb here. So you could just put the dev stratus. Who'll one, fs one. Because if you notice right here, this is the actual device. I skipped the dev directory. Anyway, you should not skip it because if you are following me as exactly what I'm doing, now, we have that mount. Now where are we going to mount that? We're going to mount it to big data, which is the directory that we created. It error. Perfect. Now let's check if it is mounted LSB, LK list block devices. And you're going to notice right here is his big data, big data. It is going to show you a couple of times, three times. It's just a house status. Create a record of its file system mount. You can also do df minus h command to see where your file system is mounted right here. This is your stratus file system. It is thin provisioning as you can see, and its size is one terabyte and it is mounted on big data. Now, you're probably thinking, hey, isn't that supposed to be 10 gigabytes, one terabyte? Well, by default in the code of the stratus, that's how it's built. It will all, it will always show you as a one terabyte. So you could just simply ignore that. But if you wanted to know the actual size, you can always run stratus file system list, and it will give you the actual size that is being used. All right, next thing is, we could create snapshots of our file system. And the command for that is stratus file system, snapshot, pool name and file system, which is fs one. And what do you want it to name? The file system and you're going to create a snapshot. So for me I'm just going to create fs one dash Snap. All right, so it could take some time, but again, it depends on the size of your file system. Our file system size is 10 gig, so it shouldn't take that long to create a new snap of that file system. There you go, It's done. Let's verify it by running stratas file system list. And now you're going to see two file system. One is fs 11. One snap. You see it's become so easier in case you are doing some data data warehousing and you want to create a copy of your entire file system, that's the best way to go about it. Now the last thing that we have to do, which I'm just going to show you right here on the slide is if you want to add that entry into FCFS tab in case you want this PA system to be mounted at boot time. And for that you have to do the usual ID equal the UID off the file system, which is right here. This is the UID you could get and slashed fs one space accept Fest, which is the file system type, the defaults, and then you have to put in these parameters in x dash system, d dot requires equal stratus d dot service, which basically is telling FS tab that do not mount this file system unless the system starts this stratus D demon. And then pretty much the same default options at the end of which is 0 texture. So that's how you go about doing implementing the advanced storage feature using stratus.
166. RAID: Let's go over the raid. What exactly a raid is? A raid stands for redundant array off independent disks or sometimes all often referred to as inexpensive disk and raid. Why do we need raid? Well, to create a redundancy, meaning if one disc dies, you have another desk, right? You don't want to lose your data if one the fun of your primary disguise. So that's the primary reason we have raid. And there are different type of rates. The main ones that you will cover in this lessons are three rates raid 01 and five. And how do they work? Let's go over them. In raid zero, you have one disc. That is, let's say, five kick. You add another disc that becomes 10 gig. So you put them together and that five plus five becomes 10. Gig, right. Perfect. So you are writing to both disc one. And here, when they're its going across, is faster, of course. But what happens if you lose one disc? Well, you're out of luck. Why? Because you have lost all your data. So there is most of the time. Raid zero is used for, um, like data warehousing or backups that you really, really gonna use. So things like that. So you do need to add a couple of disk physical disk together to make one big disk. That's how rate want. Zero is mostly used. Let's talk about raid one that will eliminate the disadvantage of raid zero where we lose one disk and then you're out of luck. In raid one, you have one disk, and then you have another desk. But you mirrored them together. Meaning, if you have five gig off space on one, you have to have five. Give another one. But that does not mean you have. You're gonna have 10 get together because you're not adding them together you have mirroring, mirroring them together. So if you lose one desk, that's fine. You still get the get your data from the other disk. But there is another disadvantages to raid one, and that is slow. There it is slow because it has to, um, replicate everything from one days to another so that some sometime gets are slow readings , little rights, then to solve. All these problems are on zero and one. What do we do then? 01 has, uh, uh we have arrested lose date as your raid one. We have slow reading, right. So we come up with Raid five in raid five. You have one disk, right? Then you have another disc. But this time you don't just add to it. You actually copy everything to a 2nd 1 as well. But in raid five, you have to have three or more disks. Why? Because the way the way rate fireworks is, it will write to the first disc. And it will put some information about that data to the second disc. It will write to the second this, and it will put some off that information that it's has written to the third disc. And it goes around like a round robin like that. So, in case you lose one desk doesn't matter if it's the 1st 2nd 3rd you will have the information off the lost data on one of the disk that you still have. That's how you create rate five. But in this case, you're not gonna have, like, 555 15 because you have to write some off the desk information. That's parity to some other desk as well. So they say you could retrieve that information. So in order to put that information somewhere, it needs to reserve that space for it. And that's why we get out of it, like 12 with their team gig of space. So that's how raid works. And the reason I I am covering raid. And this training is because that's one of the where basic questions often been asked during interviews and as a system administrator. When you do become a system administrator in Lenox Environment, you will have to create raid at a hardware level. When you have a silver coming into your corporate environment, you would have to configure a rate. And the difference between the primary difference between grade and L V. M is that raid is mostly configured on the physical system, physical servers and sorry, not physical physical disks, whereas L. V. M is mostly configured on a virtual or logical disks. So that's a primary difference. So please remember it. If you want to learn more about other rates, I would encourage you to go online and find out about other rates
167. File System Check: file system check. There are two type of commands that you could use to prepare your file system. The main one which has been there and still there for years, is FSC cape. This command has been always used, starting from Gen X Era and Solaris moving onto Lennox. And then there is another commander was introduced. X fs underscore repair xfx file system or accept First underscore Repair Command is used for fall system that are built on except fest file type. So Lennox F SCK utility is used to check and repair Lennox file system, and those linens file system specifically are e x t two e 63 64 so on. So this utility once again is on Lee used for file system that are built on extension 234 or any other related file system. Lennox X fs underscore Repair utility is used to check and repair Lennox policies and for except fest file system type, as I mentioned earlier. So there, when you how do you check if ah, file system is except us or extension three file system. You're on D of command, I believe, with the option minus T, which tells you the linens, facets, some type then, depending on when was the last time Ah, file system was checked. The system runs the FSC K during boot. Time to check whether the file system is inconsistent state. So every time your system boots up by default, it does the FSC Kate check. And if they are any inconsistency, any corruption in the file system, it actually fixes that. And sometimes you probably see even system boats up. It takes a longer time to boot up because FSC K might find some of the disc error so it tries to fix it before it actually brings you into the operating system. Prompt Mo. Then system demonstrator could also run it manually when there is a problem with the file system. So if you get in Arab messages in war long messages or in Io state or any of the command that you run and that you do find said file system or one of the pile system, um on on your system is corrupted, then you could run the FCK command manually. You don't have to wait for the system for re boot to run it, to make sure to execute FSC Cake Command on an UNM ound did file system to avoid any data corruption issues. So that's what you have to make sure that it is not mapped to any map drives. So remember when you do DF mines H command and you will see on the left hand side, you'll see all the mounts. And on the right hand side, you'll see all the mount points. I'm sorry. In the left hand side, you see the file systems that it's slash dev slash sda one Oresteia too. And on the right hand side, all the way to the right. You see the mount points where it's mounted to. So before you run FSC kr any of those file system make sure unm mount. Hey, how about I need to run it on slash route? Then how can I ungrounded, right? That's a good question. Well, the answer is you can't There is no way that you amounted. Your only the only way to do it is that you rebooted or are bring the system and single user mode or bring the system in recovery mode and mounted on the desk and then do f ck on your original pilot system, which is root but gets a little complicated as you actually bring the systems. English is a mode and how you do fck now continuing lawn force file system check even if it's clean using option F If you wanted to do a false system check and it is already clean , but you still want to run it than yours minus F auction, why do you want to even clean it when it's already clean? Some people do like to keep it consistent if they are going through houses and check off every file system than they might do, Um, an entire file system. Because if you have a different partitions on your desk and you want to clean every petition and perhaps maybe one of the petition is clean so it will tell you Hey, this petition, please, I'm not gonna do it. So instead of just, you know, going through back and poured and see which system or a petition is cleaned, then use just mindset option, which was clean. Everything okay? Attempt to fix detective problems automatically. Who's using option? Why? What why Means is if you are doing fck file system and then you use minus y option with that, then it's not going to bother you with questions like, Hey, is it okay if I go ahead and clean it? Hey, I found this problem, and these bad blocks is okay if I proceed So these that type of the things that you specify or pre define before running this script before running the command. So it's just like as if you were doing Yemen stole and it will ask you question Hey, I found thes package. Do you want me to install And you say my sweat. But if you do not want to have, ah, enter, why all the time? Then you could just specify minus why would that the X fs repair utility is highly scalable and is designed to repair even very large file system with many I know deficiencies, Unlike other links file system except best underscore repaired does not run at boot time. Okay, so the difference primarily is between fs Ikea and accept asses, except vous file system is was introduced for larger partition like terabytes, petabytes. So that's why they came up with ex effects and the reason we don't run this utility at boot time because, of course, it does. Check or clean up on the follow system, which is very large, and you don't want to wait for it to finish checking your father before you get into our bring system. That's why it doesn't do it at Bhutan. If you do have issues than you could run Mannelly. But bring this system into single user mode or, if it's not true, petition, then you could simply wanted by a mounting it and running it. The following are the possible exit codes for FSC kickem it and those exit codes are zero for no errors, meaning when you run the command and you get an output status or exit code zero, that means there are no errors. And to check the exit code, you could always run echo, dollar and question mark right after running your command. Then you will get the exit coat. So zero of course. No errors. All successful Number one as file system errors corrected. Number two Fars system should be rebooted for file system errors left uncorrected 8 16 32 and soul. And of course, you could look it up. More errors online if you like to get into more detail off how the exit codes are, What are each error? Code meat. And I'm sure you don't want to get into too much detail because, um, not all the time you will get the error codes, but that So let's get into our Lennox machine. And let's try to see if it could run a classic yawn. Few off the, um, file system. I have my Lennox machine open right here, and I logged into my position. Um, I'm logged in its myself. I am in my home directory and system I'm logged in is my system, which is my lab system. My first let Xbm Perfect. Now, now type clear to clear the screen. Now, how do you check the file system? You know, DF minus H. So what I was talking about This is a false system on the left hand side. All this under left column if you want. If you just left column, you could talk print taller one right, And it will only give you the first call. Now the second column size. What is the capacity used? What is available? The percentage and the last column is mounted on So if you want to correct any inconsistency on a file system you do not correct. You do not run f ck on the mounted file system. You know, you do not run like, let's say, on data or Oracle, you run on the actual file system, but before you're on it, you need to pick which utility you have to use to do the file system check. And the utility depends on the file system type. How do you find a false system? Type is by running DF minus t command uppercase T, and you will see the type right here tells you except fous except pus. Except this except Miss. Now, since we are running our latest version off, Red had, um, most of the pile system that are and to do, used in the latest version of Red Hat or Santo West. Our exit fous. If you are working on older version, operate hat, then you probably going to see e x t 234 and so on. And then you could use the command FSC K on e X T fall system. But since now we're using except fest Kuala system, we need to run the X fs underscore repair utility. But anyway, just to find out or verified, um, that's run r F s e k command on one of the Paul system. Let's say if you run it on this one, Deb S d the one enter and you will see if you wish. First off, fck from utility the next. This is a version. Tennis is if you wish to check the consistency off xfx file system or repaired or damage file system C X, if s and a score repair because when you ran it, it found out Hey, this file system is not txt file system. It's except fest fall system. That's why it has given you the option or the suggestion to run this one. Okay, we'll run that one. X fs underscore repair. Now we'll specify the follow system. S d B one hit enter. Okay, now what does it say? It say's except fester appear. I ran it. I ran it on your follow system, the one that you asked me to run, but it contains a mounted file system. Second message contains a mounted and rideable file system. Fatal error could not initialize except fest library okay. And that's why because this file system is mounted on slash data. So for me to run xfx underscore repair utility on this file system, I have to unm ound this fall system from this mount point. And to do that, I have to do jiu mt slash data simply that hit enter and it says you moan slash data unmindful operation not permitted. Why? Because who am I? I am I also and for for this operation to be successful, I have to be a route. Okay, who am I? I'm route. That's two DF minus t and you'll see all the file system. Now let's do you mount slash data. Remember, you have to mount that ball system again. So before you Mount unm mounted, you have to make sure copy that somewhere. So you don't forget. So you mount data it has you mounted it. Let's verify DF minus T and you'll see there is no file system Dev STB one and north slash data. Perfect. Now we could do, except that's underscore repair Sash Deb STB one right. It was this force, the one it was mounted on data, so that's were on it and it ran so fast. Even though it's two Gig of space, If you notice right here, this one slash data is only two gig and then you ran it. You see? It's his face one. Fine. And verify Super block using internal log zero scan file system space, Long route. I know, Chunk. So on. So on Phase three face for check. For duplicate blocks, face five. Rebuild A G headers and trees six. Check. I know connectivity seven birth and correct. Glink counts and last has done so. It means it ran successfully. And how do you check the status? You do echo dollar question mark and came up zero. It means it. The commander I ran proceeding this command that command was successful. And remember our exit code right here. It says zero is no error. So our command ran perfectly. It actually fixed any issue if there were So now, um, the repair is done. Now. We could mount the follow system back on. And I'm sure you have written and down which Wallace's Have you amounted to mount it back again, you have to use a command mount slash dev slash S d B one this is a file system. And where are you trying to mounted? You're trying to mount it to sash data and hit Enter. When you get your prom back, it means it did mount. And now you do DF minus h it better and you will see the bottom one. Active slash STB one is mounted on slash data. So this is the lesson about these two utilities? Very important. Both of them are very important utilities, and they become very handy when you're fall system is corrupted, then to fix it. You what? I of course, you could either open the case with your lender, which is Red Hatter sent to us. What works? But if a cento us, you're not gonna get support. And if anyway, if any other linens follow system, I would say you you could be your own system administrator support guy who go fix it yourself so you could run FCK or accept s inter school repair and fix your file system and bring the system back online within minutes. Try it out. Ah, just be careful. This utility is very powerful. I don't want you to corrupt your, um, file system. It's better if you could actually do a snapshot of your machine. But anyway, if you have not done it and it's too late and you following me exactly as I'm running it and everything came out fine, Perfect. If not, if you are having issues, it's okay. Feel through it, free to send me an email, and I'll try to help you out.
168. System Backup: system backups. There are many different ways yet is you could do system your your system back up. But one particular way that I wanted to cover in this lesson is through the D D Command. DD Command comes, um, all the way doing beginning when they started doing the backups on tapes. So that's when they would run the D D command. So basically, there are five different type off backups in every system. The first type of backup is the actual entire system. Back where you take the entire image, using tools like 1/3 party tools, people have bill 30 party tools and such as a Chronis vehn, com wolf and many other different software out there. One of them is also that I worked in the past was net back up. So just like that, there are so many software people have built and sell to the companies that allow them to perform system backups, and that is to again to create entire system back up and put it like an image just like an ice open entire system. And whenever there's a need, it does the restore off everything and put it into the same existing system if it has crashed or to a new assist. The second type of backup is the application back application. Backup is. Are the ones like you have your Lennox machine running right or even Windows Machine running? That's operating system. But use Use that operating system to have some kind of application. Install on it right again. As I said in with the very beginning, that purpose of the hardware is to have the pumping system on it, and the purpose of having operating system is to run certain applications. So that's the primary reason we all use the computers. So anyway, the second type of backup are the application backups. Anytime any application that you're running the system, so too do the back up off the application. Most of the people use the third party application solutions. Then we have the database back. So if your system is running any kind of database, for example, Oracle oh, rescue well or Informix? Ah, most of these companies who actually deal with database or provide databases also provide backup solution for that database. For example, Oracle has a solution called data. Gord and SQL would have ah solution for SQL back of dust the back up of the entire database . Now, remember, this is not the backup off your file system or even if your system this is a backup on Lee . The data that is being generated by the application running on your system. Okay, so the fourth type of backup is the file system. Back the file system. Back up, meaning, backing up your files, your folders, your direct trees. And you could use the commands for those type of backup. And those commands could be like tar Jesus to compress it compressed entire directory. And then you could Once you have it back up with the tar ball, you could actually trash for it to another machine or copy it to a remote machine. So in case you need to restore your file or directory, you could go back to the tar ball and extract it from that sip file. Now, you could use them manually as a mental process to torrid and transfer to another system. If you do not have a professional, 1/3 party products to do that for you. If you do have 1/3 party backup software than most likely those third party backups offer would also let you do the follow system back the fifth type of back, which is the main concern for this lesson, is the disk backup or doing a disk cloning using the D D Command? What is a disk backup or disk? Cloning? Well, um, if you think off it as if you have a desk right, that's it. Just a physical disk. And it is, let's say, 146 gig off disk. And it has all the data inside file system, partition or whatever. When you use the DD command, you could actually copy or clone the entire disc and clone it toe another desk. Now, keep one thing in mind. The D D Command does not know what's inside off that clone or what the file looks like it would be. Even if you try to open that file, it will be just a garbage. You won't see anything, so it actually does. The file does the backup off your entire disk and put it in some kind of image. It either just im ich file or I so file and exactly takes that exactly the disk copy or image or snap off your disk and put it and slap it on another desk. So this is what we're gonna do in this lesson. So D. D is a command line. Utilities for UNIX and UNIX, like operating systems, was primary purpose is Dukan bird and copy files. As a result, DD can be used for tax, such as backing up the boot sector off a hard drive and obtaining a fix amount of random data moving on to back up or clone an entire disc to another hard disk connected to the same system. Execute the DD command as shown below, and the command is D D. If equal the source final aim. If you have a source partition or a source disc to which in this case, we don't use the two years off equal target filing, which could be the file name itself or the disc or the disposition. And then you could also use different options that are available with Dede Command as an example. If you see right here, it looks like this DD if equals slash dev slash sda Off step STB. What this is doing right here is it's copping right here. Is copying the entire desk, not the petition copping the entire disc, which is as d A. And Asi slapping it are putting that entire image on as D. B. But also keep in mind if you are copping SDA, which is too big and copying it or STB, which is one gig, then it's of course is not gonna work. Make sure the SDA NSTP both have the exact same size disks to copy back up the disputation . Now we're talking about petition. You know, each disc could have multiple partitions. You could use a command like Dede if Dev SD one and copy a too and a disc or a false system using, um, the name of the file. We could use the name as SD one dot image now to do the restore restoring this image file to other machine after copping that I am G meaning if you already have does command ran and you already copied this entire petition and you copied it and named it on sda one dot i am g and you put it in slash ruled. Now, once that copy or D d cloning process is done, you could take this image and transfer over to another machine. If you wanted to copy the entire content once it's transferred over to another machine and you go Khurana command on the destination machine as D D. If it's actually as D one, and you could put it on STB three or four or whichever petition that you want to put that Paul system on So that's how the DD command works. Let's try it out. Um, practically how it looks like on our Lennox machine. Okay, so I had I'm logged in as myself. I am in fruit directory and I am in the correct, um so, uh, to run the DD command, you will have to be route. Okay, so in my example, that CD a minus h Let's say, if I wanted to copy let's say this slash boot, which is about us. The sizes. One gig. I want a copy. This partition to, um, another disc, which is STB one slash data. So what I could do is dd if sorry, if equal s t a one to I will copy or two data because I'm doing the petition. I'm not copping the disk to disk. So if I were to copy disk to disk. I would do Dev sda So yes, DB one. So this is copping petition to partition. Sorry. If I'm copping disk to disk, I'll take out the one. I'll take another one here. Anyway, I'm copping petition to follow system, which is data, and I want to call it. Ah, poor too dark. I m g said this The image off the Bootle am G hit. Enter. Okay. It's his unrecognized from India. Um Oh, See, I missed one thing I did not specify off equal. It's okay. It happens. You and people like me make mistakes. That's fine. Okay, so hit head are now. Okay, Now you see, it is actually working, and the reason it's working is because you did not get an error message right away. Now, depending on size off your source, um, the size of my sources. You see, here there's uses 1 57 and a size is one A 14 Now you're probably thinking, Hey, this partition is on. Lee has won 57 Meg. And why is taking that long? Well, and you do D d command it does not care what is used in what is available it on. Lee looks for the size, which is this, and it thinks that this is the complete size. And I'm gonna copy this size exactly as this as you could see. Right here says this is a size 1.1. Get copied. See? It does it. It doesn't care what is used in what is not used. It thinks off it as, Oh, I'm going to take a snapshot of this entire desk, and that's it. Now it did copy it. Now, let's verified because it copied it to it's ash data. Sash boot image you enter, You'll see. This is the size is the copy. Now you have a copy off your boot. Now, in case something goes wrong to your system or your sash boots file system gets corrupted, you could actually do this and restore here. And to do the restore, you would have to do D D if equal data slash boot image. Where to Deb S t A one. That's how you would do it. But I do not want to do it. I don't want to, um, mess up my system right now. It's just a lab. But, you know, I'm gonna recommend you to try on your on your production system as well. But if your system is down, then that's how you will recover your false system. But you could. What you could do is, well, you could try to do that to another file system. If you have ah, file system, that is not that is just used for testing anyway. So this is how the D D command works. And this is how the DD command is used to perform system back up to do the disk, copying or disclosing again. I'll go back real quick to my previous slide. There are five different type off backups, and that is something that you should know. What are the different type of backups on how backups are performed?
169. Network File System NFS: network file system, which is also stands for NFS. This is one off the biggest and major topics, and I am including this lesson in our in our module off disks because it is actually about sharing your disk or sharing your directory or sharing your files with other computers and other users. So network file system, as I have explained you previously, there are different type of file system, like E x t two, txt three X fs and TFS and Windows are F A T fat file system. That's all. Turn windows just like that. There is another file system that is called network file system. Now this file system again, it's not local to your computer. Um, it's called Nass, which is also a network attached storage. So NFS is part is one of the protocol is part off Nass. So let's see. NFS stands for network file system Ah, file system developed by Sun Microsystems. Sun Microsystems. A few guys don't know this. This was a company who actually had ah, one of the biggest operating system called Solaris. That Solaris operating system, um, runs on UNIX environment, and it still exists. But now Sun Microsystems is being bought out by Oracle anyway, Our focus is not son or Oracle. Our focus is NFS, which is one of the Lennox organic services to share your file system between servers. Now it is a client server system that allows users to access files across a network and treat them as if they resided in a local file directory. It's just that simple. When you mounted from one system to another, the other system will see it as if it actually mounted locally on its own system. Now, for example, if you were using a computer links to a second computer via NFS, you could access files on the second computer as if they're resided in a directory on the first computer. This is accomplished through the process of exporting. So you export from the server that is sharing the follow system the process by which an NFS server provides room or clients the access to its files and mounting the process by Rich Client, which is the other computer. The other end climb map NFS sheared file system. So this is how basically NFS works and I hope you understand. If you do not understand and you still confuse what NFS is. Please, don't worry. I'm here. Don't worry about it. I will take you every step, step of the way, and I will show you how NFS works. Okay, So now let me show you real quickly through the pictures through the diagram, because pictures speaks 1000 words, right? So you have a machine, a computer. It's probably nowadays it's could be either Lennox or could be UNIX or could be Windows. This machine wants to attach ah, file system that is being shared from another computer. So what it does is it sends an NFS request that NFS request goes to a server that is hosting that file system. So if that file system it's hosting that's ABC file system or whatever the name of the file system that is being hosted on the server, then based on the rules that are defined on the server meaning the policies which server to share with which server to trust and all that once that is satisfied, then the server is going to send approved request back to its client. It's going to say, Hey, I know you are asking me to share my file system with you. Now, First of all, let me see if the file system that you want me to share with you if I am authorized to share first of all second, if you are authorized to view that fall system. And of course, there are other options that can be defined, which we will discuss literal going on network file system. What are the steps that we need to do while there is a server that is going to share its file system? And then there is a client which is gonna mount that file system, right? So what other steps we need to take on the server side. So and this in these slides, I'm actually going to show you What are the steps we need to take once I'm done with this slide than actually our log into the machine and we'll do there will work, So steps are first on the server side. Now we need to install NFS packages, and those NFS packages are NFS dash your tills lib NFS I d map these other two packages that you need, um, on your latest, um, red hat or sento us words in seven servers, most likely they are installed in your machine. But the way you could check it, you could check it by running r p m minus Qiwei and groping for NFS. And you will see if these packages are installed. We'll check that together. So no worries. Next thing you have to do once these packages are installed, enable and start NFs services. So you know that every enabling, any service, meaning you are telling the service to start at boot time. So you want these two services to start at boot time. That's why we are using the option enabled once we enable them. Then I'm going to start the services RPC bind NFS server, RPC stat D and NFS I d. Mapped. These are four services that I want to start. I put them all in one line, But make sure you, when you are running your command, they shouldn't be in one line because it will give you an error. I am trying to save some space here. That's why I'm putting everything in one line. Okay, moving on, then create NFS sheer directory and assigned permissions. So once we are on the end of service, we're gonna create a directory or if you already have a directory that you want to share, then you don't need to do this part where you have to create and assigned permissions. So in our lab, we're assuming that we are creating or you're sharing a new file system, a newer directory. So I'm I'm gonna name it my pretzels, and I'm gonna assign the permissions off that to my pretzels. So my pressel, I just picked a name. You could pick anything. I like this word pretzels, because that's one of the my favors lines from Seinfeld that says these pretzels are making me thirsty. So I just picked that name anyway. Then we have to modify the permissions for that. My pretzels directory. Then we had to modify the export at sea export file because the reason we wanted to modify that is because if you want to have this file system to be shared, I have to have certain option it. So as you could see, I have put in the I p address one I to 1 68 Wanda 12 7 It means I want my pretzel to be shared only with the server that has this. I p and it will have the read write permission. So let's look at them one by one. So here is my NFS year. That's the NFS sure that I'm sharing. Then here is the I. P. Address off the client machine. From whom which I'm going to share my file system with now. What if you wanted to share with everybody? Then you go to simply put star the gastric? Yes. Then next thing read and write, you are giving permission to your clients to read that fall system as well as right to it. Then there's another option. Sink Sync is telling that all changes to the to the according classism are immediately flushed to the disc. Their respective write permissions right operations are being waited for, So don't wait any any longer. When you're writing to this file system for my client just right into the dissuade away, then the last option we have right here say's root on the client machine will have the same level of access to the files on the system as a route server. So the root server, which this NFS servers coming from, will have the same permissions as a client route so that's what it's saying. So now, of course, this is for one host because we have specified the host name or the I P address. But if you want to specify everybody, not just one computer than you would use Lennox Miley next year. Oh, sorry. This is not my Lennox. Here. You have to change it to my pretzels. I had it using before Miley next year. But to make it mawr meaningful, uh, change it to my pretzel anyway, if the Miley next year, whatever the length here is Asterix and the entire line off options, that is to give it to everybody. Then once that is done, you edited the etc export file. Then you export the NFS file system by running the command export F s space minus R V. So what are these different options are is to republish everything that is inside, off etc. Export and V is to show over boss mode. So I hopefully you understand. This is the NFS configuration on the server side, the server which is trying to share its file system. So in our in our example, our NFS server is ours over server. Our lab server that we have built for this training. And remember, the hosting for the lab server is my first Lennox VM. Right? This is the That's the one we created, right? So let me go to my Lennox PM and Mitt Log in real quick, okay? And just to host name you see, my first Lennox P. M. This is the Lennox we m that we've been working on. Right? So this is going to be our NFS server where we will create our file system to be shared with other servers. Okay, so now we will export it. We will enable Sorry. You install the packages enabled these services start the services, create what we need to create what we need to share, change permissions, then modify the etc export file to have that shared moving on to the next light. Now steps for NFS Klein configuration. Now, of course, you have one services my linen. My first line. Ex PM. Right, That server configuration. Now we are going to create another machine that will actually mount that file system on its mounted point. Whatever that you need to define. So what we're gonna do is begin install these packages yum install. And if Sutil rpc bind same packages as NFS server, then we're going to start. Once the packages are installed, enable and start RPC bind service. You have to make sure Onley this service that you have to be up and running RPC bind start Then, um, make sure there's no firewall or I p Tables are running in your system. The client. Then we will do a short mount Command to see what is available for enough for me to mount, then create a mount point like m k d. I r slash mt slash ap or slash mt slash Let's say Cramer whatever that you want to do, you could do that just like that. I have it right here. Some mountain, the file system like mount the name off the I P address off the NFS server slash my pretzels, which is the first shared file system mount to Cramer or Mount to app or what? Ever The mount point that you wanted to make then verified amount of file system by running the command DF minus age and to unm ound that file system is you mount slash mt slash creamer. So that's it folks, enough talking now. I'm sure you probably heard a lot of things. Now let's do the real work. Let me go back to my and if a server configuration and that's where we're gonna start off it. So I am going into my Linux machine. And the limits machine is my first Linux VM. How I'm logged in. Who am I? And which directory on men and which host I am on verified everything Perfect. Now go hadn't become route. Okay, we are route now. Before you install these packages, you could run rpm command to verify if the's packages already exists or not. And you see, it tells you that NFS does you till and lib NFs i d map are already installed. Now, if you try to install it with young commander to yum installed and a fest dash you till you tills it will go out on the repository. But I will say right here, See this package And if a util already installed and has the latest version perfect Soviet , we we've been through the first insult NFS package. Okay, done. Second thing we need to enable the rpc bind an NFS server service so took the command to do that system. CTL enable rpc bind Perfect. You get the prom back, It means it worked. Then you do the same thing by doing up a rookie instead of rpc bind. Do NFS dash server because it's NFS Dash server, right? Yes. Hit Enter. Okay, created Symbolic link. This this this Why didn't create it before? Maybe we have already or I have already enabled that rpc buying previously and that's why the link was there. But anyway, I am enabling this NFS taxable for the first time. And that's why it's saying created symbolic link, which is what it's supposed to do. Okay, anyway, so now the time to start the service system. See Thiel, start RPC bind. Look it started. See? Didn't give me any error message if one If I wanted to check the status of that service A loose status system CTS status RPC bind and you'll see it says right here, active, loaded and running. This is what we wanted to see. Perfect. Now next service I want to start is and if s dash server See right here It's his NFS dash server hit Enter. They should start the service RPC Dash That d right has confirmed rpc dashed at D. C s hit. Enter Okay, is up and running. Perfect. And I could just do start again. It started. I'll check the status running. Okay. Perfect. Next one NFS i d map d It started. Now let's check the status active and running. Perfect. Now it's time to create our shared file systems. So I'm gonna go into my CD slash directory. You see, I am in slash cd slash just slash Now I'm going to create a directory Cold make the I r. My brittles. Okay, I am in slash and unless minus l and you will see it is created right here. I could do ls minus. Lt are to see it at the bottom. Now I need to assign the proper permission. So I'll do change. Mar a for all plus r w x my pretzels hit. Enter. See, these are all the rights. Okay. Perfect. No, I already have my directly Let let me go into my pretzel threat. Okay. What's inside My pretzel director? Nothing right now. Okay. I could create a couple of files like Touch A B c. All right. Perfect I could also create a file called Touch Cramer and I could echo into the fall. These print Oezil's are making me thirsty, and I'm gonna output to cream Cramer file Perfect. Let's echo creamer file cat. Sorry, Cat crema file and you will see these Pressel are making me thirsty. Now, this directory, my pretzels, has how many files? Four ABC and Creamer. So that's good enough for our testing. Now what we need to do next thing we have to edit the etc exports. So we I at sea exports. Since we are doing that for the first time, you will see this father's empty. Be very careful to modified. I always What I will do is I always do copy at sea exports and then at sea exports underscore I put a date in, like, 0808 2020. So this way, if I make a mistake, I could always copy it back to the original version. For now, I could go into V i X export, but anyway, this was empty. So now what? I want to export. First of all what? I'm trying export. I am going to export slash my pretzels. Okay, perfect. Who am I exporting it to? I wanted to export it to everyone if you wanted to export it to you other Lennox machine, which we will build later on. And you want You have the i p. And you want to come back here and specify the i P. You could do it. But for now, I'm just gonna do Estrich now. Then I have to specify ass trick. Parentheses are w read, Write comma, sink, comma No underscore route underscore squash and that's it. This is what we need. So if you guys, I need to know the exact instructions, I will try to put it in this entire instructions right here. You see, on my slide, I'll put it into the the notes folder. The north section. Okay, so now that file is edited. Go ahead and saved out file. Perfect. What? We need to do the last thing. Export that file system. Okay, go ahead and type the command export five system dash, Are we again? Are stands for to republish everything. Whatever's in their publishing again doesn't I don't really care and I ve is devore boss mode had enter. And now it is telling you that exporting it is exporting the file system toe everybody. And the false system is my pretzels. Okay, so you have created it. Your NFS server is ready. It is exporting to other machines. Now, the question is, I do not have another Lennox machine to test mounting this file system to another machine. So what I'm going to do is I am going to build another machine which is going to be client , and I will show you how to build at this. The whole thing I'm gonna do by building this another one the next machine. I'm gonna do it really fast. I'm gonna fast forward it because since you guys have already, um, have experience off creating another Lennox washing machine. So I'm gonna go do it really fast. So right now, if you could see if I go into my oracle Veum worship box, then I'm gonna go ahead and create new I'm gonna name it. Ah, Monk, monks, monks is a name off Seinfeld. Show that there, That's a restaurant where everybody goes. So it's like a shared environment. I'm using this as, ah client name. So monks and Windows Microsoft Windows. I'm gonna pick Lennox because you're belittling it's machine. And now pick Lennox 62.63 dot x four x 64 bit Now go ahead, click Next memory size Lee with default. Create new disc your disk dynamically created. Next. You already know that the size of the disk that will be created eight Gig, leave a default Create It is created Now, Monks, VM is creating. I'll go ahead and power on this is asking you Where is your eyes? So image remember we actually downloaded are sent Os Isa image. If you do not have that eyes an image right now, it's OK. You could go ahead and download again from the internet. And once you have downloaded, come back and start again from this lesson on how you could select it. And I'm sure you know this how to select it. So here, go ahead and pick the location. I already have the location pick and it as this window sent Cento a seven. I'm gonna click open and start Now this is going to start, um, installation. It's by default, tells you this test media and it's all centers, so go ahead. Hit up Iraqi and click on Install Santo us and hit enter. Okay. From this time, from this point on, I am going to fast forward the entire installation because you notice I am going to pick the minimum install. What minimum install means that there is not gonna be any green stalled. I don't really need greed at this time. I just want to test my mounting and if s file system. And that's why I'm gonna leave a default. The installation destination. You click on it and select a disk and leave everything as is automatically configure petitioning. Go up and click Done and then come down. You'll see the network host name. This is not connected. Click on it. Go up, Turn this on and now give it a host name. I picked the VM host name is Monk somewhere they use the same name Monks click Apply and it will say the current host name is monks go up, Click Done. So everything is set up America's New York time zone. You could pick a different time zone according to your region Language insulation source Local media software insulation minimum As I said, we don't need agree and we don't need any other extra software's come down installation destination. We picked it already. Which is the default. Everything's default and alcohol and click begin installation. Once it begins installation, click on root password. Specify the root password. If it's weak, you would have to enter. You have to click. Done twice. Use the creation. I don't want to create any user right now. Okay, so now you'll see it is going through the installation process off installing 303 packages . And right now it is at 15 packages, so it's gonna take time. I'm gonna go fast forward again from here. And when we come back, we should have ah built up machine. All right, everyone, our machine, the second machine client monks is being built. Go ahead and log in as root. So now checked the i p. Address of this machine. Okay. It does not have the number of utilities that you need to check the config, but there is another command that we learn previously. Its i p p a d d r. Yes. So you notice you have an i P address off $10.0 15. So if your I p address is different in the other servers. Let's check our server. My I p address here is if config it is 19 to 1 $61.18 and its i p address the other machines. I Pierre is different. The reason is we have to change the setting on the virtual box. So that's the machine. Go to setting grew network. And you see it's right here says attacks to Nat changes to Bridget Network adapter and broad can extreme gigabit Ethernet. If you have a wife, I you picked that one click. Ok, now it should have a new address. If it doesn't end, run the command system CTL restart Network It has restarted. Now you check I p a d d r and you will see the new I p I have right here is one I to 1 $61.11. So, from here, make sure you do press it right. Click to get out of this machine. Um, box so you could go ahead and pink 1 90 to 1 68 Rwanda 11. Just to make sure you're not 1 11 make sure you go ping it. Yes. You see you getting a response back. Perfect. So now let's go back to our machine. Also try to do pink www dot google dot com to make sure your machine can get to the Internet. Yes, it can go to clear the screen. Now we'll get back to our lesson where we have to actually go to the client so you have to insult. And if, as you till rpc bind, um installed NFS stash you till if on one package 15 dependency, Go ahead Hit. Why? As yes hit. Enter Perfect. It's finished Now. The next thing we have to do our PC bind yum install RPC bind one would. And this time do minus y option. Okay says it's already installed. Perfect. So we don't need any of thes more packages. So now what? Next we have to start that RPC bind service seduce instead of service. You have to do system CTL because service is an older commander works with Red Hat six or Santo a six start RPC bind. It has started. You could check by doing PS minus CF Group RPC, and you'll see it is up and running. Now let's make sure the firewall or I P. tables, not running PS minus F e grip, fire will or I p table. So we see the, um both know only firewall D is running, so let's stop that. So, system, see, Thiel, stop Firewall de this is going to stop that Also disabled that service to start at boots. Okay, it is deceived. She'll mount Show amount. From which machine? Show mt minus e. What is the I P address off our, um, other server and fs over machines. So let's go to our other manifest machine and check our i p address. If config r i p address. Whichever the command you prefer. It's one night to 1 $61.18. So let's go back and do show mount 1 90 to 1 68.1 dot 18. And this should return what is being shared from that server. Okay, it's saying unable to receive error number 113 No route to host. So let's pink. First 68 don't wander 18 coping Get. But I cannot It's not showing me the mount The check on the service side If the server side is running I p tables. Ah, So there was a fire wall on the server side that is running. We have to disable that. Okay, so now that fire was disabled, Let's check on the client side again and see if he could be the show. Mt. Ah, perfect. Now we see the show mount. So now let's go to our document. We have where? Fight it. Now we have to create a directory where you have to mount it on our client. So let's clear the screen and now create a direct treat. We call it M k D. I r under MNT will call it Cramer. All right, so let's do Ellis my cell and Manti will see the creamers to to the Mount Mount 1 90 to 1 68 That Wanda 18 colon slash my pretzels and map it where? Map it to mount slash Cramer. Okay, we got the problem back. Perfect. It means it did mount a DF minus h or type. Define station and you'll see right at the bottom is coming up as MNT Mount creamer. Now if I go to CD slash MNT Cramer and to Ellis Marcel tr You see, I have the same files now that I created on my server, which is right here. And if you go to seedy, um, my pretzels, That's my cell TR. So these are the file system. So now, if I wanted to write something to this, let's say from the client side, I'm gonna create a file called Touch um David Hit, Enter verified and it created on the client side. Now let's see if it shows up in the silver side and you see it showing up on the server side. The last thing that I want to cover here is you verified it. And if you want to amount that from the client, then you could just simply do you mount slash MNT slash Cramer yuk amount the Mount point. Or you can mount the file system, which everywhere you like. So when you hit enter, it's going to say devices busy. Why? Because you are already inside off the director. So you get out of the directory to CD hit. Enter now You're not in that directory. Now up a rookie and do this you mount and has amounted to do a DF minus age and you'll see it is not there. It is gone. So, guys, that's how you do the NFS try it. It's a very, very important lesson and a lot of people ask for NFS US services and I I'm including this in this training because a lot off students have asked me on NFS. So that's why I decided to create that for you. How right, guys? Good luck.
170. Samba Installation and Configuration: Hello, everyone, and welcome to the samba topic. This is where we're going to cover the download, installation and configuration off samba. Let's take a look what samba is. Somebody's Olynyk stool or utility that allows sharing off Lennox Resource is such as files and printers with other operating systems, so it works exactly like NFS. But the differences NFS years within the Linux or UNIX like system where, as samba issues with other operating systems, for example, Windows and Mac. Now let's take a look at an example where Computer A shares its follow system with computer be using samba. Then computer be will see that shared file system as if it is mounted at its local file system. So here's a client. Let's see, this is the climb. Let's call it client be or server be it sends amount request. Hey, want to sketch your shared file system and die Request goes to the server, which is sharing that samba share now. This over has to run the server, the samba server, in order to accept those requests. If it is running that service or the process, it verifies it, and then it sends the approval back to the client, and then Klein can mount that files. Moving on Let's take a look at the SNB. Worse is the CIF Samba shares its file system through a protocol called SMB, which stands for Server Message Block, which was invented by IBM. Next. Another protocols used to share samba is through SIFs, which is common Internet file system invented by Microsoft and N M B, which is, which stands for net bias. Name Server six became the extension off SMB, and now Microsoft has introduced new aversion off SMB words in two and three that are mostly used in industry. So let me put in a very simple, simple language or simple term, that is, most people when they use either SMB or Sifs. Basically, they're talking about the same exact thing. All right, so let's take a look what exactly we're going to cover in terms of the technical side off the installation configuration of samba. First we're gonna do is we're gonna take a snapshot of the VM. Were we going to install the samba just in case things go wrong or things don't work or we mess up some other configuration files, we could always revert back to the original ah state off the VM. Then we're going to install the samba packages. We're going to enable samba to be allowed through firewall, and that is only if the firewall is running. You could also disabled the firewall, and we'll cover that part as well. But please make sure you get the proper permission to disable the firewall on UNIX machine . If it's running in production. That would create samba share directory and assign its permissions. Also will change the S illness security context for the samba share directory. And again you could also disabled SC Lennox completely said this where you don't have to, um, created those security context. But again, please confirm with your system administrator, your security team. If you're running that links machine in production wire mint, then we will modify the etc. Samba smb dot com file to add new shared file system. Also, please make sure you make a backup file for this SNB convict. Then we'll verify the settings once the packages are installed with enable and start the samba services, which are SMB and an M B, and then we'll mount Asama Sheer on Windows Client will also mount some Bashir on Lenox climbs using the SIFs. And the last is we will also have some additional instructions for you on creating secure samba shear. Meaning, if you want to share the samba, um, file system Ah, by allowing or by prompting the use of his user name and password, that is also co word in my instructions. All right, Without further ado, let's get right into my Lennox machine. Now, please note I have one Lennox machine that is gonna be acting like a server. There's gonna be another Lennox machine that's gonna be acting like a client. And I also have my Windows machine where I'm gonna mount that samba sheer and that Windows machine is where I'm running my work jewel box. Okay, so let's start doing the actual technical stuff where we could actually install the samba server and go through all these steps. So I have my limits machine right here, which is gonna be acting as a server. This is where I'm going to install my samba server. So my machine name is my first Lennox. William and I have also an instruction guide with me, which I where I have written down all the instructions. So I'm gonna take all the instructions from there. Which I, by the way, I have I'm going to also attach with, um with with this, um, lecture So you can find the resource on this lecture as well and download the pdf all for for some instruction. Um, it is right here for me. And now let me go. But here and I'm gonna follow the step by step installation instruction. So it's his first. First, please make sure to take a snapshot off UVM. Yes, that's so very important. So I'm going to go into my oracle box, and this is my first Lennox bm. I'm going to take a snapshot and I'm just gonna call, um, before samba click OK, again. The reason we're taking this in case things go wrong, we could always come back to this state arts and now snapshot is done. Let's go ahead and close this out. Next step is become route. We are already logged in as root. When I do, I d that's my root account. Me make this window smaller. Now I need to install yum installed samba, samba, dash client and samba dash Common all of these three packages I could install in one Go. So copy. Come here. Right Click and paste. I'm going to fast forward. That said this way we could save some time. Okay, so the samba package installation had been completed. You could verify by running rpm dash Qiwei Command and grow for samba. And you're gonna find all those three packages that we just installed. All right, next thing is enabled. Samba to be allowed through firewall. So now, if you have a firewall running and you can not disabled, then you have to add these values to your firewall. Now, in my system, I usually this is my lab system, so I keep my firewall turned off. I could also verify by checking system CTL status firewall D status. Okay. As you notice it say's status. It's loaded and active. It is inactive its debt, so it's not running. So if you if you are running far wall in your environment, you could add these parameters. So next next step is, um to stop and disabled firewall. If you do not want to use your firewall, you could follow these steps and disabled firewall or I P tables. Both are the same, but for me, it's not running. So I'm gonna move on to the next step now, create a samba share directory and assigned permission. And that IHS, let's create this directory, which we want to share. So that is M K D i r. Minus p samba slash mawr pretzels. That's just a pretzel. Um, it's a It's a word that I got it from a Seinfeld show where they would say, Hey ah, these pretzels are making me thirsty. So it's just that now we're sharing these pretzels. I'm putting the pretzel word in the samba Sheer. All right, so it's just the name you could pick any name by the way, that's going to create it. It is created. Now I'm going to go ahead and assign some permissions so everyone could read right and execute samba. More pretzel. Okay, now I may just make this thrill bigger. Next step is ownership. So right here if you notice let me make this a little smaller. We have to change the ownership. So if you go to samba So if you go to slash cd slash and dual s minus lt, are you gonna notice the samba is owned by route. We want to change its ownership permissions to nobody. All right, so change own minus R, which is recursive nobody colon. Nobody for the group as well. And to samba and more pretzels. Okay, so that is done. Let's verify it. That's still say his route. Oh, maybe let me see Samba. Oh, it changed the more pretzels. But we have to do the same thing for somebody as well. Okay, Talisman Cell tr. And now you're going to see some by itself has the same permission. So limited has changed as well here. So change ownership and that IHS this removed that so it will be a recursive ownership change. All right. Next time is also you need to change the SC leaning security. So now for me as C Lennox, let's see if at sea Lennox is running in my system, so I'll do a C status and you're gonna notice that I have that enable so I want to disable it. Ah, that's again. That's for my lab in wire, man, I could do whatever you want, but if you are running in production, please check with your security folks. check with your system administrator before you disable anything. So I'm gonna go in when I need to disable. All going to be I at CSC Lennox config file. I come down to SC Lennox and were you see enforcing take out the enforcing and replace it with disabled, then save the file, and then a simply I just need to reboot. Oops. Okay, so the entire re boot is gonna take maybe 2 to 3 minutes, so I'm just gonna fast forward from here, okay? Lets trick if he had the system back. So click on this little icon and click on restarts session. Yep, We got it back. So log in as root. Now, we have disabled SC Lennox, but let's verify if it has been so type SC status and you're gonna see a seal INEC status Equal disabled, Beautiful. All right, moving on. Now it's time to modify at sea samba convict fall and add new shared pile system. Make sure to create a copy of this and be file. Very good idea. So let's go to a C samba. And in here I have a file called SMB Doc off. Before I modified, I wanted to make a backup, so I'll create a copy. SMB, Dacom, SMB contact or rich? I usually pick that name. Are are you put it the date on it. It depends. What? How you want to create a copy? So now I'll go ahead and modify it. And simply I want you to go ahead and delete everything below the common section. So from global Just keep hitting. Delete De de de de de Okay from here. I want you to just simply copy this entire all these contents and paste it here. But at the same time, I want you to paste it. Looks nice. Okay, Workgroup equal work group that goes with Windows Net Bias name. We're gonna go with Cento s security user map to guest Dennis Proxy. No, these are some default setting. If I get into each off these parameters, what exactly each of them mean is gonna take me a really long time. But my so my advice is to you is just simply go ahead and take all these parameters and just simply paste it into your smb dot com file. Okay? So anonymous is going to be the actual sheer that's going to show up and the path is gonna be samba mawr pretzels, right? This is this false system that we created to be shared Is a browse herbal? Yes. Is a rideable? Yes. Guesses. OK, guest on Lee? Yes. To read on Lee? No. So all these permissions are set there. Everybody could use that. Everybody could browse it. Beautiful. Now go ahead, escape and save out of it now it has saved. Now I want you to run this command called test P A r. Which which, Which exactly, going to test all the parameters that we have for samba test. PR head editor is gonna ask you please enter to see a dump off your service service Definition hit Enter and nothing. No errors. Air coming up. Perfect. Now let's move On and out. We are on the part where once the package are installed enabled and start NFs services. Sorry, not NFS Samba Services. Okay. And that is system. See Thiel start again first Enable Let's enable it the reason we enable it so it could start when the system reboots. So enabled SMB Okay, that is enabled. This enabled NMB Okay, that is done. Now let's start both services. The system CTL start that it started when you do not get anything back, it means it has started. And the same thing with an M B perfect has started. If you want to check the status on both so you could just as types is systems he deal status smb it hit. Enter and you're gonna see the X status. Active, active, And it's running. Same thing you You're going to see when you do for an M. B. There you go. See? Active status active and it is running. Okay, perfect. Moving on. Now it's time for us to mount that file system on the windows machine. So first of all, let me go to the share and my share or samba. More pretzel, Right? That was the name off the share. So now I want to create a file any of our like touch, um, apples for examples. And I created this file called Touch Apples. Okay, so now I will go in and to my windows machine. This is my windows machine. I'm gonna click on start and right here says search program and falls. I'm gonna type in backslash backslash 1 90 to 1 68.1 dot 95. The reason I'm typing 95 is because that is the I p off my machine right here he is going to see. See? Right here 18 to 1 60 of one. Done. 95. So that's what I'm gonna type. Okay, so it's already been written there for me. Click on it. And right here the sheer comes up. An anonymous double click on it, and you're going to see the file called apples. This is the same file that you have shared from this system. Now go ahead and create a file from the Windows machine so you would know it is showing up on the links machine as well. So go ahead and right. Click and create new and pick the text document. Once you click on the text document, put in a name that's a yata hit. Enter now. Go back to the Lenox machine. Which doctor? Urine, urine, samba, More pretzel. Beautiful. And now let's do a less minus. Lt are and you're going to see the Yarra is actually there and it is created by nobody. The reason Apple's was created by route because I was logged in. I am logged in as root. Who am I? So who am I to root? So that's why you see, if I had been logged in as nobody, it would have been created. A pause under nobody. So there's your Jonah follows. You could create as many files here. It will show up here. So that's how you're sharing thes file system from from Lenox machine to Windows Machine is in a cool. Yes, it is. Now, let's take a look at what? If you want to use the same samba and you want to mount the same pile system on another Lennox machine as using samba sheer, you could do that as well. So I have my another Lennox machine right here and I'm calling it Lennox Cento us seven. That's my name off my linens client. Maybe you have a different name. Maybe you have the ones that we've created earlier. If you remember, we created a second machine called Monks. You could use that as well. All right, so that's the machine as a client machine. For that, I'm gonna have to install accepts utility and samba client, so simply become rude, which I am. And then I'm gonna copy this entire line and come here right click on this machine, and it will automatically paste everything that I have copied from that word document. Go ahead and hit. Enter. Okay. It say's package Safe utility already installed and latest version that is already running . And the 2nd 1 Samba Klein. This is already installing and running the latest version. Nice. The reason it's saying that because I did go through this practice before I created this video soap. Anyway, So the package is there if you if if that packages, if these packages don't exist on your machine and it will go, it will install all of these two packages on your machine anyway. So now if I need to mount these samba share right here into my other Lennox machine declined machine, then I have to install those packages. And also I have to create a mount point where I'm going to mount that. So for that, I'm going to create a directory of Mount Point director. I'm gonna call it make the I r. M anti samba sheer. And in this case, I have already created that if I go to seedy m and T. Let me see if I have it or not. No, I don't. So I'll go ahead and create their directory. Make the I r. Samba. Sure it's just the name I'm picking. You could pick any name. Okay, Now I'm going to go ahead and mount that CIF share. So here's the entry for my Mount Mount Dash T SIFs teas for which follows system and copy. Once a copy it, I'm gonna paste it right here. Let me make this a little bigger. So now you're gonna know this Mt minus t sifs, which is a file system 19 to 1 61 Done. 95 is the I. P. Address off this machine right here. And let's go back slash anonymous. This is the anonymous file system that we created in smb dot com file. And here is our mount point. Where are we mounting it on? That's pretty much it. Go ahead and hit. Enter as soon as you're gonna hit Enter is gonna prompt you for a password and you're probably gonna be thinking Hey, I didn't create any password. Yes, you did not. So what do you have to do. Just simply go ahead and hit. Enter. Don't put any password. Don't put any keys. Simply hit. Enter once you did that. Now I want you to do DF minus h and you're going to see right here are Mount Point has been mounted over sifs. And there is This is the mom point. Now let's go into that Mount point, CD slash MNT samba shares do ls minus. L and you're gonna see apples. And yet you could also create another file right here. And you could call it a D. Diatta. Yeah. All right. So it is created. Now you notice you have three files. Now let's go to the client machine and you're going to see three files here too. Now let's go to the windows machine where we had that open. I think I closed it. So let me go back 1 90 to 1 68.1 dot 95. And here's a share, and you're gonna see these three falls one. This is the one I created on windows. This is the one I created on the letters machine. This is the one I created on the actual server where the samba So where is running? All right, so this is exactly what I want to share with you. I really hope you learned a lot. You. Now, at this point, you know how to create a samba server and how to share fall system. Now, for those who wants to create a file system through a secure way, like to prompt as user to put in as your name a password for those. I have these instruction right here, which say, sambas secure samba server. So please go through these instruction in my attachment, the resource guide that will be with this video. And then you will be able to share the file system through user name and password. All right, good luck.
171. Difference Between Linux 5, 6 and 7: Difference between Linux 567. Now, as you're going to learn Linux and you understand Linux, you will know that you will be upgrading your system from different versions. And the reason companies, Linux distribution companies come up with a different versions is because an enhanced their features. Existing features, add new features and fix a lot of bugs. So the reason I'm including this as part of the lesson are part of the training is because maybe you have the experience on Red Hat or CentOS five or six and now you, it's time to move on to seven. And of course, in my training is everything on seven. So you should really know some of the differences, the primary differences between all these versions. So CentOS and rel or Red Hat. What are the major difference? Well, as I mentioned a few times, CentOS and rho are both exactly the same. The only and only difference is that is that Red Hat provide support, technical support to their customers, and they also provide patches and then break fixes. A CentOS, they do not. It's a, it's a free software and where you could get support on the community. You just have to wait for someone to reply back when you pause you answer your question. So that's the primary difference. Now, what are the total versions of CentOS and REL? Red Hat always started from version 0 through all the way to seven up to now were as CentOS actually spun off the, off of Red Hat when Ray had was at version two. So again, the versions are the primary version that we will be discussing. Our version 567. I have a cheat sheet which I have also attached with this lesson. I'm going to cover that cheatsheet which you, which will enable you to go over it and find out what exactly the differences are. So let's open up my cheatsheet gets a PDF document, and I'm gonna go really quickly the differences of Red Hat 567. And please don't be surprised by looking at, Hey, this is only redhead. What happened to CentOS? As I mentioned, CentOS and Red Hat is exactly the same. So let's start off with the first section right here says System basics. So view subscription information. 5v had System ID six, no changes. Seven, we have Subscription Manager, which is the newer command with identity. Configure subscription when you want to register your system with Red Hat or satellite. Then you'd run the command origin underscore register. 5-6 is same thing. Then five and then at six day introduced Subscription Manager as well along with origin register. And in seven, it's Subscription Manager. But now our chin underscore register is someone deprecated. You probably not going to find in a lot of system a new version. Uses some information how to get us a report, the MID code hardware browser, some of these commands we have already learned stays the same in 67, the last command changes to Ls H, w, which is list hardware. To view the Red Hat version information. It is, ETC, Red Hat release. It's the same across all the versions, nothing has changed. All you have to do is cut out this file and you will see that difference. You will see the versions of your CentOS or Red Hat operating system. So this is about system basics. Moving down the basic configuration and you configure your system. There is a command in 56 system dash config, and followed by second or third of the commands attached to it. You can look it up and you do ls minus l on slash Ben. You'll find these commands in real seven-day changes to genome control center configured network. We have done that System Config Network is a GUI based as well. N m CLI is the newer utility that you should get yourself a milliwatt run this command. This will allow you to configure your network and then configure system languages. Different commands in 67 configured time and date. We have NTP. And although version 56 and the newer one is chronic, chronic SI or chronic D is a demon. You could modify the IC chronic.com file. We cover that already in an oblique module seven. Then configure keyboard, a couple of different commands from five to six. Textbook configuration tool. There are a few different differences, but there are same across all versions. Configure printers, I'm sure you don't have to worry about it because a lot of times the next servers are not attached to Linux, sorry to printers or fax machines configured Samba, same commands, nothing changed. Configured SSH, nothing change, everything sink. Now we'll talking about jobs and services. There is configure logging is Rp is a sys log.com file N5 and N6, they change to our sys log.com fall because R stands for remote. So you can also get remote logs from remote servers. So they enhanced it, added new features. Well, same thing. Our sys log is completely gone. Now is replaced with r says log list of services you could do, check config, dash, dash lifts. This is to see what are the services that are enabled at boot time. But in 17 has changed. Everything is controlled by a system CTL. Now, if you wanted to see the list of all the services you could do system CTL, I believe, base dash, dash list. It will give you all the listing of services that are running or act serviced. Lists running, process, service, dash that satisfy all. In Raul seven again is system CTL. Start and stop the service, service Command, Service command. And here we have system CTL command, system CTL command. These are the type of service we learned in Module seven. So pay close attention how they are changing. So don't be surprised you should know both commands. Because if you are going into an environment where they have a Red Hat for five or 67 as well. So you should know which command can be used where there aren't a lot of changes in the command, but some of these commands that will make a difference. So that's why I want to make sure they are code. Check config is a command that will enable service at boot time. And now System CTL does that. Services, same thing, check config, same thing. We're talking about, the same thing Ron levels. Now run, run level is being controlled by system CTL as well. That run level level can be changed by going to at sea in a tab. Now it is going through the command line. You could change, you can make the changes to the European level by running these commands. You logs nothing changed. Warlord, war log. But now there's a new command called journal CTL, which'll provide you more information about the logging configure system audit. We do not have code that this is more of system that are facing on the internet, are more vulnerable to hackers attack. But most of the systems, mostly Linux machines, are behind firewalls. So there isn't much you have to know about this, but it's good that you should know and nothing has changed. That's main thing. So not to worry about what do you need to know what you don't see Pam d dot system part, if you remember, we covered that in an, in a lesson where i, The lesson where we are doing the always hardening tau to harden or secure your system. Moving on, cron job, everything is the same. I'm not gonna cover every detail here because all up, all of them are same. Nothing changed. Then we have colonel boot and hardware. What has changed? Single user rescue mode. Some of these changes are with the configuration file changes shut down before we had shut down just to command, but now you run system CTL, followed by the shut down. Same thing. Everything is the same, same commands except now you define system CTL command, preceding the actual command on the file change, we talked about this grub fall location has changed, the rest all same, nothing has changed. Then Software Management is yum install, young group installed everything. The command itself jump is the same except this part where they had jumped group install as one word. Now they have added space between group and install. Now someone would ask me a question, hey Enron, Why would they make these changes? Why they put a space or why they make up a command different. Honestly, this just, I don't know, that's the way the standard works. It's just that like you could ask a question why Apple comes out with a different look, with different icons. They just want people to embrace newer features, new technology, new icon. So that's pretty much it. Of course. I also think that, you know, looking at the same thing again, again, you get bored. So change is always good at. So that's why every vendor, every operating system provider chain make changes like Microsoft, redhead Solaris. Anyway. So on moving, let's move to the right side. I'm going to go up all the way to the top. And the tasks, user management, nothing changed everything to create user delete, user chain password, everything is the same. So you don't have to worry about user management, security, and identity. I'm glad nothing changed because security is something. If you don't want to mess with, if you make a mistake, it could make your system one honorable or create a leak in your system. But anyway, nothing is changed or you don't have to remember any new commands. File systems, Let's see, File System volumes and desks. There are few things that have changed. In 56 V hat file system. Ext 3470 have x fs. Every new version have a newer, faster file system. Now, x fs is a lot faster. I covered that in module two of Module three, where I covered by the file system, what file system is. Then some of the changes like port desk, they added new utility. Coming down to munge file system looks the same. Pv create, creating Volume Management. Everything looks the same. There's nothing changed on, on mounting the file system or dealing with file system. Then we have networking. Ip tables is the command to enable firewall rules. Now we change it to firewall di Cmd, firewall dash config, which is a GUI. This is something that we covered in module seven. Then we have to configure DHCP, climb. A few of the configuration file changed at series all, ETC. Host name where d define your host name. Same thing at c, host Etsy resolved our cough, but now they added a new utility and MCL icon M, O D, I believe this command updates these files for you, so you'd have to manually add them. I never used it, but if you want to go ahead and use it, configure host name, FCC misconfigured network. And now the newer utility is host name CTL. We covered that very, we're changing the host name, I believe in module four. Ip is the new command. We have IP config the mostly we covered in our training. Now, the newer version of Rails seven has ip command. So IP config has been deprecated. You could have that command if you install net dash utility package that will allow you to run ifconfig, but don't get used to and just be ready to use a new command, which is IP configured network interface. The path is the same, nothing changed, but now you could do update or had IPs or update your configuration file to the command and MC ally. The rest looks the same going to resource management. All these commands are the same top PSR, top there few commands they probably add. It looks like t, u and a tuna. I really don't know what it does, but I should look into it. And you should too, they're newer things. It's definitely something with a Resource Management. It tells you what are the resources available, what are the various contention on the network side versus distress resources? So anyway, view disc information, DFS, IO, Stabby both cover that. And the rest of the commands are all the same. So these are the commands I wanted to coerce, so you should be familiar and be ready. When you see new commands. Don't be surprised, hey, I never code that in the training. Hope it's there guys. Try these commands out and be ready to face the challenges in actually corporate environment.
172. Difference Between RHEL7 and 8: Hello everyone. Read had eight. The newer version is out already. And I'm sure that you guys are aware and you already know CentOS is the same as Red Hat. So I've decided to create this video so you understand what exactly the difference between 78. So Red Hat Enterprise Linux eight, which is also called ensured relate, is a now available for production use with lots of lots developer friendly capabilities. Relate. Official release by Red Hat was announced on May seventh, 2019. So I'm going to cover only what is changed and what you should know in terms of my Linux course. So let's go over it one by one. So on the left-hand side we're going to talk about what are the things that have changed and the other two columns for 87. So in general availability, eight became available for the development US on November 14th, 2018478 was 2014. So code name for seven, we had maple and 48. It's called ot pop. Kernel version for seven is 3.1a for 84, 4.1a teen end of support for L eight right now they have it for May 2029, whereas seven, We still have the support until 2024. Last minor release for REL aid. It's just started. So there isn't any. Maybe by the time you are looking or watching this video already has a minor version out. Whereas a rel seven last minor version was 7.7. Alright, network time synchronization. So you probably know NTP, right? So rel seven has NTP as well as chronic d, which is a chronic demon to either to different services that were introduced in seven, now an eight, it's only cranny. Just remember that you won't be able to work with NTP or entropy configurations GUI interface. There is a newer version for genome. The default database, rel seven, only had or supported Maria DB or database, where as the newer version has a lot of other support for other databases as well. For example, Postgres radius. Alright, moving on, the default firewall enrol aid, which is firewall D, it uses N F tables framework in the back-end. In seven firewall D, it's used IP tables framework in the backend. So if you remember the IP table when you wanted to stop and stop and start the service, you would do IP tables. But you still were still tied to firewall dy. But in eight, you would have to start and stop firewall D, which uses the NF tables. All right, maximum so port, individual file and file system size in 7B have only up until 500 terabyte. And of course it was on ZF, fs. And it was a CFS was introduced in seven. Now in eight, again by default it's still x fs file system. And now we have a file system, so Ford up, up to one terabyte. So 1-0, sorry, one petabyte. So 1024 terabyte, package management. By default Both are installed jump, so seven has a ym. If you remember, you would use a gem and, and DNF can be installed from extra repo in seven, you can still use DNF, but you probably don't know what DNF is if you're using seven. But in 08 something you need to keep in mind if you have installed eight, by default Both are installed yummy symbolic link to D and F. So you could still run a Yum, but it is a linked to another command called DNF. Most likely in a day, probably gonna completely deprecate Yum, and they're gonna start using DNF. But anyway, good news is that the Yom is still available. Dnf is the new version of it available in aid as well. Maximum ram support for seven. We had 12 terabyte on X6 for architecture system. And now in 08 we could have up to 24 terabyte annex 64-bit architecture as well. So in summary, as you could see, there isn't any of the difference that probably that you'd thinking that could affect any of the contents that I have in my course. Edie, everything that I have covered in my course, whether you go with a CentOS aid or seven, everything that I code, it's still well. It is still applicable. All the commands that you'll learn, nothing changed. So if you have additional questions, if you wanted to know more, there are a few more changes which has nothing to do with what I have covered my course. But again, if you wanted to know more, I have actually also added some documentation in the handouts where you can look and you could find out all the details about both the differences between both 78. All right. Good luck.
173. WELCOME TO MODULE 9:
174. Resume Workshop: resume workshop. Congratulations. At this point, you have finally completed your Lennox training from top to the end. And you have learned so much in Lennox that you should feel so confident to go head at all that stuff in your resume, create a nice resume and go ahead and apply for Lennox job. So what are the things that we're gonna cover in resume workshop? The first thing is how to build an impressive resume. This is what we will cover. I'll bring up a sample often a resume that will go together with it. What things you should do in it. What are the things you should a Lloyd? What are the key words that we should add? We have done so. Maney commands in this training so many little things that matters. Sometimes we don't speak off it, but having that in your resume shows that you have done it. And of course, we're gonna structure it in a way that it will stand out to the hiring managers. So let's get into our sample resume, and I want to cover one by one step by, step off, showing you how and resume you should build. Okay? I have a sample resume here. The first thing you always have to do is put in your first name. Last name, then your address. I have it. A sessional place. So you put all your real real address. If you are not comfortable putting your address, just put it. The city and the state are the zip code. If that applies to you, then put your telephone number, of course, and then put your email address so the hiring manager or the recruiters can reach you from the phone or for through the email. So this is always the first thing to start off it. Then you put in your objective. The objective clearly tells the manager that you are Pacifica looking first thes type of job so you could just simply type land a job in Lennox. Or there are many, many wordings or many sentences that you could find online that would put a nicely off how to get a job and Lennox or you are looking for system administration job in Lenox capacity . So that would be objective. Some people change objective with career Ah summary. You could do that as well, then the next thing we have is education. Now, some people add education or computer skills, certifications or classes. All that stuff they have. They added at the end of the resume after the experience. Is that okay? Of course it is. Okay, whichever way you like, I like it. I preferred this way to have your education, which is one of the primary thing that should stand out. So you put your education here. You put your college name, you put your major with Major you have done. And then, of course, sorry. The degree that you have done, let's say if you have done B B A, B A, B A C or all difficulty bashes degree, then you put your concentration or major. In this case, you will have computer information system or computer size. Even if you don't have a degree in computer information, that is perfectly fine. Don't make up any stuff. Just put what you have done and put in your major. If you have done any minor or if you have taken any classes in colleges that you think that relates to computers, that's fine. You could put those couple of classes here and then the next section. I have his computer skills operating system. Of course you have learned Santo s or put it in there, which is Lennox. You also know Windows because I'm sure at this point you're working on your Windows computer and a lot of people no lock windows from the get go, then the computer languages. We have learned an ex scripting in doing bash scripting. If you know any other computer languages, put it out there. Some people do no job our any of the language. You could put it out there, then networking static I p Assignment and Nick Management traffic trays. We have covered all that in our training, So put it up there. Next section we have database. If you have any kind off experience or even exposure to the database, please put it out there. It's good to know that infrastructure or system administrator, you do need different technologies. So if you know that Microsoft Office Street comes also comes with Microsoft access, I think that vast version off it. So if you know this, you could put it out there, or if you have work some off on my SQL, you could put it in there. Um, remember, the key here is exposure. You don't have to put in that you have expertise. Knowledge in Microsoft SQL Even if you have seen it insulation or even if you know how it works, that is perfectly fine. As long as you are staying honest and putting what you know about it. This is perfect. Then the always application, which is the offering system application. You have all those Microsoft Word, Excel, PowerPoint and all the other stuff that we have learned our, you know previously, put it out there. There could be other fields or other skills of computers that could be added to it. And if you know those skills, go ahead and put it in their certification. If you have done any certification regardless, if it is computer or not, do put it here because satisfied syndication does show that you are dedicated to your feel . However, you have changed your feel. If you're coming into ah computer field from a different field, that is perfectly fine. Then the next one is classes, of course, is any classes or any courses you have taken in your career. Do mention here and specifically mentioned the ones that are related to computers and Lennox systems. If you have taken any classes and, um, Lennox and Judah me put it out there like this one, you have taken my professional in the class. Please add that hair and do mention that you have taken the you Timmy class, which was about 15 hours long or whatever the number of hours that you have spent in that class Mention it here because this is something professionally done and you have learned professionally, then we're going to get into the real thing. Experience a lot of people. When it comes to experience, they think, Oh, my God, I don't have any experience. And Lennox, how I'm gonna get a job. Well, there's a good news for you if you have done some lab work in Lenox like you have done in this course, and you mentioned that this is more than enough for those people who are looking for somewhere from 0 to 6 months or user two year experience or people we're looking for, Ah, entry level participants to come in, Um, so it is perfect. So ask yourself a question. There is one person who doesn't have any experience in Lenox. And there is under the person that is you who who does have an experience setting up a lab , going to the training and spend so much time and you learn all the different commands. So coming to the point Right down, Lennox system lab set up and management, which you have done it. So you have done your linens lab in this training, and you have done this management and I'm sure you will be doing its management. You will be Keep practicing. You're not just done, you'll be. Keep practicing. So include this you install configure, right hat center, west Lenox on virtual environment, which you have done, Of course. Now I'm gonna go very quickly in this list. So any line that you think that you have not done take it out. But I'm I'm sure I'm 100% sure every line that I have written here, we have done it. So there's no way that you're gonna take out any off it. Password management Creating files, linens, far system management, creating Fars directories using help Command utilize pipe to manage output. This is what you're doing. You deserve what you did in your lap set of right? You ran every day you filters tax processing and those are the commands that we mentioned. You compare the files using these commands user account management, allow use a pseudo axes monitor user's log monitor, right. Basic shell scripts. You did You wrote. Also advanced a scripting such as If then four loop do while k statement All the scripts that you have run then set up aliases. You did it manage operating system network. So you did manage the Linux operating system network record about assigning the i PS we covered about how we configure the network. Where are those number files are located. And of course, at the end, we have managed DNS and TP send mail be covered all three of these. So this is what I have the list and I want you to take that entire list and copy and paste it in your resume. By the way, I am including this resume as part of the handout you could downloaded. And then you can modify the way you want it by putting your name, your address, your certification, you experiencing all that stuff. So if you do not have any experience in linen where you have work previously. It's OK. I understand. This is your new field. You're coming into it. There's nothing to worry about. There are people out there who appreciate people who are honest about it. And But they have put an effort to go outside of the comfort zone, learn Lennox and then actually putting in together as their experiences A for the lab. Also, for those people who have done some I t. Um um I t internship or I t related job. Please put it out here as well, then the other sections are all about your job, which is what your job is. Your last job, that you worked on the location, anything you did, even if you did a sales job. Even if you flip the burgers in mcdonnells are you just sold shoes? That is fine. Put it out there. You did. You did work, right? So there's nothing wrong with that. Everybody works. Everybody try to find ways to make money. So that is fine. That field didn't work out for for you. You're trying something better for yourself. You're trying something better for your family and to do that is that you're learning new stuff so you could go out in the market and present yourself. So this is the resume workshop I want to co are. And if you wanted to spend some time, go do internships as well in Lenox in I t don't worry about the money. Do internship for two months, three months or whichever works for your schedule or for your, of course for your pocket working and put your put it in your resume. Once you have all that in your resume, upload it and you will see the magic.
175. Cover Letter: cover letter. Now, this lesson is about cover letter that is usually attach is what? Your resume. Now, what do we What do we need? A cover letter? Well, sometimes cover letter is very important when you are sending a resume. Especially though for those who do not have too much experience in I t or are getting into I t as an entry level. So this way you could actually freely tell the recruiter or tell the hiring manager what are the other qualities that you have that are not mentioned in the resume? So there are two type of cover letters that I will be covering In this lesson. One cover letter is about the entry level, and the second cover letter is about experienced level. Is this for those who already Horan I t or have some kind of experience. So let me open up both cover letter. So let's go. Are the entry level first? Okay, so and use type up a cover letter for entry level. Always stored the first section store off. But your name, your address, you, um, email address and your phone number just the same way that you would have on your resume, then you would type the name off the company that you are sending it to. So in this case, let's pick on arbitrary name, which is Ben DeLay Industries, and add just 25 some wannabe avenue in New York. So that's just are very address said then the next section. That's where you actually address the hiring manager or HR representative, the person that you're sending your resume, too, so you'll start off by saying, Dear Mr Russell, please accept the attach your resume for this position off system administrator If it's a system administrator, Lennox, administrator or system engineer, that's why I have underlined some of the key words that could be replaced according to your submission. So again, please accept the attached resume for the position off system administrator as recently advertised on indeed dot com, or if it has been an advertising some other website, replace that if you have been contacted by, um, recruiter mentioned, they're Korean company name or the recorder name. Next, I have had the pleasure to review the company's website and went over the job description, and I'm very enthusiastic about the position. Perfect. I believe that my combination of technical skills and business sensibilities would serve and delay industries well in this position. So this is how you are going to put together your first paragraph. Then we'll have the next paragraph. You will have to mention I know that I don't have the exact number of experience. You see, That's where you actually targeting the hiring manager and telling him that why he should hire you even though you don't have the number of experience. So you'll right here as I know I don't have the exact number of experience that you're looking for. But with the time spent on my lab, the lab that you'll be working with and helping out others with technical issues, other technical issues air that maybe you have signed up for a Lennox community forum or any other kind of technical forums which I would definitely recommend you that you should and go online. You have seen people have done tremendous work online. When you type some search uncle or any search engine and you want to look up for a technical article, you're gonna find tons of them. Now, how do we have that? Because people actually have spent on the middle numbers off hours putting together. So I want you. I would recommend you that you should also join those forms. Anyway, back to the cover letter is that you will say that you spent on your my lab and helping out others of his technical issues. And that can be quantified for up to two years of actual corporate level experience. Or if you think it could be quantified for one rigeur, that's fine. Put it there, which whatever that you think that it equals it, too. Then you put in the second line that I am Go to guy for everyone at my current job among family in France. Or if you have a specific skill that you wanted to replace, go to God. It's something. You replace it here. Then the next section, the dirt paragraph right here you're gonna mention even write down something about yourself , your biggest achievement in your career. That could be anything. Maybe you have won a championship and ports or in academic. Or if you are part of a chess club, anything that has made you proud. Please do mention right here. This will show the hiring manager that you have worked so hard for the Pacific achievement and you're so proud. So you are the kind of guy who couldn't work hard and you would prove him or herself. Then the next paragraph, you'll say my resume will speak about my technical skills, So that's good. So it's attached. It was talking about my technical skills. But here is a quick summary of additional skills that I'm really good at. And those skills are You're gonna mention strong interpersonal and communication skills. Keen attention to detail, analytical skills, time management skills, exc, excellent documentation skills. Now remember, these are a few skills that I have jotted down, and those skills may not reflect. How are you good at. But if you are good at in any of these, include that or if some of them that I have not included. Please include that and again, P. Please be honest here. If you are really good at time management, you really know how to matter. Your time doesn't really have to be a technical after that. In the last paragraph, you will mention that I am very much interested in speaking with you to discuss the value I could bring to Mandalay industry. Then you'll say I can be reached at above telephone number or email address. I look forward to hearing from you with best regard and your name right. And that core letter is for entry level people and for those who actually have someone a little bit of experience in I T. But if right here in this paragraph right anything that you I think that really gonna make a difference, this is a real important line or paragraph here. So that's about the cover letter at the entry level. Non. Let's look at the cover letter at experience, so experience level will start the same way the name, address, phone number and the company's name, address, phone number. And then again, dear Miss several, So everything will be the same. Except I believe that my combination of technical skills and experience right here because in experience level resume you will have experience, so you will add that here everything will be the same. Now, the second paragraph, you will say attached resume includes all the details about my career and education background. But here is a quick summary off Bob myself that will highlight how can I be the perfect match, and that is now you're gonna come out and say, Hey, this is what I have them you might not gonna see with other people And that is at my current position as a help desk technician, of course, replaced that to your existing title. I build, manage and troubleshoot hundreds of service. I provide first or second level of support to thousands of internal or external customers. Put the number in, said it could quantify what you have done. My professional experience includes diagnosing and addressing complex hardware and software issues. I also maintain the highest level off system security and educate users on the latest system updates and technologies. Then the last line. You'll say I have saved millions toe a company by introducing X y Z technology, anything that you have done and your existing position that you think have saved that your company money. Please included here. Quantifying everything that you have done is one of the biggest thing that you're NBS. Do they go to college? They spent two years, and that's what they learn. They learn how to quantify that I could tell the value to the business, then the last paragraph, you'll say I am very much interested in speaking with you to discuss the value could bring to vandal industry same thing as other cover letter, and then you close it with best regards and put in unique.
176. Linux Administrator Job Duties: job titles and duties. My students asked me this question After taking this course. What kind of job am I gonna be getting or what are my duties is gonna be what I'm gonna be working right now. Those are the jet questions. So here's the time that you should know one of the job that you should be applying for looking for and where you should be expecting to do when you get that job. So the basic job that you're gonna be getting is the I T technician, which is more off helped us technician job. I'm not telling you to pursue for specifically for this job, but ah, perhaps before those people who actually have never done, uh, any kind of work in I t or don't even have educational background in i t. And coming from completely different backgrounds, I would say, and I would recommend that they should start with I t helped us feel that's one of the field. That is very, ah, very information. You will get a lot of information about i t. If you already have some of them from experience in I t. Then I would say goal for system administrator job. A system administrator is an administrator who manages the system and system is comprised off what is comprised of hardware, software? Um, operating systems, networking devices, cables and all those stuff. All that combined together makes a a system, then the next one. Another higher level job is a system engineer. At this level, you will be designing your never your entire infrastructure. Meaning you You will be putting all the computers together. How many computers you need, how many CPU need and so on, so forth. Then, of course, it becomes in a senior jobs. He needs system administrator, senior system engineers, managers, supervisors and so on. So these are the titles that you look for. Now, let's talk about the duties. What exactly you're gonna be doing? So I have this Ah, or document. I'm gonna cover all the duties one by one. And, of course, really quick. Okay, so here is a document, and this document is also part of your hand out. You could download it. You could review it after the after this lesson. So the primary administrations possibility is that you will be dealing with installing opening system, managing the hardware form where service, installation and configuration upgrade Lennox servers recover that. My great offering system from older hardware to new Ah, hardware. You could do that by moving by installing a newer version off operating system, the new hardware and moving all application past management. We learned that from the jump Command third party software installation configuration that you're gonna be dealing with many, many different applications that's gonna run on your computer. Remember, we have a hardware. Then we have our opening system. Without the application, both of them are useless. So you do need applications to run on top of them. And once you run it, who manages that you're gonna be managing them? You're not gonna be like a really dealing with configuration off ed or using them. These users are different as the compared to you guys were gonna be installing it, then different type of issues or troubleshooting that you're gonna be dealing with almost everyday like services running slow, discuss down and Teepees not working. Mount issues cannot restart the service, can't get to the DNS review all of them one by one. And I I assure you I've covered almost 95% off all these issues in our training class, so cannot log in as root using ssh protocol. Incorrect Close name memory is high or full. What do you need to do? Backup is not working. Of course, Most of time. Back up as 1/3 party software, you're gonna be learning that once you're gonna be joining set up Cron job or schedule job , you're gonna be setting those up. Then we have, ah, documentation. Every job in I t, especially I would say, requires you to do the documentation. What? That documentation is that if an issue comes in, you documented how you resolve it. And if there is a new system to do the installation, you follow the documentation or you create your own documentation, then you're gonna be sitting down the meeting. Your manager wants you to sit down, give them the progress, support what you did the whole week or you probably gonna be meeting with vendors. We're gonna be coming in with new technologies to introduce new technologies. To meet is gonna be happen almost at least 23 times a week. So expect that additional tools that you're gonna be working with, like monitoring tools How you gonna? They're gonna be a monitoring tool that monitors your entire infrastructure. Right? So who manages that tool you, you manage? Is that toe documentation tool ticketing system? Every issue that comes in most likely is gonna be generated inside of a ticket. You get a ticket, you look at the ticket and then you resolve the issue, put in your resolution inside the ticket and close it. And that's also one of the way the management actually kinds of measures. Your performance. How many tickets you close how fast you close the ticket. So this is a way for for them to through to kind of quantify your performance. Then you have configuration tool. Other tools like red hat, satellite puppet kick star, active directory on different typos tools you gonna be working with when the relation red hat. If you're gonna be working analytics, most likely you're gonna be dealing a lot but red hat. So I would highly recommend you that you go forward to every website listed here, register yourself there. Sign up there. You will be getting starting getting the new release, new updates and everything to stay ahead of all the technologies that they have read had HP , Dell, Cisco, Vienne, where Third party. Wenders, Microsoft. All these companies you're gonna be dealing with almost every day because once the issues is not being resolved, most likely you're gonna be escalating to Wenders. Then third party applications support you're gonna be providing You're gonna be dealing with licensing every product that you buy. Are you every product that you have in your environment that you have installed, They you have to pay for it, and it comes through the license off course there is someone who has to manage it. Well, sometimes managers manage those licenses. Sometimes they give their responsibility to system administrator to manage that. So keep that in mind. Other job related tasks are like, you're gonna be beaten, you're gonna be on call. What that means is, if a team has six people, you're gonna be getting on call every sixth week. They're gonna be there going to be giving you, um, a phone, a laptop. So even you are home or in your home after hours are over the weekend, an issue comes in. You have to be present not at the office location, but present to root respond to that issue. So that is being on call. Be prepared for that recommendation you're gonna be recommending for new technology how you're gonna be recommending. Well, you have to attend seminars. You have to attend and keep, um, keep up to date with all the technology that has said sign of in all those windows A 10 training. You're gonna be going with a lot of training. The the companies are gonna be providing you trainings, project management, evaluate third party tools, which is more off a POC related tasks. So these are some off the jobs duties that you gonna be working their arm or there are less , depending on the environment, sometimes smaller, more environment. Sometime it's a bigger if it's a smaller, you might have to wear many different hats, make meaning. You're gonna be doing a lot of stuff, but it's good for you because you starting your career. But if it's you've been there, you probably wanna work for a bigger company that has ah, quiet, laid out infrastructure in the team and probably your duty is gonna be separated from each other. So that's what about it. So I hope you got that just often and good luck
177. Exposure to Other Technologies: exposure to other technologies. Okay, so now you already know Lennox, you know a lot about actually Lennox. So why do you need to know about other technologies as well? Well, if you are going for system administrations, trust me, they will ask you some questions about the technologies as well. And they expect ah, person who was fulfilling for a system administrator or engineer job to know a few things about some other technology as well. So this lesson is about that I would recommend you to go online low for those other things . Specifically persist ministry. The 1st 1 is about operating system. You know, Lennox, that's number one. Your your expertise are on the next. The 2nd 1 is about windows. You do need to know windows. If you are already a Windows user, you have a laptop or PC running windows. Perfect. Look for a few of the things how to change. I ps have to send traffic from one windows machine to another. Ah, few Windows Administration on YouTube if you want to marginalisation technology, the biggest one is VM, where there are a lot of articles on being where what technology is, how it works, and I will recommend you to go online and check out for it. Then we have a hardware in the hardware side. You should know what hardware are used to install your operating system. On the biggest market of hardware, it is Dell and HP. So go online. Go Dover del website or HPV upside and find out. What are the latest models that they have? What are the specs? Will help. What are the raccoons are how to access them? Read a few. A little bar hardware. So, this way, if you are in the interview, you could tell them that you know about Dell Server? Listen, or 7 20 or 16. 20 You work on it or you have you have knowledge about it, then monitoring tools. When you have environment that you are supporting, you do need to monitor monitor them as well. Right. Some off the monitoring tools are like nah, Geos Blanc and sent us. These are the type of technologies. I will recommend you to go online. Search for them. Look for them in YouTube. Cloud is another platform where a lot off virtualization technology is being moving to from William. Where are from redhead socialization to Amazon Cloud. What is an Amazon? But this is for you to find out. Amazon has many different products that they offer the product that you should look into on the Amazon cloud is called Amazon. Easy to stand for Amazon elastic cloud to which allows you to create your worship. Machines are built up your applications on the washing machines based on your requirement. So if you need an application to run from only 9 to 5 and then the machine, you don't want the resource in the machine. You could schedule that then, after 95 will shut it down. So this easy tool is a very, very efficient and valuable product. Look into its and read about it. This is where the technology is going to. We will be on on cloud sooner or later. Then we have operating system tools like redhead satellite, which allows you to download an update packages if you do not have access to the redhead portal. Kickstart Kickstart is an integrated product within the red has satellite, which allows you to automate your installation of Lennox Red Hat. Um, active directory Tool is also one of the important tools that you should know which is a product of Microsoft, lets you manage your users and groups. It integrates with Lennox s well DNS, which is being built by many different Wenders as well. And the pioneer. When I would say again, it's Microsoft, they are done. Amazing job, Indiana says. Well, look for DNS bills and configuration on the Microsoft platform. Then we have puppet chef or answerable. These are also the automation tools to automate your insulation. Nowadays, a lot of, um, Wenders or a lot of companies actually are asking for these tools. If you know them, I would say Spend some time on one of this technology I the puppet show for answerable bitch, But harder made insulation, then the last one is the database database is anything that had manages your data. If you have a big environment, you definitely need a database. You need to know what a database is, how it interacts with the application or the opening system. How the SQL Off Micro Spectacle database works, how skits installed or what are the databases that gets installed? The Knicks platform. So anyway, these are the few technologies. Please, please, please focus on them. Spend some time on them. Along with Lennox. Of course. You have spent so much time on Lenox, right? Spend some time a little bit more time on these technologies. This will definitely help you go through your interview process.
178. WELCOME TO MODULE 10:
179. What is IT and How IT works: what is information technology? That's a very basic question, and everyone should know that the true meaning off information technology is basically the transfer off information or data from one person to another, from one location to another to technology. What it really means is that you taking any kind of information and you you're taking from one person to another, and it's going from computers through computers that technology is the underlying technology. Now let's look at a few common questions that you should ask yourself, How about how our T shirt work? What is Is it transferring houses transferring well, it's transferring files, folders, pdf's images, videos, music, instant message emails, the whole bunch of stuff that you have saving your computer. And once you have saved that, you do share it and you share the people with the locations and the company to company, and when do you share it? But there is no time limit. You could share it any time during the day. And, of course, why do share it or why the information is being shared among people is because that information helps us makes decision solve problems helps helps us make right planning and eventually it saves us time. Improve our lives and it saves us money. And how all this happening is through the I T components and I t components are the ones of you will be covering and the later lessons.
180. IT Components: Harry will look at the components off i t. It will be a quick list and of course, we will be covering every little components in the later lessons. The major I T components are the 1st 1 is the hardware. The hardware is basically the first piece off computers. It's a it's a piece of break its plastics a tower where you installed the operating system on top of it. Then, of course, the 2nd 1 is the operating system operating system tells the hardware what to do. The applications and software, which runs on top off the operating system and his uses, operates it to tell the hardware what to do. Then you have networking, which actually is a weight to communicate all the computers together. Security. When you have all those major I t. Components together and they are sending and sharing information together, you do need some kind of security. Then we have on the right side enterprise level components. In the enterprise level components we have. The 1st 1 is the storage. Now, of course, you might not need the storage on the major I t. Competence because some off the major I T components are usually at the at the home or residential level, but at the enterprise level, people are companies do have large storage where they store the information, then the 2nd 1 at the Enterprise over. We have two database and we have a virtualization technology, and the last one, we have a cloud technology. We will cover each of thes components one by one in the later lessons, and he will tell you that which job it cars ponds to what type of job titles you should look for in these technologies.
181. Facts about IT: Okay, let's talk about facts about information technology. Now, I'm gonna go over the statistics that really numbers that I gathered together, which will tell you whether you have made the right decision or not, whether this I t feel is right for you or not. So let's look at a few of them now. I t role in our life is very important. Out days you have information technology or technology gadgets everywhere you have that in TV and cars you do shopping online. You have phoned full of technology. Then I t jobs are expected to grow by 22% till 2020. Now, remember, guys, we are into 2018 and in two years it's gonna increase by 22%. 68% off. Companies are struggling to find qualified I t candidates. What? It means that 100% of the companies that we have here out of those 68% are still having trouble finding the right person. Are many. I T professionals are making mawr than medical professional nowadays. Now this is not just a fact, but it's it's actually I have seen with my own eyes that there are I T people who are making way more than physicians and doctor and people who are in medical field. Now, 64% off the companies are investing in I t initiated companies that are not in I t. That are manufacturing clothes, building cars, building pianos, making carpets any kind of companies they need, i t. And out of those 64% of them are investing in i t. You don't need ah, high level of education to start in I t. No, I'm definitely not encouraging. Those who don't want to go and pursue their bachelor's and master's have definitely discouraged them. I am just telling people who cannot afford to go to college or who cannot afford to go toe for masters degree. You could still get into I t buy it going through some certification, some courses, and you gotta gain some experience and you could enter the I T field. And, of course, if you have a bashes, agree, and if you have a master's degree, sky is the limit and you will succeed in I t field so fast I teach job salary ranges from 40,000 to 400,000 again. It depends on your experience, your skills and, of course, your qualification as poor. Bureau of Labor Statistics in 2016 the median income off a bachelor's degree holder having an entry level job in i t. Is making above $100,000. Ah, US tech industry worker now anyone Any U. S tech industry worker. Annual wage is above $100,000 as compare to $50,000 off any other worker in any other sector. And the last one is and us in 2015 the jobs that were outsourced, the I T jobs that were outsourced were over two million. The guys that that's definitely definitely something wrong here. It means we don't have the right people. So we are spending our time in different fields. Not that there's anything wrong with other fields, but if you have a field that is growing so fast, so rapidly and companies don't have, don't don't don't can't find people to fulfill those jobs than than what ask yourself, Are you getting Are you making the right decision? But getting into the right field, I have to say yes.
182. Linux Around Us: everyday examples off Lenox. Here you will find out how Lennox Up bring system is used every way around you. Let's look a few of examples like Airplane. The in flight movies are on an embedded lyrics. Platforms. Internet access, Internet device Fi router probably have embedded copy of Lennox running for your Web management application. TV, Google search websites, smartphones, they all loaded. Would Lennox harboring system inside of these gadgets? Tablets, of course. The e books, the Windows data recovery discs, even they are vendors operating system are still running Lennox to do the recovery on the Windows operating system. Isn't that funny? Appliances, new appliances that are coming in now days They all have touchscreens and operations like that. They are running Lennox. And, of course, in the end, the self driving cars you will find. They are doing a lot of testing nowadays, and all those testing all those the opening system running in the self driving cars they are running. Lennox
183. Linux Operating Systems Jobs: after looking at examples off our bring systems. Now let's go or the actual operating system jobs, if you like operating system. And you wanted to deal with Obering System Layer where you don't want to touch the heart where you don't want to have a screwdriver in your hand and you just want to deal with typing and working with the operating system level, then the These are the list of job you should look into. The 1st 1 that I have is the system administrators shops. Now this is the primary and basic job off system Administrator is to actually deal with the opening system. Any issue that you have at the operating system, any type of implementation, you are responsible for installing the operating system. You're responsible for configuring the hardware. The first I when it arrives at your data center, you're responsible to upgrade its form where, if there is a need, yours possible to configure it through its consul, you install the operating system and you configure the operating system. So these are the type of job system that matures to. Also you deal extensively with operating system troubleshooting. If you have an issue and you. Most likely those issues are gonna get escalated from the PC technicians or I t helped us. They cannot resolve. It's a table Big escalated to you then. We have systems, engineers, systems engineers are those people who are actually been through the system administration jobs in their life. And now they are at engineering level, which is a one step up in this engineering level. You actually design the entire infrastructure. You actually build infrastructure together, not just one server, but many, many different servers. Then you have application administrators. They are also the ones who deals with building the websites, particularly any any of websites that running on operating systems. They there's primary responsibility is make sure that website is up and running. And of course, there are many different observers that you could utilize. One of them is a party that the one is a Tomcat. Then you have infrastructure engineers, infrastructure engineers are all in all there. The one who actually deal with many different components off. I t not just operating system, but they also deal with somewhat off hardware the deal with the operating system. They deal with someone of applications somewhat database and many that they actually touched many different technologies. Then you have a solution. Engineers solution. Engineers and architects are the one who actually designed put on a blue blueprint and put it together. How many servers do we need to build this entire data centers? How many servers are harmony? Storage? How? Maney networking devices. We need to complete this entire data center. Those are the people who actually deals with blue print off your infrastructure, Dev Ops Engineers now Dev Offs. Engineers are actually the title or the role that has been recently created. Um, I I should say, not more than 2 to 5 years ago. This is actually the combination off people who work with the operating system as well as who actually Ah, very fluent in programming languages. So not only they actually managed infrastructure managed assistance. They also want someone who could, right Did the codes. Who could actually know? Some languages in many languages are, like perhaps Joe R. C C plus plus and many of the languages which I will cover in the later lecture. So these are the people who are actually develops engineers. They definitely make a lot of money And if this is something that you want to get in, you always have to start your path from helped us to operating system engineer, infrastructure engineer. Get into more knowledge off the programming languages and to the develops engineer. Then we have field engineers. These are the people who actually work for the companys like red hot HP and all those big companies. And what they do is they actually go out on a field trip to a customer site for clients I to fix their computers. They there are also fixing the opening system as well as their hardware. These fetal engineers are the one. Let's say if they are from red hat, there's gonna they're gonna come on side and live there, issued, they're going to spend. They're going to spend some time to troubleshoot the issues with you. So if you are into traveling, if you are into working outside, you are not the person who wants to sit on your desk. Then this is the right job. Were you but again for this type of job, you do need to know the operating system and rich offering system that I have already covered that in my previous slide. Those are the list of operating system that you guys should pick and go over it then Product engineers Product engineers, of course, are very much similar to field engineers. However. Product engineers Onley deals specifically to one product. So if let's say, Red Hat has a product, a new product called, um virtualization, their new organization technology or their satellite technology or any product they actually have people who actually deal specifically in that technology. So when they sell those technologies out to the people to the consumers of the clients, then these product engineers are the one who actually traveled with the sales guys to actually help them sell that product and tell them about the technology. Then you have the principal engineer. Pretty much principal engineer's job is the same assistance engineer, but a lot more responsibility. Sometimes principal engineers are also the ones who have some type of lead. They also matter some system administrators. Then you have platform engineers. Platform engineers are Pacific Toe one platform. They If if a company has multiple operating system environment, most likely they're going to deal with one platform or somewhat. The most two operating systems then we have back and and data center engineers who are actually sitting at the data center or who often travel to the data center every time there's an issue off course. If there's issue day and you you will call your your Wender, they will charge a lot of money, or you might have to have a contract with them. But with the back on a data center engineer, they are most likely close to the data center will travel. There are all the time who are responsible for racking and stacking. The silver is building the servers, troubleshooting the systems. Then I have the implementation consultants. I will focus on the consultant part here because many of the job will most likely that you will be getting into will be the consulting jobs. What it means that you might not get into the full time job right right out the door. You will have to spend some time consulting. And I tell you, in a kid, you not if you will get into the consulting job, you will learn a lot because in consulting jobs you have to actually fulfill a task at a Pacific time at a Pacific rate. So when you have that kind of pressure, you learn a lot. And also, if you are not a person who I want to work for a boss, you want war for yourself. The consulting job is for you. There are advantages and disadvantages of consulting one as you don't get the benefits. For example, medicals and health insurers, whereas on the regular full time job on the W two jobs, you get all those benefits. But at the same time you have a boss you have to report to. So anyway, guys, this is the list off, um, job titles that I have covered under operating systems. Again, offering system is the layer is an operating systems, the software that runs on top off the computer. If you like that, piece that layer, and that's where you want to get your hands on. This is where you should spend your time and and how do you gonna get your spend time? And let's say, even if you are in Judah, me or any other website that our educational and they are teaching you courses, all you have to do is go in and put it in. Let's say Red Hat Administration or Windows Operating System administration or Mac administration. Our Mac operating system, you're gonna find tons and tons, of course, is out there That will help you understand those operating system. And, as you learned those offering system as you spend more time in it, I will encourage you to go do jobs for people, even internships, or learn a lot of body from other people who already in that field who could help you get into that field.
184. IT Management Jobs: So now, after looking at all the jobs related to the I t components, I wanted to go over What are the management related jobs that are in I t Perhaps you are already in I t. And you want to advance your career. Of course, the the way you could advance your career is by learning something new. Or you could spend and work really hard and spend a lot of time with in your current job and go step up to the letter to step up to the management letter. So let's look at some off the management jobs that are out there with an I T. Well, the 1st 1 is the lead. Once you have been working in any roll off, I t in any components after certain time, depending how you deal with people, your manager or your director will like you to lead the group and in, in that scenario, what you would be doing as you're probably gonna have a bunch of people under you. But they will not directly reported to you. Meaning you're not probably not gonna be doing the performance performance review you're not gonna be doing, um, you know gonna be approving their vacation or deciding their bonus. But you will tell them what to do in terms off building the systems or ah, working on the technology. So that is type of the lead role ritual, which will be the first step that will get you to the management letter. Then, of course, we have supervisors. Supervisors are the one who have, ah group of people that they manage. Of course, the manager manager is the one that managed entire team. It could be, um, a team off systems or storage, or they they will be managing the group within the I T department. And as I said, there are many groups in I t department, and those groups are differentiated by looking at the components. You will have a storage group and networking group, a security group, a Windows group or Lennox groups. All those groups are different, so there will be a one manager for each group, so you could have a systems manager. You could have a storage manager then the director, not director, is the one who actually manages the entire department, meaning they will be managing not only one Pacific I t field they will be managing networking. They will be managing database storage systems. All those I t companies we talked about, they most likely will be under one director. Then we have the Weiss president who will be managing not Onley one department, but several other departments. And of course, you know about the C, T o and C I O
185. Post Resume and What to Expect: post your resume and what to expect. Let's talk about what will happen when you post your resume online, for example. Are indeed CareerBuilder zipper cooler, monster all Whichever Webb said you prefer your eyes may well be searched by HR order Cruz , based on the resume title or the keywords you have inside off your resume. Now, who are recruiters or HR? Good question, huh? Okay. Recruiters are all sort of food as headhunters. They were independently to find the right candidate for the right job. Sometimes they have exclusive relationship, um, contracts with the hiring manager and companies prefer to work with recruiters. Why? Because they specialized in that field. Recruiter, sir. For all the different kind of candidates online, Short list them, they go through the academic background or experience. They performed initials, interview and set expectation off the job duties to you. They also tell you the salary the raid present you to the candidates, represent the candidates to the hiring manager and set up the interviews. So please remember one thing. The recruiters are your best friend in this entire process. They will try their best to get you the interview. They go think of them as your agent who's working on your behalf. But at some time, if you do not qualify, then they will drop you. Why? Because they don't want to tarnish their reputation with the Harding manager as well right now. Who are the HR people? HR is a human resource department in a company who deals directly with the candidates. In that case, that's you. They usually do not search for you online. They will only contact you if you have applied directly on the company website or through one of those job search websites. If you do not qualify for the job requirement and simply, an automated email will be sent out to you indicating that you know what they're moving on to with the other candidates. But if they like a resume, then they will contact you directly to the phone or email and and you, whatever the email that you have specified on your resume. So that's what actually the recruiter and hrs. So let's say what will happen in the second step when their crew calls you right, they search you. They see that through the perfect candidate. The quicker will send you the job description and cause you to go over your experience and qualification. He or she will try to match your job requirement or skills. This will be your first initial round of selection at this time if the recorder feels that you're confident that you can be the right candidate than the conversation continues to the next step and the next step comes in that the courier let let's call the recruiter. You know what? Let's call the recruiter Lippman. Mr Lippman. So Mr Lippman would tell you if the job is a full time or if it's a country consulting job . Full time job is when you are working directly with the hiring company. Um, like a full time person. A consultant is someone who works either, like independently on 10 99 or on our W two, which will be like an employee off the recruiting agency. By the way, the 10 99 or W two are the text terms used in the United States. It could be different according to the tax document, off your country on any of it. Mr Lippman, who's of course they're recruiter, will specify all the details off front. He will also tell you that your ocean off the consultancy eso consult. Since consultancy could be anywhere from six months to a year could go for any specified number of years. Well, now the money port. Mr. Lippman, at this point ask you about your salary expectations or you're al right? So tell him that you are flexible and willing to negotiate, or if you're already in i t Then you should have a better idea what you should ask for. Well, when you agree and you agreed to the rate with Mr Lippman missile, it never send you an email that he would ask you to acknowledge the rate confirmation and reply back. And, um, he will also ask you to send him your updated resume if there is some updates required. Oftentimes this email will also have some questions for you to fill out. For example, your full legal aim. Your address, your telephone number if you are authorized to work in that country Also, your last digit off your Social Security or your birth state. Now, please don't be scared to provide the information. Why? Because they're not here. Those schools are not here to steal your identification. This is the way they how how they keep track of candidates in their database. Okay, So the next step is that Mr Lippman might ask you to talk up to his manager, um, who is also in the recruiting agency. There will be a quick, like, 10 minute interview with Mr Lippman's manager, who will also go through your resume and your background. If you're ready to be presented, Um, then the next thinks comes is sometimes Mr Lippman or his manager will ask you to come and meet them in person if they are in the same city. Of course, this will be the perfect opportunity for you to go and meet them and start practicing your in person interview skills. You can deny it. It could deny the meeting requests, but perhaps you know what? It might not. It really works out good for you. And it might affect your chances of presented. I recommend that you should, you know, make appointment and go and see them. Okay, so now, after you see them, or after you talk to them after all the conversation and formalities done with Mr Lippman, your resume will finally be submitted to the hiring manager. It can take anywhere from two days to a couple of weeks for the higher for the hiring manager to get back to Mr Lippman. Oh, this up. Once your resume is reviewed by the hiring manager and short listed, then what happens? Mr. Lippman will be notified, of course. And the request for interview would be placed. Mr. Lippman, of course, will reach out to you. Um, with a few interview time slots, pick your desired time, sort, of course, And start the preparation. Start, get ready and go where? Your preparation. If the hiring manager does not like your resume, then he will notify Mr Lippman. And if you don't hear back from Mr Lippman for, like, let's say 3 to 4 weeks, then you should assume that it's a no. You can always call Mr Lippman follow up. But most of the time they're so busy that I would say, you know that them work on their schedule and you could move on. Okay, so So let's be optimistic here. Right? You are scheduled for into perfect. You get the call. The first interview will most likely be a phone interview, and it can be it can last for an hour. This can include technical questions as well. Okay, so a couple of days later, you will get a call from Mr Lippman. Um um who will provide you the feedback based on your first interview? And if you have cleared of your first interview, then he will schedule the second round of round of interview with you. This will be most likely an onside in person interview. And it could include additional technique questions. Those be ready. You will meet with the team, so make sure you were dressed with a suit and tie and present yourself professional. Okay, a few days go by and your full moon real ring and Mr Lippman will give you the great news that you have been selected. And the hiring manager is ready to offer you the job off course. Yes, you, of course, jumped off the bed and asked for more details about the start date. Right. Okay. Mr. Littman will send you all the required paperwork to fill out. And you will have to sign the offer letter. Of course. Also, at this point, you might have to go through some background check. Keep that in mind, which might include, like education history, check our experience sometimes also include criminal, criminal background check and also drug tests, depending on the hiring company requirement. Um, well, when you start the first day, then you'll feel that your hard work has finally paid off. Congratulate yourself.
186. Interview Workshop: interview workshop. Now this is the time where you have to shine. Improve yourself that you qualified for the job. Think of yourself as a car salesman and you have to sell yourself to the hiring manager. What are the things you are proud off? What do you do? What is your education background? What have you done in the past? You need to speak all of the's feature to sell yourself, usually into last for an hour. You'll get a call from the hiring manager or you will be on site meeting with him. Well, um, let's call the hiring manager. In our scenario, let's call him Russell and did use yourself to everyone. If they're more than one people, of course. Tell them my name is Imron. Absolute, and thank you so much for your time today for this interview, the hiring manager Russell will introduce himself or others. If they are. More people on the interview pound well, the 1st 5 to 10 minutes it will be utilized to give you the company overview like what does the company dio, how long they've been in the market, what they have done or what they have achieved make sure to research the company before you go for the interview. This will tell that you are encrusted and I have done your homework. Now, the next thing Russell will tell you about the job itself, he will go over the quick description of the job, what they're looking for, why they are looking for the number of people in their team and things like what they will expect from the new person. Or you make sure you write this part because this information will help you answer according to the requirement. For example, let's say if Russell mentioned that we are looking for someone who's like a team player or someone who could improve for their documentation sector, then later you could. You could say that you have worked as a team or have done a lot of system documentation stuff like that, so you could add that to your conversation. If you are in person doing the in person interview, then make like a mental note about this before Russell start talking or start asking you question, he will mention about the interview process. He will lay out how the interview will be conducted. How much time will be spent on the technical questions. How much time will be spent on the behavior question? And then, in the end, there will be some time for you to ask questions. So explaining this interview structure is what I would say a great hiring manager due to stay on track. Okay, so all said, All done Now, one of the most favorite question every hiring manager asks. And that is, Tell me about yourself. You should take anywhere from, let's say, 5 to 10 minutes to answer this question. Now this is Thea Pertuan ITI To sell yourself, you should break down your answer in five categories. Category one. Start by introducing yourself again by saying again, my name is Imron Absolute, and I'm a systems engineer by profession or whatever the your profession is. My expertise are like Lennox VM Ware, Windows Technical Training, Project management So on. So basically list all. Let's a quick summary off your skills in Category two off. Tell me about yourself. You'll say I have been working with the company. Let's call it art when delay industries for the last so and so years as assistant administrator, or whichever your your title wars or happened the title. Okay, so if you are not an I T than again, really quickly, go over your day to day tasks but don't spend more than like 20 to 30 seconds on it because they don't want to know all about what you they're not looking for. Focus more on the technical side. For example, if you are in sales and you probably working on POS system, so it's a pos system or sometimes your troubleshoot technical issues related to it. If you don't do any technical work at, then don't lie about it will make up things. Move on to mention about your lab, how you started and how many hours you have spent to learn how many hours you have spent each week to manage it. You break it, you troubleshoot it. A different issues next mentioned your previous job. If you had one once again, goal were quick summary of your daily tasks in Category three off your tell me about yourself, I would say after the experience, tell Russell about your education background. You should be proud of what you have achieved as academics, which college quality went to and what was your major. If you majored in accounting or any other concentration aside from computers, then now is the time to tell why you decided to move toe. I t now in category four off. Tell me about yourself. Bring up your interest. Like on your spade time. You like to play soccer, Wash movies, help around the house. Tell him what you really enjoyed doing in your spare time. Next. And of course, the last category that I have defined and tell me about yourself is tell Russell why you want to leave your crunch job to apply for this job. Perhaps your contract with the existing company is coming to an end. Or you're looking for a career advancement where you can apply for your technical skills or simply want to start your Korean. I t mention about your documentation skills because remember, he brought this point during the initial conversation. Right? Ask yourself, What is that one quality you have that your competitors does not have. And tell that to Russell. Next one we have is why do you want to leave or what are you looking for in your next job? Now? You know we have covered this question in the last lap, one of our last category. But many times hiring manager include this question again. So you could, you know, rephrase what you have said. Then the parts start off behavioral questions. These type of questions are one of the way for Russell to find out your personality whether you are the right fit for this environment or not, it can take anywhere from like 15 to 20 minutes to answer them. Um, he will ask you questions like Like, how do you handle a difficult situation? How do you meet your goal if you face an obstacle? How do you handle differences of opinion? These are the type of questions that shows your behavior. Now remember, you don't have to be in a corporate environment or to have an I t. Job to answer these questions. Be phased thes type of challenges almost every day with our family, our friends, or even during a situation which is, like, unrelated to any relationship. For example, let's take example, Um um yes, you are at the airport, right? And you are given two options. Either wait for actually you, Mr Flight. And so you have an option to either wait for a second flight, which will leave in eight hours from now. And we'll get you from point A to point being. And of course, from in two hours, let's say or you could rent a core and dr for six hours. So which one option is better for you and why pick one on the other? So think off a situation like these and answer these question accordingly. I'm sure in your life you have faced these three questions in your entire life. I'm sure about it. Okay, now becomes the technical part. Now let the fun begin. You will be asked signal question back and forth from 20 to 25 minutes. Sometimes technol questions are made up off a situation. For example, what if you have to run a script at night, but you are not available at night? How would you manage that? So these see, it's a situational question, but if you answer by saying off course, you scheduled a job, Okay, so now, once Russell and the team done asking all the technique question, now it's your turn to return the favor. Ask them questions like what is a typical day looks like for this position or if it is a contract position, as if there's a possibility to become permanent, this will show that you are committed. And how will you measure the successful person that they will hire by? These are the type off questions that you should ask. Now, of course, you don't have to ask exactly what I said you could You could come up with your own questions. Of course, depending on your situation. Now, before before you say your goodbyes and shake hands, you should say a closing statement. So this is all about the interview that I want to cover. But at the end, before you leave, remember this. Anything you should say that will stay with Russell and we'll keep him reminding off you when he is actually going through interviews with other candidates. Now you must be thinking, What could I say or what could that be? Well, of course, it all depends on you and what you are good at. As an example, I give you a few examples, so you will relate to them. A few of example, like before I leave, I want to say one thing, Russell. If you ask me something and I don't know the answer. Then I'll tell you, I don't know. But I promise you that I will work on it, and I'll get you the answer. So this is, like example off what you could say or another example that I have is before I leave, I want to say one thing. I might not be the smartest or most technical person, but one day I will make you proud off your decision for hiring me. Right? So this is the thing. They'll stay in them. Right? Okay. And I could give you an example. Um, before I leave, I want to say one thing. Russell, I might not meet all the requirements for this job, but I definitely being loyal to you, and we'll be there whenever you need me. So even if you want to pick out of these three, that's okay, pick, but make sure whatever you say stays with him. Let me tell you a little secret about my career. Long time ago, um, when I went for my first job interview, the hiring manager met me, and he actually hired me without asking any technique question. I'll keep in mind. I did not have any experience. So anyway, I was hired. So a few weeks later, I started my job. I asked my manager a few the few days later that why didn't you ask me anything? Technol questions. He's like when I like. When I came for the interview. Okay, So he stepped back and he looked at me and he said, Because of your attitude, I knew you were hungry to learn and willing to do whatever it takes. Tell what I learned that day, guys, that it's not what you say. It's how you say it. It's a good luck.
187. Join the Linux Community: join the community. Now what is a community community? Are a bunch of people's Teoh come together to build something for one cause? So Lennox, think of less. You know so many things about Lennox right now. You know that Lenny's is an open source and it is built, but people like yourself. People have spent time out of the busy schedule out of out of any interest off making money , spent some time added code toe limits. Now Lennox has become one of the major opening system in the world. So those people who have participated in the community there are websites. They're t r blog's and forms. So those are the people who actually have made a difference in this world. And now I want you to do the same. This is your turn now, and especially for those who do not have any experience, any prior experience in I, t or Lennox, some off those community forums or blog's that I have listed here that I really like and before our center west out or then his questions that pork lettuce forum, start work, Lennox dot org's and anything that ends with dot or you should know that these are just the organization, non profit, our position. They're not there to make money, so go ahead and support them. Put your give you a full participation, your full attention. And there are other ones, like clinics dot com. How to get dot com. That's fine. You could join them. They also do a lot off good work for the community. Also, these thes websites and what these forums are used to troubleshoot issues of, like riel issues or people that actually worked in a corporate environment. So what they do is they troubleshoot. They haven't issue the troubleshooting, they can resolve that. They go on to these community websites and they post their issue there. So people who are joined and they all get the alert organ, the notification that this person seeking for help so you could go in and actually troubleshoot those issues for them and that troubleshooting will count toward as your experience that you help someone in those in that community. Then there are other website of the social Media website like Facebook, Twitter and even you too, if you if you go back in the history and really look for the purpose of you to why it was developed. Well, the main purpose of primary purpose of YouTube is to spread knowledge. That's how it was set up. Now, a lot of people use it for different purposes that is flying. But the main purpose was to spread knowledge. Also, look at the Facebook people use Facebook for many different reasons now, especially where the aid, what kind of pictures they post. But really, if you take advantage of social media, you're gonna learn so much. And there so many communities out there for Lennox that are built, their groups that are built in Facebook, that actually share resource is from one another. So these are a few communities that I really want you to join, and this once you join them, you could actually quantify your hours being spent helping people. So let's say if you have joined the community center west are orc and you help people troubleshoot issues like twice, two times a day and takes you two hours one hour, three hours. Count that number of farmers towards your experience you could go to your resume and put it sent to us that or and put it the number of hours You work, there are number of hours. You help the community that counts. Yes. Trust me, that counts. People do. Look at it that you are a person who help the community and that mix, and that will make a lot of difference. And besides, whether it is good for your resume or not, if you help someone you know there's truth. The universal truth is what goes around comes around, you will be helped. I promise you that. So please go ahead, join the community and help people.
188. Redhat Certification: Red Hat certifications. Now, you probably thinking at this time, should I be doing some red hashed certification along with the course that you have just taken. Well, it's really up to you. The more certification or the more achievement that you have in life, the better is. So in this lecture actually I am going to show you exactly what are the different certifications that are out there are that are available or offered by the red hat. We have learned in this entire course everything about CentOS. So just remember again, CentOS is exactly the same thing as Red Hat. So if you have completed everything in CentOS, you are pretty much have done everything in red hat. So basically there are three main redhead certification that you could go and take the exams for. Number one is Red Hat certified a system administrator, which is referred as r h CSA. The second one, R H C E, Red Hat certified engineer. And the third one is a red hat certified architect. So the first one, a red hat certified system administrator is is has a has an exam that has a name which is 0x 200. This certified examination in order to for you to qualify for this exam, you of course, have to pay for it. You have to register yourself to have upside. Pay for the exam, which is about $400 US dollar as of today. And you do need some Linux administration classes. So Red Hat requires you to take a couple of Red Hat system Linux administration classes. System Administration one or two. But if you have taken this class, Udemy class, it should suffice your requirement. Also, if you do not have taken any classes and you have Linux system administration experience, then you don't need to take any class to go for this examination. So that's about the first certification. The second certification is red has certified engineer and also referred as E X3 100 as an exam name or number. What you need to be eligible to take this exam. First, you have to be a certified system administrator. You have to you have to have that exam taken which is 0x 200 Before you could take this exam. That's the main requirement. And of course, it has the certified engineering requires you to take advanced level classes like such as Colonel tuning and petitioning and grubs and how you could fine tune your system and a lot of other stuff. So I'll cover that in a minute. Then the Lasser vacation that we have is what has certified architect, which is the highest level of all the certification. This certification, you must have our CSA, which is a system administrator. As well as you have to have our HCl as a System Engineer certification. And you also need in order to attain and maintain RTA status and art HCI must pass at least five other Red Hat certification. And what are those other certification? So let's go ahead and take a look. I have opened up Red Hat website and I am going through each one of these certifications so you will understand what each of these certifications are and if you are actually ready to take those certification. So let's go on to our browser. I have I'm using Firefox. You could use anything, of course. So the first one I have is red has certified system administrator. By the way, all the links that all the pages that I'm covering here, their lengths are already in the handout section. There's a handout document attached, which actually takes you and you open it up which will take you to those links. It has all the information about the pages that I'm on. So you don't actually have to type everything that you see right down the screen. You could actually copy it from the document that is attached in the handout of this module. Okay. So the first exam, as I said, it's a 2.5 hour exam. It's a first redhead exam is called 0x 200. It's to become US red has certified system administrator. And I could tell you one thing. If you have taken my class from top to bottom, you will definitely ace this exam. There might be a few questions that are on security side that you might not be able to answer, are not familiar with or do not have exposure to it. But I will recommend you to go ahead and search online for them a little bit and you'll be able to find out some acid and what are those? I'll find out in a little bit. The cost of this exam is $400 US dollars as of today. And in preparation the study points of the exam, what you need to understand and use. So it says RH CSC exam candidates should be able to accomplish the task below without assistance. These have been grouped into several categories. Meaning they, all these categories that you see, they are going to ask you the questions. They're going to be about 200 questions. They're going to ask you these questions. And all those questions are going to be based on these topics. And those topics are as if you could read through them one by one. You will find out that we have actually covered everything in our training course. So understand and use essential tools. Like, uh, grew up creating a file, editing a file, deleting a file. Operating system reboot system booting system CPU, how to check, identify start and stop virtual machine. Start and stop check this. Ad networks services, configure Local storage. This is our module eight, create and configure file system. Going back to our module eight as well as our module 34, deploy, configure, and maintain systems, go over it and see what are the things that you have not seen in my core, manage uses in groups. This is, I believe Module five, managed security. Now this is the part that I should tell you that some of these things I have not covered. But it does not mean if you do not do not have any experience or you do not know anything about it and you're gonna flunk the exam? No. If you cover these topics, these main topics all above, then you skip the entire section. You could still pass the exam. I could tell you that, but I will still recommend you that you go ahead and Google it or put or search it online, or go to any YouTube or anything. There we go, find information about these topics and just read up on them, brush up and so you understand what they are. So anyway, this is about Red Hat, certified system administrator, very basic exam. Everyone should take it up. I recommend if you have not, it's very easy to take 2.5. our total time. The next exam is Red Hat certified as engineered. This is the high level exam and of course you need to know a lot more then just a few of the basic system administration type of stuff. This requires like a fine tuning kernel tuning and a lot more I'll cover in a second. So the time for this exam is 3.5 hours and the cost is the same as E X2 100. So the cost for this is 400 USD as of today. And in preparation, this is what you have to System Configuration Management. And if you notice it, stocking urban network teaming and bonding, we covered that. Configure IPV6. We have not covered that, so you can look it up. Traffic, IP traffic routing. We know that firewall, we know that configure a system to authenticate using curb Kerberos is that we have not covered some of the stuff we have not covered. Now, processor, memory, disk, network, everything we covered, shell scripting. Of course we have code that module six, network services. We have covered a number of services, HTTP, how to configure your HTTP server? How to configure your virtual host if they are talking about a virtual host on the Red Hat environment, no, we have not covered that, but look it up. Dns, we know how it works and fs, SMB, SMTP, SSH, NTP, database services, backup and restore database. This is more on the bag back-up site, but we have brushed up on this. So again, if you look at the requirement and the recommended training study, you will see I am confident enough that 80% of the stuff that is listed here I have covered in my course. So anything go over all the bullet points, anything that you see that I have not covered. You can either tell me and I will try. I will not promise. I'll try to add that to my course. If not, then I will recommend you again go online and search for that. And also by the way, I will try to create a new course that will cover everything that they have requirement for these two certifications. Alright, moving on to the third and last certification, which is called a red hat certified architect, which is the top top notch high level certification. After that, you don't need to do any type of certification. You become kinda like Red Hat Linux kernel. And I would say most of the people like developers and people are in DevOps and who are actually writing codes, who have 151620 years of experience in Linux. They need to enhance and spend more time in Linux. They are the people and that they are the right candidate for this type of certification. You can read about this. And now, just look at this one, as I said before, to attain and maintain our HCA status. And our HCI, meaning you once you become our ACE, you must pass at least five of the following exams and keep this associated certification current. So in order to be in order to take this exam or in order to be a certified architect, you gotta take five certification exams out of this list or so on. So again, that's a path that's way, way ahead there. I hope you get there one day if you really are into their certification. But I would definitely recommend you The first one, which is Red Hat 0x 200, very basic. And I will definitely say, go ahead, we'll write after taking my class. And as everything is fresh in your mind, you can go ahead and register for it and then take the, take this exam. And I'm very, very confident that you will be able to pass this exam as Dowd doing any other more studies. Because I know a few of my students have already done this. They have only taken my course, and they have actually passed this exam without any problem. So again, three exams just you need to remember three certifications. One is red has certified system administrator. Second, red has certified engineer. And the last one is Red Hat, certified architect. If you have any questions, always send me a message. I'm always here to answer. And if you need any advice, please do. Let me know. Thank you. Bye.
189. Welcome to Course Recap:
190. Commands We Have Learned: while What achievement? You have spent so much time on this course. And now finally, you have finished it. And now it's time to do a recap and we will go. Were off commands that we actually have learned in this course. Do you know how many commands? So far, we have learned in this course, take a guess. Well, approximately we have learned about 146 250 commands. So to be Pacific because I will be adding a few commands later, or I have added a few commands now that are not poor fit, but anyway, approximately we have learned 150 commands. That is awesome. Guys, you should pat yourself on the back that you have done an amazing job. So I'm gonna cover in this lesson or in this recap all the commands that we have covered. So let's go over my spreadsheet that I have an open and at the same time, I have a window terminal open toe, my Lennox machine. So go where one by one. So the first command I have right here, every command you'll see, they are all alphabetical, um, sorted. So they are starting from a all the way to Z. So we'll go where one by one. So the first command of you have is it here is Alias. What doesn't Alia's do Alias creates a shortcut or a short name for a long command. So if you just type, simply tell us, and you will see all the releases that already been created for you to remove an alias you could, just to analogies. Then we have Ark. Ark. Is the command that tells you this. System architecture, whether 64 bit or 32 bit add command is used to schedule ad hot jobs, meaning there is a command called Cron Tabs. If you want to schedule a job repetitive Lee, or if you want to schedule a job just one time, you'll just type at command. And the complete sentence can be found by Running man at at and you'll find all the options with that, Then we have walk. Our command shows the output file by field. So if you do LS Mines, lt are in your home directory. And let's say, let's say you want Teoh list only the first column. So then you do that. It's myself. Tr your pocket and you printed the dollar one and you hit. Enter and you'll get only the first call moving on. Then we have bash. Bath is just a shell. It's just tells you what shells you are running. So if you do echo and do shell, you'll see our bash. Our shell is bash. Then we have B. C. D. C stands for Kath later. If you want to do some computation, some calculations. We just type B C. And you get into Catholic for more than just simply type of calculation, like two plus two it entered. I'll give you the four and, of course, to get out of factory just to control sea to get out of it. Then we have kale. Callous for calendar case. Case is a script that provides the options that is used in a script. Um, and it gives you the option. If you wanted to press A or B or C gives you the option, Cat is to read a file. Then we have CD is to change the directory some of these commands that you already know by heart, So I'm not gonna go into details. Change age. This command is used. If you wanted to change the properties off a password when the password should expire or not, we have learned that. And I believe in martial three and change group to change the ownership off a file in a directory group on issues. Sorry, Chase Modest change five Permission Changed ownership as a change file ownership meaning, if you are doing that s minus elf. You'll see this is to change the first column. You need to use change. Mod. To change this, you need to use change group and to change this ownership you need to do is change own. Then we have the next one is Cron E C, which is a new A program that is used for NTB system are and to be service clear is used to clear your screens who simply type clear help clear up the screen. C and P is to compare files bite by bite command, then dash dash. Help is if you want to get a quick help on any command that you want, then CPI is to copy files and directories. Very simple command. Create ripple. This is a command that we learned and I believe in module. Eight men be actually many module seven, I believe. Sorry. And then we wanted to create a local repository to download the packages. Then we have Cron tap. This is to schedule the jobs. Um, whether you want schedule one time job, a regular job cut is to cut the characters or feels in an output. So if you have this mind salty or or cat or whatever you're doing So if you want to cut the first character so you will do cut minus C uh, one. This will give you the all the DS in the every line. So you had entered and we'll see. I'll give you all the DEA's so this will cut is, of course, you have practiced that That we have date is give you the time and date DD converts or copy a fall just like copy. But it is mostly used to do the backups. Then we have deaf DF file system this space using when you do DF option minds age get the space utilization of the entire file system. Um, next one, number 27 command def. Compare files. Line by line. Dig is the DNS lookups utility. Remember We did that in a lesson in module seven, where we have to. If you want to find out the i p address the host name we use dig or and it's look up. Same thing a DNS utility de message. It's a print colonel ring before or if you want to see system messages, any hardware related messages, you just simply type deep message. But of course, to run the message, you have to be route. So just be careful, because if you run D message right here Ah. Oh, okay. So sorry. You don't have to be rude. You could just run. There is another command at his D m I. D. Code, which is the next command for this command. Yes, you do have to run. You do have to be route. So let's see the right here. Say's permission. Deny. So you have to be ruled. This one tells you about the system. Information too hard for information. What is the CPU memory you have in your system? Moving on? Do is the commander is used to anus scripting language with conjunction for the four loop or while loop script ings. Then d'you is used for file space usage. If you want to check a usage off a Pacific file, let's say I have this file in my home directory. Let's say pictures for my to know the space I do. Do you mind? S H Pictures tells me it is zero byte. So just like that, you could pick any off the files through indie use base minus H, followed by the file name or director named Get Pacific Sighs. Information. Um, echo. It's just a display input on the screen. It's nothing but whatever that you type like Echo M Ron so springing back in Iran. So it's just like as if you are standing in the middle of all the mountains, that you echo your voice and your voice comes back. It's just like that. This is kind of a tool that our command that is mostly used in scripting and, as you know, scripting we have covered in module six. Then we have else Else is also a scripting. Command works in conjunction with four Loop. It is used in a to create script than either tool tells you the information about the nick . If it is speed, it's the properties off the neck. Then we have exit exit assist to simply exit Your terminal F disk is to display disc information. And of course, you need to be rude to run this command. If there's my cell and says permission dies a B route. So let's see become route. And now if you type if this ca minus l you'll see all the discs that have you have available in the system. We covered that modulate, then foreground. Bring a process in the foreground. A fee is again used in a scripting language with conjunction with If fine is to find files and directories, then firewall CMD Command, this is the command. This is a commanded to enable firewall or configure viable. It's a command line. If you wanted to use the Kwik, then you run firewall de us, Um, actually convict, which brings up the gooey for Well, sorry. There is no de here. It's just fireable. Dash couldn't think so. When you run that it brings up, agree to, um, configured viable. So quit out of it Then we have four again for is used in the scripting language free. It tells you how much member you have used available FTP to transfer files from one system to another group. We learned that as well. Believe in Module three to grab a Pacific keyword from a file or directory or directory structure. There's another command called Equal, which is an enhanced war version off grub, though If you want to learn that as well do man on decrypt, we'll find that out. A group at is to create a new group, Juices New Group, then group to lead. As you could say, it's a leader group. Um, then be heavy covered in system administration module guns. It is to compress a file. Jesup is to compress a file. Both use the same way. No premium, not different. Different tools. Halt. If you want to sell shut down. Desist immediately without waiting on the process head. If you want to get a few top lines off Ah files. If you don't specify an option with the head, then it will give you the 1st 10 lines by people. History Commands tells you how many commands have been ran in your terminal. Host name tells you the host name off the system. Host named CTL is a utility or command used to manage the host name. Who wanted change? The horse name you could use Host name CT Eldest is in your command or new utility introduced in dread Hat seven or sent to a seven. I. D. Is just print user information. If is the scripting command works Conjunction with tea. If convicted, tells you you're notebook information If you run if convicted, he ran that many times. And you should know this command by heart. If down. If you want to bring down the Net Book the nick. Let's if you want to bring this down, you run If down followed by this nick name right now she seeds up right here and running. Um, if up again, opposite off, down in it As you want to bring the system in different levels. We talked about different levels from level zero through level six. So they're told seven levels. What are those? I believe you know that if you forget any of these, please go back and review those modules. I o stat, is about input up with status. Um, what is being coming into the system? What is leaving the system? Then we have I p gets in your command, which will be replacing the if convicted man does the same thing as if convict, um, I P tables is a no older command, which a few system still has it. Things commend have been replaced by the New York Amend firewall dash CMD or Firewall dash . Convict Kill is to kill a process by process i d. Last shows the listing off last log and users less is the opposite of more. And you guys know what more is right if you want to read of all one page at a time on a screen and you just mawr. And if you wanted to do the opposite off it than you do less Ln tell me what Ellen is. Well, it's to create a link. It's that simple located. If you works the same way as if you are trying to find a file, the only difference between five and located is located. If you're creating a far right now and run locate to find out why it won't work because there's it another utility update DB Command that runs every day, which will tell the system Hey, this system there is a New York file that's been created. So if you want to use, locate command right away. Run update, DB commit. Ellis, you don't tell me you don't know this combat. Okay? Every create is to create a logical volume. It's covered in a module eight display is too displayed a logical volumes male and to send mail. If you want to send me up from one system to another or from outside of the system. Man, these used man commands many times very helpful command creating a directory. You know that. And then keep moving onto number 76. Make file system. If you want to create an XFL, if I still system If you If you adding a new disk to the system, then you were creative. All assistant, this is covering modulate makes swap swap as something that is taken out from your hard disk. And once you dedicate some space from your hard disk for you so up, then you will run the command and K swap again. It's part of module eight mod probe program to add and remove modules. Recovered this command if you forgot about it. Because of this, when we are doing a nick bonding and Nick bonding is a lesson that is covered in module in module seven. Yes, more. We just talked about more. Mount is used if you want to mount a file system uses command in Module eight. Move is to move file for around from one system to another, be covered that in the earlier Mount Modules move is also used to rename of All Right Yes, Nets Stat is telling you about the network statistics. Um, you could choose many different option and a lot of system it Mr Is use nets that to troubleshoot many issues. See tells you was coming in. What's leaving about only the network status related things I usually run this command, as Net said are and me to check the system Gateway I P. Address and stuff like that. Too nice. Nice is to prioritize the process. I think it's a part of the system Administration of the module. Five. Check if it's not modified than probably your margins. Five. I think yes, this. If you want to run a process and you want to prioritise with different levels, you go on Nice. No help is the command to what interruption upon terminal exit. What Does it mean that if I'm running a command right now and I close this window, it will also close my program. So you run no up Did recover that, of course. And it's look up just like Digg. Then we have anti P. Q. It's in that NTP utility just like Ronnie C. It tells you which system. Um, what NTP clock that we are some sinking too. So if you run a DP Cube, it brings you to NTP que mode and then you run piers Oh, it's his connection Refuse. I know why. Because we remember we stopped and tp and we ran cronies Connie deep. So the new actually, that's what we cannot get the connection. Anyway, If you're on the older system, you will see the NTP Cube you to be there. If not, then run Cron E. C. Then we have password to change the past for very beginning lessons. Paying beginning lessons or seventh lesson seven module pipe if you want to pipe is mostly used to change the output off a command. So if you do ls minus still and you want to view or the second column that you pipe it to another command, which is that they talk and print. Let's a second call and I'll give you, um, second column. Yes. Okay, so it will give you the second club. Actually, I wanted to get the third call. They don't give you the dirt. In many ways, a pipe actually translates or changes the output. So it actually deals, not with the command. It deals with the output. OK, moving on P kill kills the process by process. Name. If you hope. Process running. X y z just type e kill X Y z ill kill the process. You don't need to know the process i. D. P s command very powerful command. And when comes to system administration when you're on PS different options, let's in minus e f. And then we do more because it's gonna throw so much processes on the screen. This one tells you all the processes that are running in our system um PV create l B m commands is to create a physical volume displays to display the physical volume PVS works pretty much the same. P W D is print working directory. That is something you don't know, right? Come on, Don't tell me you don't know. You do know. Okay, uh, read is again Command used in conjunction with the scripting language which reads and ways for the input from the user. Recover that in module six. Reboot. As you could see, re boot is that name say's reboost. The system removed most files in directory removed directory Just removed the director. Now, why do we have rmd ir? What can be just Jews are space minus are to remove a directory. Well, seriously, I don't know. Well, they wanted to have a separate dedicated a command to remove a directory. Well, that's fine. Moving on rpm rpm is about package management. We used the command to installed, um, a package in our system. Our sink, our sink is something to synchronize your packages or your, um, system from one server to another. Um, SCP is again doing the same thing. Copy files from one system to another script. Script is something. If you wore running script and then you want to record all your commands that you're gonna run, then you typescript as C status is about ESI Lennox status. If you type sc status, you will see SC Lennox is enabled. We talked about a C Lennox as well. Of course, s H is the show just like bash or corn trail Shut down. You know that sort one of the beginning commands to sort your output in alphabetical order or the worst order S. O s report that as part of system administration module five That is something that was added late after the entire course. So if you have not covered this lesson, please go back large. If I cover this lesson as well split, spilling falls and two different files by size or lines, SS age is just a particle that is used to connect from one machine to another. Stat is a command that will tells you the attributes of properties are violent directories mostly used for SC Lennox. If you want to switch user from one user to another, what do you do? You do s you space dash. If you do not specify user than it will change it to root. Yes, Suzu allows you to run command as root swab Answer off Once you creed that slop It works the same way as it was that we have makes well, remember But once you make a swap than you do, stop on and so up off to enable or disable system. See, Thiel is in your command to enable start to stop the services. If you wanted to start, let's say Apache service, remember recovered that in module seven. If you wanted to stop the service, you do system CTL stop followed by the name of the service in all the words in you would do systems service the name off the service and stop or start restart till till gives you the last few lines off on output, usually by default. Gives 10. Tar is to put everything on the files into one container, so that becomes a tar foil TCP dump show every in and out traffic off a system. So if you do if convicted and do t c p dump minus pi. As for into facing an MP zero s three and hit enter, you're gonna see every package that is leaving your system, and every transaction that's coming into the system is gonna throw so many messages on my screen. So I'm not not going to run it moving on, tell it has works just like ssh, but it is not secured, just like ssh. So a lot of companies. So I'm just telling that anymore, then, is the command that use in conjunction with the four or why Luke in a scripting top top, is one of the favorite commands Off system administrators Check system Resource is touch Touch is to create a new empty file. Amount of human is amount file system it is opposite Off Mount You name tells you about your system and you run you name. It tells you that it's Olynyk spoke when you type your name minus a bridge is for all that would give you all information about your system like kernel version or when it was created and so on. Unique removes all the duplicates from an output, one of the initial lessons that he covered up time shows. System up time and load information. User. Add creating new users. Use it elitist. Delete a user right. Use a mod mod as it say's. It's just modify a user properties or attributes. When you run just users, it will actually print all the Jews. Names of users currently logged in DJ Creator VG Display able commands are for L V L V EMS is to create a new group on new volume and to display the volume V. I. You really need to know that IHS, the editor When you run b, I voted by the finally, it will create a new file, and we'll put you into editing mode. W show who is logged on and what they are doing. So you do clear and just w you'll see it tell you they're two years logged in with the terminal and how much CPU they're using and what time they logged and what they were doing . W get is the network Sorry Wall Wall is to send a message to everyone's terminal if you want to send high or if you want to send a hey, I'm bringing down the system, your type wall hit enter and then you send a message, and then you do control the, which will broadcast message to everyone who is logged into the system. W C count words, characters, lines and so on. W get network download of programs. If you have a complete you are well, you could just do you get followed by the euro and I don't know the package. What is this? A short description of commands. If you want to know something about command without going through the man pages and you just type what is followed by the command name, which which will show the full path off a shell command. So let's say if you were doing which ah wall. So it tells you that this wall, um, command is located in slash bin slash wall while against the scripting command works in conjunction with Do Loop while do who shows who is logged on just like w. But the difference between W and who is that who does not show all that information after logging idle CPU, PCP, you and what? Who am I? Remember that command. You better write it. So am I tells you your user name right is to send a message to a specific user X fs underscore grow if s that is also used when we were creating or extending file system. So it's in Marshall seven last command right here. But of course not polices. That's how everybody say is is right. Junk junk is to download and install packages and your system. So here is the summary off everything we have learned. And if you remember every single command that be just co word and of course, covert. An entire training course. Then you did Amazing job. You know everything in an inside out and again good luck.
191. Dont Give Up: Well, you have done an amazing job in completing this course. If you are watching this video, it means you have completed all the modules in my training. So now it's time for you to go outside and apply what you have learned in my course to the real world. It's whether you're applying for a new job or you want level up your career, whatever that you're looking for. There might be some hurdles that you're probably going to see while you go through this process. Probably don't have enough experience, or you probably cannot apply certain things in your life. But that's OK. You know, life is like that. You are not born to be experience in any field you learn. You try, you feel and you learn. And then you succeed, right? So my advice to you is don't give up. And, of course, my help is always there. Whether you want to ask me a question today or you want to ask me a question a year later, after taking my course, some always there to answer your questions and help you so again, best wishes for you and good luck
192. Congratulations:
193. WELCOME TO THE BONUS SECTION:
194. Troubleshooting Putty Connection: Hello, everyone. And this is your instructor again. Imron Capsule and this course or starting this lesson, I'm going to cover the issues that you might be facing connecting to the limits to party. Now I do have a few students, very limited students who did experience some off the issues. When they build a Lennox VM, they installed the operating system. And then when it comes to the appointment, they use party session to connect to the Lenox to a next machine. They're having issues. So I'm gonna quickly core what could be the issues or how are you? What are the steps that can be taken to resolve those issues? Some of the issues, the primary ones, is the next setting on the Oracle warship box. So if you go to your local warship box and go to network and there is a next setting that you have to make sure it is selected and is configured the right way, we'll cover that later, then the advanced setting on the neck. On the same are Galarza box setting that will also covered here as well. And the 3rd 1 is if the network in to face is down at the opening system level, which means that your net next setting is perfectly fine at the Oracle Urschel box level. But on the operating system, the interface itself is down. So you will have to bring it up or restarted, and the last one would be the ssh demon is not running on your links opening system, which is very, very highly unlikely because by default, when you install the next offering system in your machine, the ssh demon is running. But anyway, I am covering this just in case just to make sure that you have, you have been through all the different troubleshooting steps, so I have my limits. Mission open. I'll go over it and we'll cover all of the's steps one by one. So this is my legs machine that's already up. Now the first thing that I have mentioned is a nick setting on Oracle worship box. And now what is the next setting? If you go to Oracle, work for box which is this window and from here your select your Lennox machine and then go to setting. And then there is this option called Network. In this network option, you have this adapter one. It's his enabled network adapter. Make sure this is checked. The reason you don't see on my, um, Oracle box not checked or great out is because my machine is running powered on a few. Power it off. You will have this. Enable network adapter Check box option available to you, so make sure it is checked. The next thing you have to make sure is that you have host Onley adapter selected. Now we have different options. Several color. 1st 1 is host Onley adapter, which means that you could connect on Lee from your PC or on your laptop where you're running this oracle warship box. Your connect from that PC to your legs machine and you cannot go out on the internet. And then on the name side you have a virtual box hosts only ethernet adaptor. There is no other options by default you have to select this one. So when you have this host only adapter, then you click. OK, then you go back to your machine and then you type If config or I p whichever the command that is available to you, you hit enter, then you'll see if config the first interface that we are concerned about is this one. And this is the part that you have to look into the other two l o N v I R B R. Zero Just ignore that. For now, I have covered these two interfaces in my module. Seven. You will learn that in module seven. What are these? Different options are used for but anywhere. For now, just focus on this one, which is E N p. Zero s street. And if you notice right here, the i net right here it is the I p address off my limits machine that is given to me. And also, you have to verify that this interface is running up and running. And if you have all the settings correct until now, but you still do not have an I P address right here. Which would be in a case like this if you do. If down GNP um zero s three hit, enter. And now if I do If config you'll notice I do not have that in an I p address. Right. So if that is your case, then what do you have to do? Is you either have to restart your network service or simply do if up, E and P zero s three hit. Enter. Well, it's your hit. Enter, you'll see the connection successfully activated. Now, when you do if convict or I p then you will see that you have an I P. Address. One I to 1 68 56 1 whole one. That's one way of doing it the other way. You could simply restart your network service the command to do it. It's system C t l restart network dot service and hit Enter. It will bring down your interface and bring it back up. And then you run if config and you will see you have this I p Now, by default, everyone should have the same I p address eso You could just go into your party machine, tell pretty terminal and then you input the I p 1 92 about 1 68 56 101 And then you could simply click on open. And there you have your logging prompt. So that's how you actually, uh, create a connection between your party session and your limits machine. So let me open up a new session here just in case I go onto the one, so just close it. So what's this closer now? The second option I wanted to co our is this violence is at vast Nick setting. So what is that Vastic setting? Sorry, one more thing before I go to add Vastic setting, Let's go to the other setting. Now, if you go to sue gov em and then click on Network there is attached to there's another option. So now, if Host only adapter option is not working for you, that is fine. Don't worry about it. It's not the end of the world. Pick a different option, which is Bridge adapt. I think that one now in Bridget after As soon as you select Bridget chapter, it's gonna give you different option for the name, which is Intel are dual band Wireless now? My laptop right now is connected to the Internet wirelessly through the WiFi, so make sure if that's your case than you select Band Wireless. If your machine, your PC or laptop is connected through the Ethernet cable, which is a physically wired cable to their motive or router, then you will pick the Ethernet connection. This is the one which is the wired connection, so you'll pick that Anyway, I have the wireless or pick wireless and then you click OK, once you click. OK, then you come back to your Lennox machine and then you do the same thing. You restart your network service for just a sim CTL restart network dot service hit enter and you got your problem back. Now type I pekan or so if can fake hit, enter and now you'll see you have a different I p one I to 1 61.8 Now this is the I. P your links PM is getting from your modem in your house or your work. Now you could just simply go again into your, um party session and now you could type 1 92 1 68 Wonder eight and click open and it will give you the prompt. So this works the same way. The only difference between host Onley adapter and Bridged adapter is that bridge adaptor will allow you to communicate outside on the Internet. So if you want to download anything or if you want to open up a Web browser on your Lennox machine, right here. Then you would need a bridge adapter. But if you do not want to go outside, you just wanted to have a communication between your PC. Where you running this Oracle Worship box Annual UNIX machine. Then you pick, um host only that now, the option I said that you could try out is the advanced setting. When you click on advance drop down menu, make sure that Intel Pro 1000 MT. Desktop is selected for the adapter type. Now, this is my adapter model that is inside off my laptop. You might have a different model that represents our your WiFi card. So by default it should pick the one that is attaches to your cart, then promiscuous mode. Leave that as deny. That's fine. That's a Mac address. You don't have to change that. Make sure the cable is connected. And then again, of course, you hit OK and come back here. And then you could try doing the same thing. System CTL, restart Networked out service. Now what? This system CTL command. That is something that we will cover in Module seven on the last one I have on my slide is ssh demon is not running now. What? What does it mean? It means that when I go into my machine, all you have to make sure, but again A So I said earlier. This is the chances of this not running is very, very slim, but still verified. And to verify the ssh demon processes running. You do P s minus e f the pipe it and grew up. It s H ps minus e f. Pipe it. Grip. Ssh! What the hell is that? Don't worry about it. Just run this command. You will learn this as you go on with my training. I just want you to test these and see if you get this output. And if you do get this output especially this line that says user s been ssh Dash D. This shows that your demon or the process that is listening to accept your incoming traffic it is running, So that is perfect. Now, in my case is running in your kids. It should be running in case it's not running. Then I would say that you do system CTL restart ss Ssh! And then you hit Enter. Sorry, it's probably sht. Yes, So it it will start back again. Again. It's the chassis, very slim. But you should try that, too. So anyway, these are the few trouble shootings tips. If you're still having issues connecting from putty to your lyrics machine, then don't worry about it. Just send me an email I would prefer. If you could send me a screenshot, that'd be great. And I was definitely help you.
195. Changing Default File Permissions: change file creation permission. Now you notice that when you run the command touch or copy or anything like that to create a file by default, it creates certain permissions with that. So this is the lecture way. We will learn how to change the default file permission creation. So their command to use is you mask. And what does you mask? Do you mask is a command to set default permissions off any newly created file or directory . So, in his example, if you are on a shell prompt and you could run a human asked space u plus r w meaning for user. It will have as you read and write permission for group it will have on Leigh read permission. And for others, it will not have read, write or executed permission. If you run that on your terminal and then you run an command touch to create a new file, it will set these values by default. So let's log into ah, the links machine. And I could explain to you exactly how this works. So I have a next machine right here. Let me open up the terminal. Some terminal is opened up. I am logged in as myself. And my host name is my first Lennox PM. Now, when I run a command touch to create a new file for example, S S or J s for example Js for Jerry Seinfeld hit, Enter. And when I do ls minus lt or toe list that file and you notice the Js has a file permission offer read and right, No execute for owner read, Write no execute for group and just right for others and nothing No, no execution, no read right for others. Now what if you wanted to create a file going forward and you wanted to make sure that it assigns a different set off permissions right here instead of you creating a file first and then going in and running the change mark command and then assigning the permission So it doesn't happen many times that you would have to do that and corporate world, but there might be some application requirement or user requirement where they will need to set these permissions up. Now the first question is how your system says upto permission by default by default. When you look at a file called when you do cat on, Etc. Bash or C. You'll see there is this Hugh mask set here. So when you log in to your system, your log in prompter actually goes into first its own dot bash RC, which is ls minus l a and doom or and you notice we have a file called dot bashar see. So when your shell goes in here and it sees hate, is there a set value for me for to assign those permission for file creation? If it doesn't see it, then it will go to its global file, which is cat at sea Bashar see? And that's where it sees. Oh yeah, I have this file permissions. Every time the user will create the foul, it will set that permission. So now that's real. It's myself. He are. And you noticed that I created a file called Js, and it has this file permissions. Now, if I want to change that pile permission while I'm logged into this shell, Not sorry. Not change the five permission off the specific file, but to change the pile permissions off any newly created files while I'm logged into this session. Then I will run the command. You mask Now. First user, How about what HUD permission you want assigned to the user? So I want to sign the user, read and write. Okay. What about group? I want to on Lee. A sign read permission to the group. Okay. What about the others? Um, I do no want to assign any type of permission to others. You separate them by comma. You hit, Enter when you do the hit enter. And now when you create a new fall touch And let's say, um, que que sorry ck as Cosmo Kramer and you hit enter and then you do ls minus. Lt are. And you will see the newly created file CK is now has the permission that you wanted it to the sign. Um, Now you notice you create the group permission to have only read, but it's still allowed. W is because it's getting those permissions from its main file, which is at sea Bashar see, So if you want to be more Pacific, you could just do it up arrow key. And you could just do, um, group is plus G plus our and you could also do again group minus w. And when you do that. Then when you run the new the command touch and let's do E B is Elaine Bennis and hit enter and then do ls minus. Lt are. And now you see it has that permission that you want to have it assigned to. Now, if you log out of the session, that humus setting will go away because that you mess setting is on lee applicator ble to this particular session that you are in. If you wanted to have that set and permanently every time you log in, it doesn't go away. Then you would have to actually modify that in your dot bash R C file. The reason I'm picking ls minus l. A is because a option will give you all the hidden files as well. And hidden files are those that starts with dot So right here if you notice dot bash r c is a hidden file and it starts with dot bashar seat. So when if you wanted to modify that, you could simply to cat dot bash r c or V i dot bashar see and and the end off this file, you could specify v I doubt bash R C And in the end of this file, you could specify you mask and whatever the setting that you want to do for user or group or others based on what we just did before and then you save it, and the next time when you run or when you log in, it will create files based on the files permission settings that you have set for it.
196. VMWare Workstation Player (Optional): we aware workstation player now in VR going to cover the installation, actually, the download installation and configuration off the VM Ware workstation player. Now what is it? It's It's a product of VM ware and being where is a company that actually have pioneered inversion technology? So this product is similar to Oracle Worship Box, where you install the software on your computer, which has a non operating system already running. So you install it, and then this software will allow you to run multiple operating system simultaneously. So every company came up with the different products that performed the same function. So being where has workstation player and Oracle has worship box? So let's get into our, uh, the download installation procedure. So go to open up your browser and, um, you will go to Google and type of VM Ware workstation player and click on the second link of its his Don't love you ever work social player, and on this page you will see Try a workstation for Team Player for Windows and Click Download now, and it will start the download or, if you are going straight to Let's Avian word out. Com page, then go to downloads, and here you will see all the Dell nodes at available at the enterprise level business of small business level and a personal level. So click on the one is his free product. Down. Let's click on Workstation Player, and on this page you will see two options. One option is for Windows 64 bit operating system download, and the other one is for letting 64. Go ahead and click on the window. 64 bit operating system download and I have already downloaded to save. Sometimes I'll go straight into my download location, and here is executed well, that I have downloaded previously, and I'll go ahead, double click on this. Execute herbal and click run. When I click on one, it will start, um, the gizzard that will walk me through one by one. But the whole installation off being were workstation player. Remember, for every program there is a download. That's a first step. The second step is installation, which we are doing right now, and the third is configuration. Okay, if you see the bottom right here, this is the visit that has opened up government and click on next. Uh This is the end user license recommend. Go ahead and click on Accept terms and license agreement. If you want to read it, please be my guest. Go and read it. Click next um install location that default in so location has already been selected. If you want to change it, you could go and change it and select a different location and click next check for product updates joined the being because from our experience, I like to have them disabled just for training. If you again want them to have, um, if you want to participate in the customer experience, go and click on it and click next. This is about the shortcut. If you want to click on the shortcuts, if you want to create the short go on your desktop, make them enable and click next. The last green is but installed. Yes, God, And still not. This installation is going to take anywhere from two minutes to 10 minutes, so I'll go ahead and fast forward. Um, from this point on, the vehement workstation in solution has been completed. Now go ahead and click finish. Okay, so it is completed. And now go ahead and click on this icon that has been created on your desktop. Okay, here you will see. This is the portal or gooey that looks like that. Remember workstation. It looks very similar. Toe Orca Warsaw box, which allows us to create a new words from machine. Open up an existing washing machine, upgrade to a newer version or if you need any kind of help.
197. Create VM on VMWare Player: Okay, Now is the time to create a new washing. Machines will go straight into our oracle. Sorry of Umer workstations. Double click on the icon. And I'm sure you're familiar with this, uh, gooey. So click on create a new washing machine. Now the first section is installed from installer disk. If I have a disk inside off my laptop or my desktop, it will automatically gives me the option here to highlight it and pick that drive, since I do not have any, So that's why it's great out the 2nd 1 is installed or disk image, if you notice this is where my eyes are. Image file is so you could go ahead and click, Browse and go to where my sent O s file, which is located. This is the ISA image that I have already downloaded previously. So go ahead and click on select. So once you have selected the source off the opening system that you are downloading on this washing machine, then go ahead and click next. Now remember, there is one difference between being where workstation and work awards and machine is when you create Oracle washing machine first and then you attach the ice image to it where, as in B M A workstation, you could create an attach. That's the image at the same time while you're creating the washing machine, so go and click next. Now, this is the name off the virtual machine that you have to pick so you could pick anything on it. Say, UM, B M. Where Lennox Yeah, so and the location where you want to have it downloaded or have its space so you could pick anything from the location. So then click next. This is the size off the desk that is required. Actually, it's not requires optional. You could pick 10 gig, or at least that you have to have is about four Applied gig so hopping system get fit in there. But for now, we believe that default 20 store ritual disk. A single file, yes, but that I select that option. I don't want to split my father's into multiple files. Click next, and that's where it's telling me the location. If I wanted to customize the hardware, meaning if I wanted to add more CPU, more memory, I could go ahead and add it right here. I increase the memory at more CPU and go ahead and click close and click finish. So once it is finished, the virtual machine will automatically power on and it will move from the ice or image that he had picked. I'm getting this air masses is unable to connect to the M. K s too many sockets that the reason you get this message is because you will have to reboot your laptop or PC when you installed being where workstation this is required. So click OK, and just click for my re later and just shut it down Spot were up. And then Now go ahead and create us or go ahead and reboot your computer. Okay. My machine has been rebooted. Now go ahead and double click on the icon again. So this is the VM that I had that I had previously created. The whole go ahead and do on power on. Okay, so you see now this time it's not giving you that same error message. Now you have the center west install um, screen. It's saying the falling software is available for download. Being were tools for links to say the mind later is trying to solve the empire tools on the on the on this virtual machine. But it does not have an operating system yet, so just click on, remind you later. So and then from here, I'm sure you know the drill. You just pick installed center West head header, and I will go through installation visit. So this is about creating a virtual machine, attaching the eyes of image to that works for machine and going through the insulation. And, by the way, in the end, where you would have to click control and all together to release your mouths where, as in Oracle Worship Box, you would just have to click control the right control off keyboard.
198. Oracle VM on MAC:
199. Install Oracle Tools: install Oracle guest addition, which are the Oracle virtual machine tools. Now, exactly what is Oracle guest addition? And why do we need them? While Oracle guest additions are the tools that are associate it with the Oracle uh, Oracle Walk box. You know, we have Lennox machine that runs on Oracle Box or Orca Environment. But if he wanted washing machine to run more efficiently, um, with its in an output, um, features. And also some people want to have the mouse specially the mouse to be not trapped inside a washing machine. What they do is they installed the oracle guests addition, tools. So what you would have to do is, if you are inside off Marshall Machine, then you don't have to do the right control key to get out off the consuls trap. You could just freely move your car your mouth from from the machine to your desktop. So that's one of the advantages in there are many advantages. Well, so in this lesson, this is what we're going to cover on how we could install Oracle guest addition tools in our virtual machine and specifically in our legs, force a machine. So what? We're gonna do is first. The instructions that we're gonna follow are is that first we make sure that you are running the latest colonel. So to see if you are running billions, Colonel is either by your look online and see what the latest courage. Excuse me? What? The latest kernel version is out there, or you could just simply do jam up that current, which most likely you will do and then install the following packages, which is to do the rpm. And there is this package, um called. Um e p l latest release seven dot rpm. Oh, by the way, I'm sorry. This a f d a. Just ignore that. It's just ah, miss type. The whole https calling ends at dot r p m. Then insult evolving packages, which is GCC Colonel Della Carnal Header KTM Us make bees up to and Pearl. And, of course, at the end, months, everything. All the requirement. All the basic necessities for Oracle guests. Additions are done and mount the worship box gets. Addition is by going to the council and clicking on device insert, cast, addition, CDs, images and then simply running. So let's go ahead and follow this procedure so this baby could do the installation off Oracle. Guess, addition. So for this procedure, I will go through my counsel. I already have my council open. I am logged. And as myself. My directory is my home directory. And my host name is the current are the right host name, which is my first sentence machine to do the jump update for the Colonel. I have to be route now. I would have to update my jump, install Colonel an asteroid. But of course, Make sure before you run this command, make sure your computer has Internet connectivity. If you do not have Internet connected first enable the wireless or Ethernet cable attached connectivity to the Internet. I have the Internet connected. I've confirmed it as well. I could do Ping www dot cool dot com and you'll see I'm getting a result back. So that's how I know I have Internet connectivity. Anywhere you do jum install Colonel Estrich Enter will go out to all the repositories that is available to me for this version that I'm running and it will find all the packages that are need to do the update and you'll see here is the dependency resolve and this stuff installing packages that are there. Incident is telling me installed total aid packages and total of eight packages that need it will be upgrading it. But of course, it depends on your system. Your linens machine. Um, your output could be different from my output, so just don't look exactly the same. Apple is mine. Quit different, depending on your system, and it was installed when it was passed or when it was upgraded. So simply go ahead. And just what this is going to do is this is going to download all the packages that are associated with the name Colonel and there or, um, total off seven packages that it is going to download. As you could see, it's going toe. 1234567 It's up to seven right now, and once the download is complete, then it will go through installation process. It's just the same way as if you are installing something on your Windows machine where you would first download execute herbal after downloading it. Then you double click on the package itself. Then it goes through the installation process. So the same way works here. So now it's telling me that it has downloaded. And now it's updating the two packages that it was talking about. You see, it has right here. It says upgrade to packages. So the first thing it did it updated up to those two packages. Perfect. So now, after the upgrade, now it has eight packages toe install. Um, for those eight packages, these are the eight packages that it will install. See 1234567 and eight together. And the two packages that it will update our one and two. So, anyway, update is completed. Installation is still in process. So once the insulation is completed, then you could see there is this repository that I would have to install that repository or that rpm. Allow me to also do the install off other rpm packages. Okay, So, um, let's give it a couple of minutes And what I could do as I could just simply fast forward from here, said this way it doesnt waste your time, and by the time finished doing the installation that will come back to it. Okay. On my machine installation R D jump update for the colonel has been completed. The next step I would have to do is run this command, which is to download another rpm package. By the way, this instruction I will add to one of the no pad and then you could download from the resource is from the same lesson. And you could just simply copy and paste once around this rpm host all this rpm package, Then I would have to install this list off all the packages with the command. Um, install GCC, Colonel, Devil, Colonel. Headers de Kms make bees up to and pull. Once all these packages are installed, then we'll go to the last part where we will do the Mount Worship baskets addition. And this is what I'm gonna show you now. How you tach is the device. Insert guests edition CD images from the Lennox or from the Virtual Machine Council. Okay, So once all the required rpm's or packages are installed or colonel is updated, then all you have to do is come to this council off of'em. Whether it's a virtual machine for legs or windows, you go click on devices and click on insert guest addition, Seedy image. So when you click on it, you will see a disk image that will show up here. It means it has been attached, and it will ask you to run it. So just go ahead and click. Run. Once you run it, it will open up a window And I'll ask you for root permissions have put in the root password, and then it will run. That automatically says says, Do you wish to complete? I have already been through this. I don't have to do that. So simply go ahead and do install, and it should take your off. Your guest always tools where you don't have to actually, where your mouth will not be trapped inside. Off your, um, Consul Virtual machine Consul. All right, thanks.
200. Filesystem Color Definition: file system color definition. Hello, everyone. And this is the lecture where I am going to cover how each file or directory changes its color in Lenox environment. When you run ls minus lt r or l s minus l or any of the option that will give you the listing off files and directories. You notice that each file or directory or link they are showing up in different colors. So what? What really those color mean? And how are they identified in linens environment? This is a screenshot I have that I captured from my Lennix machine. And if you look at the screen shot, you'll see this all the way to the right. There is thes different files with different colors. There, this yellow file there's blew off them and there's green off them. In this lecture, this is would be exactly I'm going to color why There are different colors and what is the representation off each color in Lenox environment. So let's go into a next slide and will cover the 1st 1 Very 1st 1 is the blue blue. Every time you do ls minus l and you see ah, any name that shows and blue color. It means it's a directory. Anything that shows up in green. It's an execute Herbal Recognized Datafile meaning it has a bash shell scripting in it. And it is actually a script, which has the execute herbal permissions assigned to it. So it may be possible the script does not have the shell defined in it. But the execute herbal permission assigned to the file will make that file color green, then sky blue color, which is a symbolical link file. When you create a link from your home directory, let's say to another location, and then you go to that other location you will see the linked filed would show up in sky blue color as an example. If you wanted to create a link, you would run this command, which is CD slash home slash. I have soul. This is where the source off the fall is located. You create a far let's say touch, see A In my example, it's a Captain America. Then you go to seedy into slash temp. That's where you want the link to be created, and then you run the command. Ln space Dash s a symbolic link. Two slash home slash i of salt and slash c A, which is kept in America. By the way. I apologize. I missed the slash right after home, But anyway, we will cover all these steps and I will show you exactly when we create a link. How it shows up in a different color moving on. And then we have yellow color files yellow with the black background. What are those? Those are the actual device files that are usually found under slash Dev. Anything that is attached to your system. For example, Mao's keyboard or speakers or anything that has, like a scuzzy devices or R I. D E devices. They show up in a slash DEV file system and they will show up as yellow color. Then we have a pink color files. Those are graphic image fall like a J. Paige A or any type off graphical that has graphic. And of course, you cannot cat that fall, you have to have a certain program to view that image, and you could only view an image if you are logged into your system through gooey through the Gui desktop, you cannot view a graphical image fall and putti session or ssh. Session. Next we have their red files. Read files are the archived files when we have two or three files together and you put them in a tar file by running the command tar so that container is called an archive file and those archive files are shown in a red color. Then we have red with black background, as is showing. Right now, it is a broken link, which means if you have, if you create a symbolic link and that's symbolic link is created with incorrect ah procedure or incorrect way off running commands, then it will show up. Instead of sky blue color, it will show up red with black background. So as an example, you will go into the slash home slash I absolve directory. You create a file that's a touch I hoc. Meaning incredible hook. Then you run the command. L and minus s for symbolic link. I hulk slash temp slash I hawk Now this one Once you Once you run this command, it will show up in red with black background. Why? Because in the command l and Space Dash s we are not using the absolute path for the source file. We have to specify L and Space minus s space slash home slash i absolve slash I hawk and then the destination. Then it would become sky blue. Anyway, that's an example. If you showing if you have a broken link cable show up in red and you could tell right away that link is created. But it's not gonna work because it's broken. It does not have the actual source of the fall, so these are the few lists. A few colors. There might be more different colors, and you could also modify these colors. Um, depending on what's what. Color is your preferred method. But I would say, you know, let's not Let's not change any colors in in the Lenox environment because this way, you're gonna have a problem and you jump around from one environment to another. And please do remember again. As I said before, not every Lennix environment would have the exact same colors or even have any colors off off any kind. So let's select the log into my Linux machine, and I have already logged into my Lennox machine here, and look, I have logged in with my position. So the first thing we will go over is the directory. I am logged in as myself. I am in my home directory and when I do ls minus lt, or you will see anything that is. A directory is blue coated color, and you could verify it by looking at this. The first column and the first bit is D that shows that it's a directory. Then we have a color green. If you notice we have ah file call Homer and it has this execute herbal permission x, x and X As soon as you assign x x x are execute herbal, this becomes like a script. Lennox operating system treats it as a shell script and changes its color to green. If I were to change it back or remove, execute herbal permission with a for everyone for all minus execute Herbal Homer. And now if I do ls minus. Lt are you will see the home were right. Here is no more green because we have removed X X and X from everyone. So that's why and that's there. That's the That's the way toe. Identify if the color is green, are not a FISA script or not. Next one, we have a sky blue color, and that is for creating links. So I'm gonna make this little clothes Ah, smaller. So I couldn't I could read the example there. So if I create, if I go to my home directory, which I'm already in home, I off soul and I create a file called Touch. Um, see, a meaning, Captain America, I will do ls minus. Lt are. And I'll verified. Ah, let me make this and little smaller and make this bigger This waste of this where you could read it better. Okay, so I have verified that I have created a file Captain America and its moon white color. Of course, it's a regular file. Now, if I go into slash temp directory and I create a link to that Captain America file by type ings link space Dash s as symbolic link to home I of Saul kept in America. Hit Enter I co verified while I'm in temp directory Akron ls minus lt or again lt are will show me the listing in the time when they were created or modified and in reverse order, meaning the latest one will be at the bottom, so I'll hit. Enter and you will see the last one. The bottom one is right here. Where I have see a is linked to this actual shorts file and you see it's a sky blue color. Okay, then. Next one we have is yellow with black background and those Arctic device files and the device files are located in slash dev directory. So when I am in slash dev directory, let me clear the screen. So I am in slash dev directory And when I do ls minus l or lt or and hit enter, you will see all those files that shows up here are in yellow color and as you could see t t t. Why are the terminals and their keyboards? There are many other things that you could look into the never cars network adapter. All those are the actual devices. And remember, every time you see a device, the device, the bit that is assigned to a device stars with C and anything that does not have any assigned the bit there. It means it's just a regular file and anything that has d in it is what exactly? It's a directory. So now we know that the device files colors are in yellow. Perfect. Now let's go to our pink now for pink. I do not have any, um, any file in my system, that is an image fall. So I have to download an image file to actually show you how the color looks like. So first, let me go to my home directory. Home lives all clear the screen. And now I need to first download. How does download? There is a command I would use w get that. I was used to download an image from the Internet. So for from for right now, what w get does is it? Actually, um, it gets anything that we specify as in as you are. Well, after w get so w get I'm telling it to get a file from from a u r l Where is that you, Earl for the u l. I have to go in to, um, like Google and I will type in Let's say colors. Ah, color anything that you want to type, go to images fall. And let's say this is the image I want to dull the balloons for I would do a right click on it. And I will say, copy image location. This is going to copy exactly where the image is located. I'll go back to my position, and here I will, Right click and have specified the exact link where that file is located. And now I will get better. Okay. It is saying that it is giving me a broken syntax error near unexpected toke. So there is not something right? But any. Well, I'll go ahead and I will download a different image about this one. I will copy and measure location. I think it is the location. I will run the w get command again and hit. Enter. Okay, so now this time it worked. I don't know. The image location for the other file was probably somewhere or has broken length somewhere . Anyway, my point is to actually show you how we could have an image file and download an image for be downloaded. This image file called I m g underscore. Color mapped our Jeff and it is downloaded in my home directory because when I ran to w get command, it actually downloaded in the front or existing directory. So now when I do ls minus. Lt are that image file will show up in pink. Ah. Okay, so I did a less mice. Lt are. Oh, maybe it's showing up as an older file. That's why is showing up all the way up there. Okay, so that's the file, because it somehow is showing up a January 26 2016. Um, so that's not the time. And we downloaded. Maybe that's the time. And it was created by the auto. Whoever put it in there. So anyway, um, if I do ls minus l. Then you will see that in the middle. So now is showing up in pink color. If I do cat on it, I cannot view the image file. I have shown how to do how to view an image file in my later sections in the additional resources section. You could go back and check it out. The next one is the archive, all the tar fall. So if I have a list of files, for example, um right here I have a fall c a a Captain Marca. I hope all James I will fall Peter. Or instead of just that I want you to create files called a B, C and D. You could you could create all those falls in one shot and hit, Enter and do at lest minus L t r. And you will see your files are created as it is showing up right here. Now, I wanted to put all these four files in a container so I would use a command tar C V f. So tar CDF is the option to put the files into that container before we put the fall in the container. We have to give the name to that container. So we will say, um, for example, all dot tar. And now what are we going to put into this container? You want to put in file A B C and they so now it will go in. So it actually not actually drew moving, get in putting it into a container, it actually copping it and putting into a container So the source file still stays there. But the container has a copy of those. So if I do ls minus. Lt are now and now you will see the source wall are still there, but the container fall is shown as all the red. And that's what called the archive falls. My purpose is to show you their red and how it shows up on the Lennox file system and your analysis myself to you. All right, so the last one I have is a red with black background, and that is for broken links. So if I create ah file in my home directory So if I go to my home directory home, I absolve which I'm already in and I create a far call Hulk are incredible, Hulk. I hook through Ellis myself tr and you'll see it's all the way, the bottom Perfect. Now, if I create a link l N Space s I hope and I wanted to be linked on temp I hawk and had enter. Now when I go temp directory and I do ls minus lt Or you will see I hulk there is a link and it is linked to ah file called I hook, but it is broken. And it that is why it is showing up in the red color. So that's the one the red color is showing up. Ah, if I have to fix this, I have to specify the absolute path. Meaning I ran this command. And instead of this command, I would have to run slash home slash i absolve slash Hawk. And when I run this command, it's his two most symbolic link. I understand. First, I have to remove that. Ah removed I hook. And now if I run this command now, it will work. Now if I do ls minus. Lt are you see, I hook is in blue color, so source file has to be specified as an absolute path. Now you notice I have to off them red with black background, showing up as broken link and just read with our car and you probably notice Hey, they are in the boat the same. No, because if I had the white background right now, by default, my party's green has a black background. So if I had a white background, then you would have seen red as just ready and the black meeting on the white screen Black . The broken link would show as black background on that little text and would have text would have itself a read on it. All right, so, anyway, this is the topic above While system and color definition Good luck
201. SELinux: SC Lennox security and has a Lennox now, a lot of few probably thinking Oh, my God s C Lennox, That's very complicated. Okay, I do agree. It is somewhat complicated to a degree, but for people who have already spent time in it and been working with essay, Lennox already find it easier than initially how they thought so. One thing other promise you that I will try my best to explain how SC Lennox works. But keep in mind, it's a very, very big topic that I might not be able to cover every aspect of S Olynyk. So again I'll try my best. So let's see. First talk about what is SC Lennox As a regular definition, its security enhance Lennix. It's a little Colonel security module that provides a mechanism for supporting access control security policy, including mandatory access control. I got this definition straight from Wikipedia. If you go ahead and search online, you'll find that definition right there. And the second thing I do wanna cover is it's a project off United States National Security Agency, an essay and SC linens community. The other one, both of them work together, came up, Of course, the beginning. An essay was the one was involved. Who wants toe in hash or ADM or Security around Lennox. So I have went over the definition off a C. Lennix from Wikipedia. Now I am going to tell you exactly how I can explain you in a graphical and easier way. And I really hope that you understand how a C. Lennix works and what is it for? Let's take an example off a server. So we have Olynyk server and it has directories, directory has files and all other different files in other directories. And also the server has processes like NFS Observer, our FTP server. Also, it has sockets that whenever it starts a program to communicate to one another links machine, it needs to open up a socket and it has a memory. All that is, as you know, is managed. Our comes under the ownership off users and groups, right? We all know that, and how we control the permissions is by, of course, we assigning them to who owns that and which group owns that. And then there's three level of permission we do, and that is re dyed, execute herbal and each one of them are divided in two users. The 1st 3 bets for users 2nd 3 beds for group and through the last three bits for others. So all that is controlled through change mod So you could A user can do change mod to whatever that they wanted to change it to. So if your own ah file or if you create a fire, let's call it file one. You could do a change mod on that file and control the permission as however you want to view it. This type of access is called D A C discretionary access control where user has control over everything. Now comes the SC Lennox. What S E. Lennox is It's basically a mandatory access control and it goes around this discretionary access control. So what? It means that let's say you have a user and user is http user in your environment. And let's say that's user has been compromised by a hacker. So what I have is here is if the Apache http server is compromised, an attacker cannot use the process to read files and use a home directory unless the Pacific asi Lenin's policy rule was added or configured toe Allow such access in simple words. What I could cheer you here is if that user Http user Onley if SC Lennox is enabled, what this s illness can do is it tells the user hate you do have access to this file. For example, war a war w doped up top html directory. But I am not going to give you access to OIR Dub, Dub Dub C g I. Dash been Now think off it. Both of these directories are actually owned by that. Http user Right. So it isn't that how funny it is that the same user can access one directory and cannot access the other or can access one file but can now access the NFL. Yes, that is possible through SC Lennox. That's why they came in and says, Hey, guys, this is not good. Maybe one user. Let's say I have salt can access a file in slash home IVs all in the file, but we don't want him to access any other file in the same directory. Well, it's because again, if that users compromised, that user could access of the directions to and you want want to prevent that? So at the end. Result is the user cannot do change. Motto. Whatever the user likes. That's what a. C Lennox. Is that how it has says the security off your Lennox? So hopefully this diagram and me explaining this way makes you understand how SC Lennox works and why there's a need off s Olympics Now moving on. Let's get into the detail off the functional functionality of SC Lennox and how we could make a use off it. SC Lennox Options There are three SC Lennix option number one by default when you have a linens machine installed primarily, let's say, in red hat Santo s and fedora toppling its distributions by default. SC Lennox comes as enabled meaning it is enforcing mode. Then there's another mode that is called promesa mode permissive mode. What it does is tells the SL Lennox Hey, I'm not gonna enable you, so don't do anything Onley. What you don't should do is only logs activity like as if you were enabled. So this way, if you were using the first time as the Lennox, then it you should always do permissive, so you could try an error trial and error type of things you could do unless you fully comfortable. Then you could go ahead and do enforcing again. Always try to do permissive than enforcing. Then, of course, the 3rd 1 would be, as you know, is disabled. So if you do not want to use SLX at all, you could just go ahead and make it disabled and not off its functionality would work at all. Now, so far that I know if I have to ballpark, I would say about 50 to 60 percent of the time people have disabled SC licks. And the reason number one reason for being a C Lennix disabled in the environment is because, of course, it is said it is complicated and a lot of time people do find it complicated and simply they could go in and disable it. But what my take is is that if you are running any off your linens machine in a D m Z environment, which is like public facing environment than you should definitely consider enabling SC Lennox. Okay, moving on to check SC Lennox status. Whether your system is running SC, Lennix or better, it has a selects enable or not, you would do s e status or get enforced. This would tell you if your system has and seal next enabled or not setting s the Lennox you will have to do set enforce zero to do input from a silver disable mode. Or you could do set and force one to enable it. But again, this will only enable or disable while you are on the system. The moment your system reboots, the setting will go away now how you could make those setting permanent just like any service you have to modify. SC Lennox conveyed file for permanent setting and that file is at sea as always. At sea is a configuration directory, so you should have that in etc, etc. Linens config file. And there is a parameters inside of that configuration file that says a C Lennox equal enforcing as you Lennox equal disabled, which ever deciding that you want to pick. Of course, Don't forget permissive then before but you modify as sealing his config file. That is something definitely I wanted to tell you. It is very important. Even you. If you have to write it down before you play around with SC Lennix, please. If it's a virtual machine. Create a snapshot off your VM to stop everything right now, go ahead and create a snapshot before you try anything on this. Why The reason I'm saying that again. SC Lennox is built around security. If you make changes, that is not something that you wanted to do. Maybe you're gonna have a problem booting up your system or is gonna take a long time to label every file system. What is labelling mean? We'll cover that later. But again, Mike, suggestion to you right now is go ahead and create a snapshot off your water machine. If you are running a physical machine, go ahead and create a backup off your physical machine or create some some type of means where you could revert back to your original setting. Then, before you reboot your system, let's say if you have enforced a c Lennix in yours at sea SC Lennox convict file always do slash dot auto relabel. This is going to tell the system. Hey, I have just enabled disabled s analytics, especially enabling it. Go ahead and relabel all the file system directories, whatever that you have relabel them right now. So they are aware off a seat, Lennox Enablement. So make sure if you don't do that and you have to boot, then he has to go to the relabeling again is gonna take you a really long time, and you're probably gonna take your system is not boating up. And then you're gonna try different things, and you're gonna end up not booting up the system at all. All right, I'm gonna try a couple of things to show you on my Linux machine. How does, um, how to show about this and force or not? So I have my lung machine open right here. I am logged in as root as you could see. I have a pound sign, but still haven't always check to make sure I'm locked in this route. So if I wanted to check the status, I would do status SC Status, as you could see right now is CSE status enabled. But don't go by this. You have to do is right here. Corrupt mode. It is saying that my current mode is enforcing, meaning I do have SC Lennox and it is enabled and running in my system. You could also get the same um, result Not exactly the same result. But you want to find out others and force or not You do get enforced. And it would tell you this. Yes, it is enforcing again. If you wanted to set it to enforcing or disabling, you have to do set and force zero to disable one to enable the file that you would need to modify for permanent setting. That file is located at sea sis SC Lennox. It's cat. The vile out and pile is convict. You could see in the filed before I had only this line as C. Lennox equal enforcing. I also added this line myself. You probably don't see this line in your configuration because I add it that manually and the reason I added manually said this. But I don't have to type it the disabled whole again or do not want to make any mistake. All I ever do is I will go into the fall, take out the pound at the pound here, and it will make the changes the way I want. So that's the file you need to create. Keep in mind that you should make the change too. If you wanted to enforce or disabled. Moving on. There are two main concepts off, etc. Lennix one is labeling and the other one is type enforcement. So S Olympics is running its enforced now. How does at sea Lennix keep track off files directories In all the processes that we talked about? First thing, the etc. Lennox does. It labels every file and directory in your file system again. It's enhanced way off enhancing your security. And let's say if you have a file or a directory, it creates a label with that, just like a label tack. And that label has four different type of information. One is this user. Second is a role. Third is a type, and the 4th 1 is the level. I will mostly focus on the type because most of the time type is the one that is used that keeps all the falls ownership or security separate from one another to list the label off a directory. If you want to see what type of label it has, you have to do ls Dash L Z and user s been http d is just example that I picked this is the file and you will see As a result, it will come up as this and you'll see right here where I have highlighted in the rectangular red object. It has system which is for user object, which is for role. Http de underscored e x e c underscore teeth That's the type And the last one is so is the level the again The main focus is http de underscore dxc on the school t you will find that every file or directory if they are in a different directories, would have a different type. As you know, this is executed ble user been http D is in Execute herbal You could run that it will start up a script and it was starting http process That is why it has been given the e x e c execute herbal type. Similarly, if you do want to list a directory, you would have to do ls space D for directory and a Z again at see http D, this is a directory for configuration file for H G p. D. And the result will come up like this again. Same thing users. The same role is the same, but it has changed a type type again is the most important part our thing that you have to work with. If you are going to copy the file, let's say that is in user has been Or, let's say Ward dubbed Upped Up A H T M L directory and you move it somewhere else. Remember one thing it is not taking the permissions off the other or the source destination it It is taking the information of the sources. So you have to modify the type when you actually move it. Otherwise, as C Lennox will not allow you to read it. Okay, so let me try call of these commands. Clear my screen and the 1st 1 I will try on LS minus. L upper kz slash user slash has been flash http D and as you could see right here, this is what shows up. And this is label off SC Lennox. If I had a c Lennox disabled, it would not have shown up right here again. The 1st 1 l All of this label has four different categories and each category is separated by the Colin. The 1st 1 again is user. 2nd 1 is ruled. 3rd 1 is the type, and the last one is the level. And again, this is the most important one that you should be focusing on that you could make a change to. I try on the directory D. Z at see http d again. Um, it is labeled as config S c p. D. And the score config. This one is was labeled Execute Herbal. You see the essay Lennox keeps the distinction between one file or directory with another is by assigning thes types that it says, Hey, this is a convict fall. Hey, this is execute herbal far. Now I'll see who has access to execute herbal and who has access to confected if I want. If I were to do the same thing in my home directory, let's ls minus daisy home I have solved. You will see it is coming as user, which every user will have and the home de ir. That's how you could differentiate as a home directory. I could also make a change on the user as well as the object. All right, let's keep moving on. As a Web server runs, it process is labeled in memory as well as like a cdpd underscore teak, So not Onley directories or files are labeled by a C. Lennix. The process is also labeled. You could check that process label only if it's running right. Because colonel starts of the process and it keeps that process informations memory without starting it up, there won't be any label. So to check while the process is running, you do P S E X or whatever the option that you want to use. And, of course, upper casing in the group for the process. And you will see you get the list of process depending on how many processes you're running . And here is information about that type that we talked about. Um, sorry, I actually captured the system in the school are as well, which is not the type. The type is a CDPD underscore team are to check the socket level if the label is assigned a sake level. Yes, it is. And you'll see right here again, I, uh I actually highlighted the wrong type system. Underscore R is a role not the types of the type would be a CPD in the score teeth. All right, so let me try to look the same thing for a process and for the, um, socket. So first, before I looked for it, I wanted to make sure my http d is running for those who do not have http de installing your system, you first need to check whether you have the package installed by running rpm Qiwei. First of all, let me clear the screen. Rpm Qiwei, grab for http. Okay, so I do have a package install. Now, if I have a package installed, I need to run it. But of course, before I run, it will need to make sure that this running already your not so system See Thiel status 80 DPD. Okay, it is not running. It is in active. You could see right here. So that is why if even if I do PS minus e f or whatever I want to do on a type, Http, it's not going to grip it, so I need to start it to start. I will use the same command system CTL instead of status. I'll do start and http. It has started now. Now I will do systems, details, status, and now you will see that this statuses active and running. Now let's go to look for the label as C Lennox label for the process. All loopy s a X Z and grew up for http D and right here you'll see it has this entire thing is the label. And the type that I'm saying is this This is the type that you could change or Colonel can change if you specify some type of policy. All right, now, let's look at the socket nets. That t and lpz and great for http. And again, the socket has the same label and the type to it. And this is the type, all right, So now we talked about already. How do we check the labels off as C Lennox to every file, directory and programs and sockets? So that's move on. And let's talk about the commands to manage a C Lennix settings, there's a command called S E manage to label or change the label to all of these followings . There is another command ch con that could be used as well to change the labels. The labels can be applied to all of these entities right below log in user poor interface module node file context bullion is permissive state don't audit. I have how lot hot highlighted bullion. And this entire slide is because bullion, I would say, is the one that has mostly used while using etc. Legs. Let's talk about bullion. What is bullion while bullion is kind of like on and off switch, so there are pre defined out of the box bullion that come with a C Lennox. So if you have a ceilings install and it has started, the bullion is already there. Now what is a 1,000,000,000 billion? As an example, it tells us s you Lennox hate. Do we allow FTP server to access home directories? Meaning Do we allow FTP user the user ftp server when it runs. It has a user right FDP user not just specifically to be used for FTP. Do we allow that user to axity home directories now? If the bullion says on that means yes. If the bullion xyz off that it means it's off, it cannot. You could get a list of bullion was covered in a minute. Another example would be can history Pete D talkto elder or any name directory services. You would have a list of other things, too, like can Http talked to send mail to send mail or not letters on our off so you could make it on or off, depending on your requirements. And, of course, many other Bolivians how to get a list of all brilliance. Would we have What? What what What do we get when we install Lennox? What do we get out of the box? To get the list, you have to run the command, get SC bull, and of course, dash is for all. Or there's another command that you could get rich sc manage bullion nationalist, which will also give you pretty much the same result. As I said, you should go over every bullion that you have in your system. So this way you don't have to create your own or come up or install on your own. There are tons off them. That s C Lennox offers you right off the box to enable or turn on a bullion. Now you'd have identified this should be on or this should be off now How do you enable it ? Or how do you turn on and off? Now again, Keep in mind. This is where we are making changes only when s C Lennox is enabled. Once that is enable Onley Then you could do all those different configurations within s Olympics. Anyway, to turn on the billions you could have you could run the command set s e bull space minus p space bullion Underscore name which ever the name that you will see when you run to get a Cebull and of course on for on off check error messages related to SC Lennox. So if you define anything in the S a Lennix If you said any SC, um, any bullion and there is an error messages in it Or if you are running, um, an Apache server, for example, and and the popular server supposed to read Ah, file from a user's home directory. Let's say I have salt. You start up the Apache server and you get an error message that it cannot read duffel. Then, of course, you would go an end. Run a command journal, CTL Journal Control. This command is kind of Ah, a log. It keeps track off everything. Every error message that is related to s feelings. It would tell you Hey, the reason you cannot run that and I have noticed is because Apache Server apparently cannot read the file that you wanted to read that is located in slash home. I absolve directory. And why is that? Because you probably have given everyone to read dat file meaning on the other. You have given, like are to read everyone but still can't read it. Why? Because, as I said, it probably has a label, and the labels say's that it is only allowed to read for that only use. You have to change the label, especially the type to give it that label toe word Http, to change the type in a label you could run the C H con minus t like a CDPD and discourses content T violin. If it's a system file, you'd give that label. If it's a home directory, you give that home directly label. You can also run the command S e manage minus T http. D and discourses content T and filing. So these are the two commands that you could run to change the labeling off SC Lennox Let me try a few different commands. Clear this screen to get a list ofall brilliance I could get as Cebull dash A You see So many of them came up. Let me try to do Mawr so I'll see one page at a time. Okay. Cluster can network connect? Can the closer connected network off? No. Another example. Um demon used t t y know DCP use eld up. No. Oh FTP use ifs No off. So FCB user cannot access the sifs and most of them art disable or off. Http D can connect ftp server So meaning if you go toe of observer And in the vector where you you probably wanted to give a functionality toe klik somewhere and trash for the file And the only way to transfer the file If you have ftp running on your server so that is running All is good. Everything's hunky dorey Perfect. But now you still cannot. It's still not working. Why? Because number one you're SC legs is on number two. The HDP can connect. FTP server is off, so you have to go in and make it or turn it on and so on. There so many of them. As I said, you could go into one by one. And if you really wanted to get yourself familiar with all of them. You should go through each one of them, read about it and find out what they are for. And again, I'm sorry I can not go over all of them, because if I do, this becomes ah course on its own. And I do not want to waste all those people time that who really don't want to get into details off a salon X. But they do want to understand how it works. And as a system administrator, point of you can use at sea Lennox for a regular day to day work. Anyway, if you wanted to find out how many billions we have, let's say out of the box, you could do Ah, get a Cebull dash A and you could do WC minus l. And you will see there are 110 Bolivians that you could actually maintain or manage. Um, so if you want to set a boy and so let's say I wanted to do something with http. So the me do I grew up. Http. This is all with http. What is to be can do and what issue we can not. So let's say I want a cp to connect to FTP s. Well, so first copy this. And right now, as you see, it's all so before I just do grab, I'll just grip on the Pacific one it says is off, right? We wanted to make it on or turn it on. So Louis set s a bull minus p bullion and the bullion name is we already Now, which is this and then on hit Enter. It could take anywhere from two seconds to 10 seconds, depending on your system. Of course. Now, if you want to confirm whether it turned on or not, what do you do? You go through the same get s Cebull, and you'll see it is on anyway. Ah, that is something I just showed you for the laugh purpose. I'll go ahead and turn it back off, and it should turn it back off. Now, um, again and forcing get enforcing. Gets you what? Whether sc Lennox is an enable or not. If you want to disable it again, make sure talk to manager. Talk to your, um, security team. If you want to disable it or not, whether you wanted to get something out of it, anyway. So the point is, if you want to disable it permanently, you would do the I. But before I do B I I said, make sure you take a snapshot, so I'll make a copy. First of all, as the Lennox config to SC didn't up, put it in a temp directory. Temp config. That or I g rich. So I made a copy. Good. No, I will modify Assulin ex convict ball come down. And now I will. I put a comment on enforcing and I will take out SC Lennox equal disabled now it should disable it. I will go ahead and save it once I save it. What do I have to do when you do get enforce? It was still, say, enforcing for you to make it change globally or to system wide, you have to do a reboot. So let's see, when I reboot, it's a server unexpectedly closed. Never connection. That's fine. That's perfectly fine, because I am using putty. All right, so from this point on, I am going to wait until system comes back online. So I am going to fast forward from this point. Okay, so I got the connection back on, I'm going to close the other window behind it. And now I got a new connection. How? Log in as root. Now, if I do get and force it says disabled. So that's how you could get the information above others enable or disable. What was the other command that we would need to run to check whether it's enabled or disabled s e status. And now it's saying SC Lennox status is disabled so you could run ls minus Um C r sorry D c on my home directory. And it will still show that it it has the label on it because before it had at the Lennox enabled. But this whole a label, please make sure this whole label is not enforced right now. You can move this spot anywhere, and it will work based on the permissions which is defined here. And this permission is what is DSC discretionary access control Not through Mac, which in mandatory access control. So anyway, this is the whole topic about SC Lennox again. As I said, there is a lot more than what I have co word, but it gets into really nifty and green down in the weeds. So if you wanted to know more about STD clinics, I have included in this section the entire, um, guide the configuration administration user guide on SC links. So please, I would definitely recommend you to go where it read about it, and hopefully you get all the answers that you're looking for.
202. Remove Un necessary or Orphan Packages: one of the most important method off securing your operating system is to remove unnecessary or often packages, so unnecessary packages are the packages that you do not need or your system or your application does not require to have it on your system. And an orphaned packages are those that are left behind after you move the packages and there are dependency on them. So the first rule is to keep your server lean and mean. So basically no fat on it. Install only those packages that you really needed. If they are unwanted packages, what do you need to do just simply slash them to lead them fewer? The packages, The less chances off unpatched code, meaning every time there are issues to any packages that are install in your system, there has to be a code upgrade toe upgrade or update that package. So, of course to you, if you have less of the packages, the less of the CO to fix. So here are a couple of guidelines are you should fall. Number one is do not installed packages that you do not need during the initial installation period, the initial period or the emission initial installation is when you are actually going through the installation process. Make sure you do not pick any packages that are not needed. Pick the basic which is based. Install even Vidal gooey. I would recommend incorporating Marma. Don't even pick the Gu Ys simply installed the Lennox. That gives you a simple command line. Then if you have to install any packages later on, pay very close attentions to the add on packages. There are packages that will be added on as a dependency that were that are required for a package to be successfully installed so you could install those packages. That is fine, but there might be some add on additional that are non needed. But the program gives you like a promotion kind of thing to install to it make. Please make sure you closed pickle close attention to it and doing uninstall to get a list of all the packages that your system has right now, The command that you should run is rpm dashiki way off course. This is a command that is that works on Red hat Santo s and fedora type of Lennox distributions. You could get the listing off all the packages that you have in your Lennix machine. Through that command and the same command, the same purpose can be served from a different command on a bunch of server, which is a empty space lift list space dash installed by the board of these packed both of these commands give you the same results is to get you the list of all the packages. What you should do is if you are going through the package, um, validations or auditing or and securing your system, Then what you should do is you should run these commands. I'll put to ah file when you get a listing off all the packages you have installed. Put that output to a file and then that you should go through each and every package one by one. Now, I do understand. And I completely agree for those who are thinking right now that Oh, my God, I have 1314 or packages. Are you kidding me? I have to go through it all those packages one by one. Okay. The answer and the heart answer is yes. If you wanted to secure your system, you have to go through all of them one by one. Now, the good news is that then you go through all of them one by one and you have a standard build that your systems that you're gonna be building more, sir, systems down the road and these other packages that you need to install and the remaining ones you could get rid off. Then it means all that effort will pay off. You don't have to go through the filtering process again. You could just compare what you have, what you don't need and then what you don't need, you could just simply discarded. So most of the time of the general practice, most of the corporate environments do have that practice in place. If you join a company, they probably have something. A template off a system that tells you Hey, these are the package that should be installed in. These are package should not be installed. Perfect. You're in perfect war. You get in also. But what if you get into a job and they don't have that type of standard template then then it's a time for you to shine. Basically, this is your opportunity. Go to your manager. Tell them Hey, listen, I noticed that we are installing every package in the system and we should not. So let's remove them. Also, one of the great thing at every great manager asked you when you go for an interview, how do you make your system secure? And if you answer, I will remove all unnecessary packages or offer packages. You'll score it right there. You'll understand that. Where you coming from? So anyway, go back to the point is, make sure you have a list of all packages. Go through them and remove them to remove packages. The command you would have to use his rpm space minus E to a raisin package name and then, of course, is our PM is a commander Fred had or centralised for a bun. To type off limits distribution, you have to use APP get, which is hyphen app, hyphen get space removed and space package name. Both performs the same function as long as you get the desired result now about orphaned packages. What are those? Let's talk about them. The objective is to remove all orphaned packages from Cento s Lennox by orphaned packages. We mean all packages which are no longer serve a purpose off a package. Dependencies, for example. The me give you a quick example. So you will have a better understanding What exactly the above paragraph means package A. Any package called a package. A is dependent on package. Be does. In order to install package a package be must be installed in required. Understood. Once package A is removed, package be might still be installed. You see that? Therefore, the package B is now orphan package. So you have removed package A. But package B was required to have a package A but now, since package is gone, you don't need package being right, said thou. Those packages that classify and package be are often packages and you should delete them. Now, how do you identify those packages? Good question. Moving on. There is a building utility which allows you to check for offering packages. Angela Nix machine for Santo s type off limits distributions or Santo s. Ah, red hat. That utility is called jum utilities. Of course, it's the rpm packages as well. If you have that installed and it means you have that command that I'm going to show you right now, check if that exists in your system. Meaning check if the dependency or orphaned packages that exist in your system. Oh, sorry. Let me take one step back. What I meant is check if that utility yum does util exist in your system is to run rpm dashiki. Wake up. Um, utilities. If that packages there, then it means you don't have to download. Install it. But what if it does not exist? And simply you could do jum install yum dash utility. Okay, the once you have that installed, that's suppose you have it. Now the next question is get a list of all orphaned packages and that is packaged ash cleanup space dash leaves. It will give you everything All the orphaned packages in your system once you identify them , What you didn't need to do, you need to remove them off course You could do r p m minus e. Or you could simply use this command, which is a lot easier. Yum space removed, space package, dash clean of the same command of your and earlier. But of course, with back Tex, back ticks are the one that is right below you escape key. And of course, for a bunch of system type of systems. All you have to do is apt ash get or remove, and it will do all the job for you. All right, so that's about removing unnecessary or orphaned packages. Now, I want you to actually log into the system to your learning system and follow the way I'm gonna log into my system, and I'm gonna go through these few commands. So I have my limits machine right here. And first of all, I'm gonna check the list of all the packages that I have, which we covered in the last, um, slide. I'm gonna doom or and see. Look at so many packages I have No, If I want to count how many I have, I could do simply rpm desk, you a WC minus l and it's gonna tell me I have 1411 packages. No killing. Yes, that the that is a high number. But anyway, as I said, what you have to do is you have to output to a file like temp. Um, system rpm's told it creates a file and, uh, puts on by getting the output off rpm desk you away, Then you go through all those packages as it said one by one, and you delete them now, the next commanders to remove rpm's or remove orphaned packages. And for the utility, you need to have the utility. And first, to find out whether you have the utility. Ron R. P. Minus Qiwei corrupt for jum Dash U T I l s. Yep, I do have it perfect. I don't have to install it. If if I If I didn't, then you would have to install it now the next one is clean up to check all the orphaned packages. So package cleanup dash dash leaves. By the way, it's dash dash leaves, not just one single. Ah, hyphen. It's two hyphens. There you go. So it's give me all these listing listing off those packages. By the way, how many? We have WC minus l eight of them, so I want to get rid of them. Perfect. So what? How do I do that? Simply run Jum. Remove back tick tactic close and hit Enter and it is going to remove all those packages that are listed above. Hey, guys, going through that, it's just asking. You wanna go ahead and remove it just a way to go and remove it. Raising, raising, raising and so on, so forth. And it is complete. Now, if you run that same command, um, it shouldn't give you any. If it does, then you could run these commands a few more times to make sure you have a fully complete system that IHS free off all orphaned packages anyway. So that's how um, you do remove unnecessary and orphan packages again. If you have any questions, please send me a message. And I'm always here as any questions you guys have. Thank you.
203. Types of Security Threats: Hello, folks, When we are talking about security or even securing the environment around our computers, we need to understand what are the security threats so you will be able to secure your environment or your Lennox computers or hardware properly said those threats won't get into your computers or won't disrupt your operations. So in this slide, what I'm gonna do is I'm going to list all those security threats and then the following slide will have the details on each of those streets. So let's look at them real quickly. The 1st 1 is distributed denial of service, which is de dos attack. By the way, I do want to mention one more thing that the A list that I'm going to cover is actually the list. I got it from the website from the Canadian website, the Canadian government website. They have that, um, listed, and their website. It did a great job listing all the security threats. Also, some off them I should want. I do want to give credit to some of the American rep size where I got some off the Maurin Formacion to understand the Scurti threats out there. All right, moving on and then every have hacking, malware, forming, fishing, ransomware, spam. We all heard of spam spoofing spyware, Trojan horses, WiFi eavesdropping, viruses warms and so on. Anyway, there's so many of them I might have missed a couple of them, or probably there more than couple, which I don't know, but again so far that I could understand these other real threats that could infect your computers. And you need to be aware of thes. Now let's get into detail off each of them. The 1st 1 that we have is distributed denial of service, which is de dos attack. When a hacker puts a network off zombie computers, other people computers to attack or destroy ah Pacific website, or server, that increases the volume of traffic overloads the website or server, causing it to be slow or server shuts down completely. So basically, the hacker, of course, wouldn't have so many computers to attack. So what they the hacker would do that the first step is to control or get into other people's computers. Then it creates the network of those computers and then attacks to a website. So let's say if a hacker wants to bring of upside down, Um, any website that is popular, so they wanted to bring them upside down. So what it does it controls all the people's computer and takes their control and send a traffic to those websites. There are websites that do not hold so much traffic, incoming traffic. So what happens is it overloads and it crashes. So next one we have is hacking. It's in simple words when someone gains on authorized access to your computer. So if someone is coming into your computer, whether user name or password that matches with what you have, it is which is, like, you know, making a duplicate copies off off your keys so that simply is hacking, then moving on. We have malware malicious offer that infects your computer, such as computer, Weir says, warms Trojan horses, spyware and adware. All of those are actually called the malware. Now, once you have the malware on your computer, what other consequences intimidate you with a scare? Where which usually is like a pop up message that tells you your computer has a security problem or other false information gives you and tells you Hey, your computer? Excuse me? Your computer, um, has this wire is that you need to install the software, paid this much money to get that wires out, and you get scared and you actually buy that software. So this way you could clean up your computer for any wires. So another one is that it could reformatting your hard drive off your computer and, of course, causing you to lose all information it alter or delete your files. Steal sensitive information. If you have saved on your computer, send emails on your behalf. If you are in the corporate world, that's really bad. You could send your emails on your behalf, and, of course, it could tarnish your reputation. Take control of your computer and all the software running on it, So that's about malware. Now moving on, we have farming forming. It points. You toe a malicious and a legitimate website by redirecting the legitimate Ural. Even if the oil is enter correctly, it can still be redirected to a fake website. So let's suppose if you go to, um facebook dot com, you actually typed in the right, um, host, name or write your old, but it's actually taking you to another website. So is that something Facebook listed as another website. Now it says something that they will show you that. Hey, I'll take you to another one. So just be careful. And what are the consequences? It will convince you that the side Israel and legitimate because they make it the exact same site. And and as you know, it's very easy to to copy the code off a website and paste it in your any other, um, illegal websites. Um, so anyway, as I was saying, convince you that decide Israel and legitimated by spoofing or looking almost identical to the actual site down to the smallest detail, you may enter your purse information and unknowingly give it to someone with malicious intent. All right, next one, we have fishing fake emails, text messages and websites created to look like they are from authentic companies. They are sent by criminals to steal personal and financial information from you. So please be very careful. Whenever you receive an email in your inbox, the best thing to do is click on that e mail and check whether it is coming from the legitimate domain. So if you are getting, let's say, suppose if you're getting an email that says, Hey, this is your PayPal account your account. You need to change the password or your account being hacked to change the password right away before you actually start jumping into it. Please click on that e email the one the sender's email and look at it after at paypal dot com. If I should say that, or any off the financial company or any off any other website, so be very careful with that. The consequences off off it is, it will trick you into giving them information by asking you to update, validate or confirm your account. It is often presented in a manner then it seems official and intimidated to encourage you to take action. Also provide cyber criminal with his user name and password, which, of course, you don't want it so that they can access your accounts, your online bank account, shopping account spectra and steal your credit card numbers. So just be careful. Many times you do have the same user name, same past, for for many websites, because we we are humans. We don't want to remember every single password or every single user name. So once statues, the name and password is provided to that fake website or that ripple are you? Reply back to that email than your information is compromised. Ran somewhere. This is also one of the funny one. It's just like as as you have, um, any kind of when someone is trapped in someone trying to ask you for money is similar to that, Um, so they ran somewhere is a type of malware that restrict access to your computer or your files and displays a message that demands payment in order for their sections were moved. Their two most common means off infection appear to be phishing emails that contains malicious and attachments and website pop of advertisements. All right, what are the consequences of ransom me there, too? Common types of ransom wears lock screen ransomware so it will display an image it that prevents you from accessing a computer joke. Your computer will completely be frozen encryption. Ransomware encrypts files on your system, hard drive and sometimes and shared network drives like USB drive, external hard drives and even some cloud sores dr. Preventing you from opening them. So I hope you were not being ever infected by grand somewhere But if you have our had in the past that you probably noticed that they will actually display a pop up message on your screen and lock up your entire computer. So that's basically they're asking you. Hey, we're not gonna let it go unless you pay and how you're gonna pay. They're probably gonna give you some email or some another Ural of upside to go there and pay them. All right, Spam. Spam is one off the mawr. Common matters off both sending information out and collecting it from unsuspecting people . Consequences are annoy you would unwanted junk mail that we all get. The junk mills create a burden off communication service providers and business sister felt electronic messages fish for your information but tricking you into following links on entering details with offers and promotions. So you're probably gonna get this, um cut. Type off. Ah, Spammy. Mother says, Hey, you won $10,000. Click right away to claim your reward. Just be careful. You don't want to go that route. Just remember, there is no free lunch, so just be careful. When you click on any of those, it provides a vehicle off malware scamp raw threats to your privacy. All right, next one we have spoofing spoofing. If this is a technique, off is often using conjuction shin with fishing in attempt to steal your information. A website or email address that is created toe look like it comes from a legitimate source . An email address may even include your own name or the name off someone you know, making it difficult to discern whether or not the sender. Israel. So how do they know that this is the person you know? Probably they already got to your attachment, or so your contacts and they will know. Hey, this guy has this contact list and that these are the people this person knows, So let's create those emails. But maybe you know someone, Let's say John Smith at gmail dot com. But they were creating the Melissa's John Smith at yahoo dot com and this entity and you look at you. Look at that email, you say, Hey, I got that from that email from John. I know John, so just be careful on that, too. No, I consequences. Spend spam using your email address our variation off your email addresses to your contact list Recreate website that closely resembles authentic site. This could be a financial institutions or other size that require log in or other personal information. All right, next one. We have spyware software that collects personal information about you without you knowing they often come in the form off a free downloaded and are installed automatically with or without your constant. These are difficult. Remove and can infect your computer with viruses, and the consequences are collect information about you without you knowing about it and give it to the third party or someone else. Send your user name, password surfing habits, list of applications. You have downloaded settings and even the versions off your operating system to 1/3 party. Change the way your computer runs of adult your knowledge take you toe. Unwanted side are undated or in UNDATED two with uncontrollable papa bats. All right, then, we have true John horses. A Trojan horse may not be a term you're very familiar with, Um, of course, I wasn't familiar with either, until I did my research on security threats. Okay, so but there is a good chance, as you or someone you know have been or has been affected by one A militia program that is disguised as are embedded within legitimate saw. For it is an execute herbal file that will install itself and run automatically once his downloaded. So I think I remember one time I actually downloaded a software which it was the actual real software and that there was one software which was added to it. And it actually has that option to uncheck to install our keep it checked. But sometimes when we already lazy toe uncheck, we don't even read it. I mean, you just keep on going. Click, click, click, click. So just be careful when you're installing anything on your computer. Don't just go. Don't don't be like me. I was I was affected by that one time. So read everything when you're going to the installation, so the consequences is it could delete your falls. Use your computer to hack other computers, watch you through your webcam, log your key strokes such as credit card number you entered in an online purchase recorders and name password, Another person information. All right, then we have viruses. Most people have heard of computer viruses. Yes, of course, I have as I said in my first light. But not many know exactly what they are. Or they are what they could do. Militias, computer programs that are often sent as an email attachment or a download with the intent off infecting your computer as well as computers off everyone in your contact list. Just visiting a site can start an automatic download or for virus. Yes. Um, um, and many times, those type of wires is also show up as a possible Ah, Papa Windows as well. So, um, careful when you go to a website, Um, just I would say what you could do is the best way to avoid this is that you go toe, um, a search engine. Um, that allows you to view that website before you could actually open it. So go to a search engine that's a Google or Yahoo and type in that website there. Then, instead of click knowledge, just hover your mouse over the link and some of the search, um, search engines allow you to take a look without even entering Dav Upside are consequences. It sent spam provides criminal criminals with access to your computer and contact list scan and flying personal information like pass her on your computer, hijack your Web browser, disabled your security settings and display unwanted ads. All right, then we have WiFi eavesdropping. WiFi eavesdropping is another matter. Jews by cybercriminals to capture person information, virtual listening in our information that's shared, or an unsecure not encrypted by find number. Meaning. If you are on a public WiFi, maybe it's not secured. And whatever that you do on your computer or whatever the information that you watch over website, you're going to, um, there are people who actually have those WiFi eavesdropping. So just be careful. I always recommend people not to do any type of financial transactions while you are using Ah, public wife eyes consequences. Potentially access your computer with a little right equipment. Steal your purse information to in log ins and passwords. All right, let's talk about warms. Warms are a common threat to computers and the Internet as a whole. Ah, warm. Unlike a virus, goes toe work on its own without attaching itself to files or programs. It lives in your computer memory, doesn't damage or alter the hard drive and propagates by sending itself to other computers in the network, whether within a company or the Internet itself. Consequences spread to everyone in your contact list causes a tremendous amount of damage, but shutting down parts off the Internet Reckoning. I have work on an internal network and costing companies enormous amount of lost revenue. All right, so that completes our types of security threats. I know I've covered a lot. Um, if you need to review any one of them or I have I might not have done a great job in any one of them. Ah, well, highly recommend you to please go online, search it that Pacific thread and try to understand what those threats are and how or what other steps that you could take to avoid them. Good luck.
204. Cannot CD Into a Directory: cannot CD or change directory in to our directory, meaning when you trying to run the command CD and you try to go toe another directory, that's where you are having an issue or you're getting an error message. So why is that? And that is what we're going to troubleshoot today in this in this lecture. So there are few, ah, steps that we could take to actually isolate these type of issues. And when you cannot get into a directory, of course that there are a few things you need to check. Ah, few things to keep in mind and those other things that want to list today. First thing First directory does not exist. It's just that simple. So you are trying to CD into a directory or a folder, but she cannot end the error message that you're getting. His directory doesn't exist. Try to read that message. The output, the earth, What it is saying to you, saying the director does not exist, So either you are not you. You actually have ah, incorrect spelling off the director. You think a type you fat fingered it or, um, it's simply just does not exist? Are somehow it does not exist in there. Right? Directory where you are. So first thing is how we could tell that the director not exist. So let me log into my machine. I have a machine right here. Now I am logged in as as myself. A route. Sorry. I am in which directory I do P w d. I am in slash Through direct here in this directory I will create a new directory and our call it Seinfeld. Okay, so now when I do ls minus l t r. I will see the directory. It is created with the name sign fell. Now if I'm trying to CD into the directory Seinfeld, huh? Why am I getting this? No such file. A directory that is the most common issue people see and they get confused. Oh, my God. Why? Where did the director go? But you need to understand. Relax and see what the problem is. If you notice I type a per case s where, as the directory that I created is with lower case is now in Lennox or UNIX environment, upper case and lower case matters a lot to keep that in mind. So the Seinfeld with uppercase Derek. He doesn't exist. That is why you're having issues. We're logging in our VCD into this system into the director. Now, next thing is absolute worse is relative paths, um, menu trying to CD into a directory. Ah, many times you have a path given and you put the path in, but it doesn't work or you are trying to see the into through a relative path. You need to know where there folder is. Let's get into my next machine again. Let's clear the screen. So we do have a directory that we created, which is signed ful. Now I want to see the into the soft Seinfeld directory. I'll hit. Enter. There's nothing in that director because it's empty. In the Seinfeld directory, I will create another directory called Jerry, and I'll create another directory called Cramer. So now, inside of sign ful, I have two directories, Jerry and Kramer, and if I go into Jerry Directory and I'll do pwc de, you will see the entire path off. This territory is a root slash Seinfeld slash jerry. So that is one off the things that you will experience when you track to see the Inter directory when you are missing Ah, sub folder or subdirectory and the absolute path this entire path. If you trying to CD into this entire path, it will work. It is going in. But if you are missing, let's say if you're missing one directory, that's the root and Jerry, you know that you created Jerry, but you just couldn't keep track of where that directory go. You had entrances. No such file or directory. Now you are back to the equation. One where you were talked about director doesn't exist. You need to relax. You need to see where that direct he was created anyway, so make sure your absolute path is correct when you come to relative path. Relative path is when your CD in. Let's say, if I'm in CD Slash and when I do PWD, you will see I am in slash directory. I could go straight to Jerry directory the way I did it before with a CD slash route. So I signed, felt and slashed. Gerry and I will go straight into the directory, but if you cannot get in and you're trying to troubleshoot where that directory exists, then I would recommend you that you go one step at a time like you are climbing up the stairs. Don't just try to jump three stairs up. Go one step at a time. So for that you'll do CD slash route. Now here, you need to do ls minus l. And see if there is ah, folder or a directory in the listing that says Jerry does it. No, right, so it means it's not there. So try to see where that directory is. Then you'll go into another folder that is called Sign Ville. You are in the Seinfeld do ls minus. L. Again. And now there it is, the directory called Jerry or Cramer wherever you want to go. And that's how you are ending up with the directory, Jerry. Another common mistake people make, which is going through the relative path but specifying absolute path. Who doesn't mean Let's check. So if I'm CD into Slash, this is my main primary, the root very first directory of the system. Now I wanted to go into slash root directory. Okay, I am in slash root directory. It says I am in slash route and I'll do ls minus. L and I do see that there is a direct call Sign fell. I want to see the into this directory. But many ties, The mistakes that people make is they do CD slash Sign fell and then you had enter. You get the same message. No such follow directory. Why is that? Because you are telling Linux operating system that this slash Seinfeld is actually located at the root level, meaning at this level it is not located at their root level. It is located under slash a root directory. So if you're going to specify slash then the system is gonna think that you are trying to find that Seinfeld directory in this slash fruit, and then you do ls minus l. You'll see there is no sign fill to make sure you need to know where you are using slash and where you are not. So. That is why that's a common mistake people make when they do absolute path. Worse is relative. Next one, we have permissions off course. This is also very common when you are trying to CD into a directory and you can not because you do not have permissions. Let me explain you permissions first, if you have not, Um if you do not have quite a bit understanding off permissions, that is fine. I'm here to help you. So I'm gonna explain you the permission port in detail. The permission off a file or a directory is divided into three different groups. One that you see on the left hand side, which has four bits. By the way, these dashes are referred as bets. Then this is a section which is divided for group, and this is a section for other. Now. The first bit is actually the one that defines what type of file it is. Whether it is a file, it is a directory. It's a link. It's a socket file. Anything, any type of file or it's Ah, um, what's the function off a file? It's all defined with the first attributes. If you see a D here on the 1st 1 that it means it's a directory, then on Lee, then you could go in. Second bit is about Reid. So if you have read it permission on the directory, then can you get in? No. Read permission on a directory means you could still get in if you have executed herbal, but you cannot write anything. So this is the read 2nd 3rd bit is about right. And the 3rd 1 is about execute. Same way it goes for the, uh, sorry. The first part that I just explained you is about these you. The second is for the group. The 1st 1 is you. Meaning is yourself that you are the owner off that directory. Now, don't confuse this. You with the last Oh, because a lot of people confuse you as user with always the owner? No. Oh, it stands for others anyway. So second, set off, um, permissions again. Read, write, execute. Then the 3rd 1 is for everyone else to read. Right? Execute. These are the permissions about every file or directed every create. So let's go into our machine and you will see here. I'm gonna go into slash route ls minus. Lt are to see my Seinfeld directory and you notice in the Seinfeld directory. We have thes permissions if you have. If you do not have d in front off a directory, it means it's not a directory. No matter how many times you've tried to see the into it, it's not gonna work. Then you're going to see is read right and execute thes three bets. It means the user who is route can have read and write and execute permission. When you say read, it means the user can read the content inside of the directory. When you have right, it means the user can actually write or create files inside of this folder. And when you have X, it means the user can actually go into the directory. Now, this is very important. You need to know this. If you do not have this little bit right here, execute, then you can not cd into a director. So make sure which ever group you are whichever whoever the users you are, you should have executed herbal permissions to CD into the directory sometime. People confuse that with the read permission. Read and execute is not the same read allows you to CD into a directory, whereas this are allows you to read the content. If you do not have our then you could still see the into a directory. But when you gonna run unless minus, l is going to say you don't have permission to view the content of the directory. So you got it. Hopefully you do. Then the second step is from here. Our dash x This is for everybody else. Meaning not Not so. Everybody. This is for group right now. The users rude. The group is route. There's at the two column who owns and who actually which group they are in. So the group permissions you could actually read the content. You could see the into the directory, but you cannot create any file or directory. The last one is the same for everyone else. You could read the content and you could see the into the directory. But you cannot create anything in it, so make sure you do not you have their permission. So if I'm going to take out the permission off others off sign fill. So now what I'm saying is Onley route and it's group can get into Seinfeld. Everybody else cannot and you do a list myself tr you'll see that little that little X is gone now when If I become myself, which is I of soul. Now if I try to go to root Permission denied Oh, even rude doesn't have permission for me to come in. So let me go to slash and I'll do ls minus. Lt are on route. Where is root? Right here. You see, At the root level, I'm not allowed to come in. Forget the sign. Fill level. So make sure this execute herbal exist, So let's go back as root. So this time I'm going to give permission for everyone to have two CD into route. No, I'm in. No, this one has a full, uh, their chief Seinfeld and I have taken out executed herbal. Now I'm going to give it back to execute herbal. By the way, this is a command change. Ma. I am hoping and album assuming everybody knows this is the command to assign or remove the permission off a file or directory. So now l do l s myself tr and you see, the permissions are granted to CD into it. I so cannot create any file. What if I remove our changed mod? Others remove our sign Fill. Now, when you do Alice myself, he are you notice? I do not have read permission. So now if I go into the Seinfeld directory and you see, I could view the content of Jerry and Kramer because I'm route. What if I become? I have soul, and now I go to seedy into slash route. And I do ls Marcel. I cannot view the contents off. Ah, slash route. Why? Because at the root level, right here. See, right here. No one other than route or his group is allowed to come and create a reader content. That's why you're getting the permission denied or you're seeing cannot open directory. You could still see the into it. Why you concede into it? Because we have given execute herbal if you remember right here. Um, let's go CD slash Where is route? This is route. If you notice we have given the permission to come in, anybody could come into route. But they cannot view the content because they don't have a Rick Reed permissions anyway. So that's another reason why you cannot see the into the directory. Next reason file type. This is I already talked about it. If ah, file or dirty does not have a d in front off it than you. And it's not a file. Sorry, then it's another directory. So if I am and in my home director home. I have solved and I create a file called Touch um Elaine. So if I try to CD Elaine, what will happen? It will say it's not a directory. Why? Because when you do ls myself tr, you'll see there is no d in front of it. So that's the file type I'm talking about. Make sure the file top is correct. The next one is parent directory permission. We have already covered that when you do not have ah, correct permissions, let's say on the slash route, no matter how many permissions you have after their slash route, it does not matter, is just a front main doors, locks that you cannot go to the bedroom door. So that's why make sure the parent directory has a proper permission and the last one is the hidden directories. Ah, many ties. People, um, also make a mistake off a hidden directories, meaning you create a file or directory. Listen, M k d. I r, um, And I will make, um directory dot sim son and a dual s minus lt or and you notice there is no Simpson, but someone tells you had go to this directory and they actually miss out the dot because the dot is something that it's makes it hidden. So you will have to do ls minus. L. A. To show all hidden files and in the head and file, you'll see there's a Simpson directory. Now, you could do into CD dot Simpson. And then now you ain't to make sure the director you're trying to come into is not hidden. So these are the few pointers. Um, I want you to keep in mind if you go through every step off thes, uh, troubleshooting steps. Um, you I'm pretty sure you will be able to resolve your issues.
205. Cannot Delete, Copy, Rename or Move a File: cannot delete, copy, rename or move off oil. All of these operations are same. Are there related pre much perform the same function. So that is why I'm putting all of them in one lecture. And I will cover all of them in this lecture one by one. So let's look at why there is always issue when we are trying to delete a file copy, rename or more files. By the way, renaming or moving off all on Lennox, we use the same command, which is move. So it doesn't matter what Ah, what beyond renaming it to all in all matters, if you are using the right Centex So let's go over our sequence that we already covered. I'm gonna go. We're really quickly and then I will log into our linens machine. I will try a few things that we think could impact Um, these type of issues. Ah, file does not exist. As you know, we talked about it many times. People make mistake meant file does not exist. Absolute path, worse is relative path and you try to delete a file, make sure you are in a right directory and their file exists here. If it's not the right directory. You're picking the right absolute path. Then the file type. If you are trying to delete a directory and you're using the RM command, it will not delete it. It will give you er message or it will tell you that the pile is a directory. So you could either usar Emma minus our command or R m d I. R command for a directory. Permissions One of the biggest thing be covered it so many times again. Penn permission VFA or Talk to Bobby have Jews is itself created Ed. We have group and others. Parent directory permissions should also comply with the rules. If the parent directory does not allow you to to have the right permission and then you cannot delete or move or any copy anything from that file, then we have ah, hidden files. Make sure the ball is not hidden. The command cinc ticks is as important a Xeni any of the above listed here. So when you are typing often, you deleting Ah, file. Um, it's simple that you remove and followed by the camera the name of the file. But when you are copping it, it is important that the source comes and first because that's what you're copping. And the target comes later because that's where it is going to. So that's pretty much the country will cover again. This is really quick. I really want you to follow this and all of the steps one by one. Now I'm gonna log into our limits machine and then we'll try a few of these things one by one. So I am logged in as myself. If I do Sorry, Not who If I do, who am I will see. Sorry, I'm not logged in. It's myself. I'm logged in as root as you notice. That route has a prompt off pound or hash. Let me clear the screen now. I will go into CD War log and I will do. It s minus. Lt are, and you'll notice it has a bunch of files. Now, Um, I wanted to delete this file, bar long messages, and you notice this file is owned by route and the group off this file is route and it is allowed to be deleted or written by the owner itself. So I am not going to delete as my self inches the route. I will go ahead and duplicate decision meaning I will create another session to them to the server and have a log in as myself. Now I'm logged in as myself and I do. Who am I? You will see. I am locked in as I have solved, I will go into CD Warlock directory. And I will, um, go in and see the messages foil. And now this time I'm going to try to delete it. Our message is and hit. Enter and it is telling me, Remove right protected, irregular file messages. Now it is asking you, Do you really want to remove it? When you say why? It say's permission denied. Why? It's his permission denied. Because who am I? I am I off saw. Okay. Am I the group off this file? No. Am I the user off this file? No. Okay, that is fine. We confirmed it. Now the user off this file has a read and write permissions. Meaning only route, which is right here, has a read and write permission. Everybody else, which is the group or everyone else? The others do not have any type of permission to either delete it, Remove it, copy it removed or anywhere. So if I am also trying to, let's say the next step that I'm trying to do is copy this fall. If I wanted to copy this messages while and I'll just copy messages and I want to copied in my home directory in my home directory is home. I have solved it. Stays cannot open messages for reading because the permission denied again. Why? Because I am. I fall in this category right here in the last bit and in the last bit is telling me that I do not have read permission. If I had read permission, I would be able to copy it. So let's say if I assigned the read permission to this file as root. So I'll do change. Mod Other plus Ah, read because all you need is read permission to copy a file and then do messages. Now when I do ls minus. Lt are you'll see on Lee our, which is to read the file is a sign it to everyone else. If I do the same thing now, copy messages to home off salt. It did copy, and when I go to home I have solved and do ls minus. Lt are you notice now? It created a copy. And now the copy of the file is owned by myself and my group. And it is. Actually, it has actually transferred the same type of permissions that I had or the route had being the owner off the route. So that's what is all about? Can a copy cannot delete? Now, what if I, uh, have a directory? That's a temp? So before I go temp piled CD slash. I do ls minus. Lt are. And you notice the temp directory right here has all the permission that you could think so I could actually copy the message is filed war log messages and to that directory as well. And it let me copy. No, what if I create a directory and it does not have the right permission? So if I try to copy that same file in that seat Now you see at sea right here. This is the one Etsy is saying. The group and anybody else do not have the right permission. So even though I have given the reader permission off messages, I cannot copy that Messages file and etc. Because now the source has a permission. But the destination doesn't have a permissions, so keep that in mind. It is very important that the source and the destination both should have the proper permissions. So if I do, if I had entered, you could see it says cannot create regular file at C messages because permission denied. So keep these things in mind. It is very important that the source permissions and the target permission should also be the same. Now let's go to my home directory, which is home I have sold Sign um, IVs all I have a directory. In this my home directory calls Seinfeld. And when I do ls minus lt or the Seinfeld directory. If I do pwd again home, I have solved Seinfeld. The Seinfeld directory has thes list Off Falls and Directories one directory, which is called Seinfeld Family and the other there's Elaine George Cream were David and Susan. I will go ahead and focus on file Susan, if you notice the file, Susan has the read and write permission for its own self, which is me. Read and write for the group, which is also my group and the read permission for everyone else. So if I wanted to delete this file, do you think that I should be able to delete it without any issue? That's tried? RM, Susan and hit enter. Permission denied. Oh, my God. Now what happened? Why? I'm not able to delete this file. Now. At this point, when you look at it, first thing you have to make sure is you have the correct permission in the fall. Me? The file is owned by me and myself is right here. Yes. And who am I? I am myself. Okay. Said that is that has been confirmed. That file is owned by me. Who's the group? I'm the group as well. And for me, I do have that right. Permission? I do have his group as reading. Write permission. Then why can I delete it now? I want you to think in a broader way. Go one step back and find out if the directory where this file is located, which is a sign fell. If this directory allows you to delete the father or not, let's go back. Cd dot dot Did it? This is to go one step back to PWD. you see, I'm one step back now. I will do a less mind sell tr and file at the directory that Susan file was in a Seinfeld. And look at that right here myself. Which is I absolved the stuff 1st 3 bits are for me. I do not have the right permissions. That is why it did not allow me to delete up for so again, it is very important that you also check the parent directory and make sure the parent directory is has has the correct permissions. Also make sure it is owned by the right person. So let's say if I create a file in this directory in my sign fell home. So I'll as as route. So I log in, I will come into home. I absolved because I'm route on this window and I could go anywhere and in Seinfeld. Sorry. In here, I will create a directory and I will call it, um make de ir um route the i R. One. So now the Route de ir one has this directory. It is owned by route. It is owned by Route Group. Groot itself has read, write, execute herbal. Everybody else can log can get into the directory. Everybody else in the group can get into a very but they cannot delete anything. So I'm gonna go into root directory, and I'm gonna create a fall ABC. Now, the ABC fall is created and everybody, and if you notice the permission of the ABC filed it on, Lee has its own self read and write. The everybody else's has read. So now I am logged in as myself in the other window. Who am I? I have solved. Now you notice this one has a directory called Root Directory. And this is a file ABC remove ABC. Yes, and it says permission denied, So it did not allow me to delete it. Okay, so now how about I changed permission for it to be deleted. So ABC is the file. So I will like to have change a all of them. Plus, right, ABC. Now everybody has permission. Perfect. Now you come in here and try to delete it, and it's his permission denied. Why is that why I cannot delete it now? I just gave it the right permission, Right? So let's go back one step and let's verify the root directory Self Seadrill Directorate stays. Look at that. There is no right permission to anybody. So these are the things I am telling you this the second time. So make sure you need to check your parent directory. Let's talk about the next thing I want to talk about is the renaming off the file. So if I am logged in as myself Sorry. Who am I? And I will go into the Seinfeld directory. And I wanted to rename Susan. So I'll do move Susan to Susan one. I could Still I still cannot do it. Why? Because I do not have the right permission. Perfect. So I'll go one step back and I will allow the right permission to the directory. So change marred A By the way, at this time, I'm gonna pick minus or minus. R will cascade the permissions down to any sub folders as well. So all should have a plus w sign fill. Now, if I do sign ful, you see, everybody has the permission to do anything in the Seinfeld directory. Now, if I go and to the Seinfeld directory lenddo ls minus. Lt are now. If I try to move to Susan to Susan one. I should be able to. That's one thing. Second thing is, if you want to rename and you do not give the destination names So let's say if I want to move Susan one. You want to give it a destination name, right? If you don't give it, it will tell you Missing destination for opera and after Susan one. So it's basically telling you, in other words, that you have to specify the right name for Susan. So the right name that I'm putting to rename it up put Susan too. And the Susan to file has been changed. So that's about moving the father renaming the fault. Sorry. Rename the file if you want to move off from one location to another, we talked about it as well. But if you do not specify the destination location, it will give you her message. Last thing I will cover is if you notice that right now. Um, if I go one step back right now, Seinfeld has all the permissions that it could think off in the world. So if I wanted to go into Seinfeld directory and delete it, delete something isn't going to allow me to delete it. Well, it depends on the parent directory that is sitting on top of Seinfeld directory. If I do CDs dot dot and Alice minds lt are you notice no one has any type of permission to come to my directory, which is I have solved and do anything in there. They cannot even come in and actually go into the directory or CD into the directory. So here are a few things that I cover. Hopefully, this lecture served its purpose. If you have any question and if you are still having any issues with the leading copping renaming a moving a file, please send me a message and I will create a new lecture for you to go. We're in trouble for that issue with you.
206. Filesystem Corruption: fire system corrupted or if there is a file system corruption. Well, what is a file system? Flowers system consists off, um, the directories or folders that you create in your operating system and there are different type of file systems as well. But all I'm saying is, if you want to learn a lot above what a file system is, I have included a lecture in my bonus section, which tells you about file system, and it goes into details. Health file system is structured. What is the purpose of file system? So I would recommend you to go into my bonus section and check what a file system is, anyway. So let's focus on our lecture right here, which is the file system corruption. That's also one of the main, um, issues with a system administrator experiences when there is a file system, corruption and the system run slow or system doesn't even boot up, or you cannot mount the file system to your mom. Point so there are different type of file systems. The file systems are like extension three Lennox extension for X if S N T fs or fat and windows. These are all different type of file systems that we have in operating system. Ah, file system layout and petitions are like slash, war, slash, etc. Slash route or slash home. So whenever you car a disk and you give that disk to your operating system, the first thing you have to define is what type of file system do you want for it? Then you pick a file system. For example, e x t. Four. Once that is assigned to your file system, the next step is to partition that disk or their file system in the way you want. If you leave it a default file system than everything goes under slash. But if you wanted toe petition ah, with add vast petitioning option while you're doing insulation, then you could use slash war slash at CEO, which ever the petition or mount point that you want to specify. So what happened is when the vile system is corrupted, it is usually gets corrupted in one of thes partitions. Maybe the slash war is bad. Slash at sea or sexual, it is bad. That's why sometimes the system administrators the way they designed the operating system is the slice. Each petitions differently so this way, if there is a problem with war, it only stays with war. It doesn't impact the whole slash file system. So that is one of the main reason people pick the petitioning off your desk instead of just picking one big large petition, which is slash now, how do we check the file system while the first command that you need to run is D F command ? We already talked about a D of command tells you what type of all system you have and where that fire system as being petitioned and where is it mounted? Also, you could run the command F disk with minus l option to see all the disks that you have in your, um, in your system and also each petition off that desk. If your system is running on L V M. That you could run many l iam commands like LV display PV displays. Ah, the LV block. So there are many commands that you could run to see your file system. Now let's get into trouble. Shoot. Except so you know your system is running slow or you have identified that you have ah file system corruption in one of your petitions. So what do you do? You first check the war log messages to confirm that it is actually the vile system. And you will see a lot of error messages that will come up in your war log messages that will say that bad block on this sector on this disk and you need to fix it or you need to run f A c k. You will see that in your war log. Massie's the war log messages or any type of log like Warlock sis log are very, very important in a system structure to identify where the problem is. Then at once you know that you do have a file system problem or a corruption, and you identified which partition that file system is corrupted. Then you run the command F S C cake. This is the command F SCK, which stands for file system check. Uh, this command has been used with many different Lennox as well as Solaris or UNIX flavours as well. It's still there. It works perfectly. Um, there are some off the, um some of the new commands that are in there for different file system, maybe X fs fall system were on X fs to repair, which we'll talk about in a little bit. So anyway, we run the F ck on block device, which is Dev s d a. He will not run on the mound point meaning these are the mom point, which is slash wory cannot run f ck on slash war. You have to run on the actual mount where it's coming from the source That would be the block device. Then make sure we are unm ound ting the file system before you're running a physical because if you run fck on amounted file system or mounted petition that is already mounted on war at sea, it will give you an herb message and I will say you cannot mounted because that fall system is busy. That is why one of the things a lot of people get into trouble saying when they are trying to do the corruption of clean up off the corrupted file system and they run fck and it doesn't run and then there, sitting in trying to find out why it is not running, read the error message, what it say's and it will tell you why it's not running because it cannot run that command on the mounted file system. So let's get into our Lennox machine. I have already open a terminal to my lyrics machine, and the first thing we'll see is we'll see the layout off a file system, which and for that will run the command d of my C h h is for human readable option. You could pick any option you want if you pick supposed t That will also tell you what type of file system it is. It is X fs temp file system, or E, except for system. So let's just run f d of my age and you will see there are different file systems are also there as temper fest. These are just a temporarily This is not the actual file systems you also. What you could do is you could do the F minus H and corrupt minus V to exclude TMP efforts . So now you know exactly how many petitions you have. You have to petition. One is mounted on slash, which is just slash on the root level, and the 2nd 1 is Deb SD, one of which is mounted for boat boot is usually a mapped on, um, on a regular block device. It does not get mapped on the l V M appear. You'll see. This is the L V M. Ah. It always starts a deaf member. So we identified it now in your system. Ah, if you are working in a corporate environment or any of your system, you probably going to see Mawr mounted points. You probably have slash war slash at sea sash opt slash. Um um s been or slash Ah, temp. Whatever that petition you have, it's okay. I'm not gonna go into every one of them. But I'm just saying, you probably going to see ah lot a lot more mount points on your system. If you don't, that is fine. But let's go come in here. And, um, to court this, I have actually attached, um, a disk through my water machine. And I am going to mount that desk first just to show you how we could run fck. So that desk I will do a DF minus k f despise K. Sorry f dis my cell. And here if you notice I have a new disk which I have already petitioned. Um, I just wanted to add that I have already petitioned that that new disc, if you if he noticed right here I have a disc disc s de STB, which is five gig. This is what I got it from a virtual machine and I have already petitioned that. Now I have to mount that somewhere. So I will mounted in one of the directory that I have created earlier. So that directory is in my slash directory, which is I named its spare data. So I'm gonna mount that stash MT. SD Deb s d B one to spear data. Okay, now it is mounted on when I run a DF minus age. Of course I'll grow up everything. All the temporary file system. And now you will see I have basically to file systems. One is SDA, and one is STB. They are the same process, um, exit fous. I wanted to know I have discovered that this file system or this petition point is corrupted. No, I need to fix that or clean any bad sectors that is on this partition. So I would run the command f s c k space slash spare data now the reason I'm putting that here because I want you to know that it will not work because I am trying to run FSC K on the Mount Point which does not work and will tell you it's a directory while trying to open this. It's so we don't do on the directory we do on the block device, as I mentioned before. So I will do FSC cake. Dev s d B one. Now I'm running this. It will still feel why? Because as I mentioned in my last part is his UNM Mount file system and then run a basic e on mounting mean it is already mounted on this directory. So that's why it's not gonna work. But I will go ahead and run it to see the error message. Okay, So when I ran it, it's his FSC K from utility Lennix So and so and diversion and the date and it's his Dev as D B one is mounted e to FSC cake had not continue. So a boarding basically this e to f ck is in your command. But for FSC K, I'm sure FSC K probably have a link to this. There's a new command that you could run anyway. Ah, we could talk about new commands later, but right now our focus is to find out why we cannot run FSC K on deaf STB one. And we know we cannot because it is mounted. So what do we have to do? I have to ungrounded you. Mount the command toe amount is you mount slash spear data. That's the petition. Or doesn't Mom Point? I have. So I run that command and now it is unfounded. Absolute defies age again and you'll see it is not there now. I could run fsc k STB one by heading up arrow keys which will repeat all the commands that for ran earlier. I hit Enter as soon as I hit. Enter is his FSC K from utility So and so and version, date and say's Deb STB want clean and it has some its calculations and the files is telling you many files. It has how many blocks it has, since this is only five gig and it went pretty fast and there is no files or data on that spare disk right now. That is why it went pretty fast and you see, you got the result right away. If you have that lets 100 gig off disk and has us so much data on it, then it could take a long time to run. It will go into it and all. Check everything that it has to check on for the bad blocks and it will fix it. So it's also possible while it is fixing it, it will ask you. Hey, I found ah, the fix for this. Do you want me to fix that? The bad, bad block. And you will have to enter. Why? To say yes. Go ahead. So one thing is, you could keep saying why? Why? And keep entering in on the prompt. Or you could just simply say f ck minus y. It means whatever that you're gonna ask me. My answer is yes. So then you hit. Enter and I will go through all the pile system again and it will clean up now. Next thing I wanted to talk about, which is ah, one of the biggest thing. A lot of people experiences, they say, Okay, my file system is corrupted, but it is route file system now. How do I clean that when it is mounted. If I announced it, it's not gonna let me mount because that's where I'm running my entire Obering system. So how can I do that? Well, that's a very good question. If that is coming in your mind many times we have that X issues we cannot clean up. So the Onley way we could do that is we have to boot our machine through the CD. Wrong. We have to mount our center. Wes or Red had CD to our Lennox machine right here, and we have to boot from that seedy romp. And then once it boots, it will give us the rescue option, will pick the rescue option, and then we can fix this issue if there are any bad sectors on the route or any petition that cannot be mounted while the operating system is running. Now, how can I do that? So for that you cannot use a party session for that. You have to actually little council into the machine because you will be rebooting the machine and you will be bringing down all the never connections in all the multi user environment. So I will go into my Lennox machine through Consul. Okay, I am logged into Cancel Now I have to attach the device. Sorry, the I saw image off my center s. So go to device optical drives and choose disk image. Once I go in here, it will tell me where the file is. Also a desktop. It is on my desktop, and the file is center was click open. If you want to confirm it has attached, you could go back to devices, optical drives and you see the check mark is right here, so it means it is mounted. So now all I have to do is do a reboot and hit enter when it reboots that you see the in the back. I have, um, party session, and it says it lost the server unexpectedly. That's fine. Now I am at the section where it says installed center was seven. You probably have seen that if you have recently, um, done the installation, so it saw Santo s perfect. You don't want to do that, because this is if you are doing the install from scratch test in this media and install cento us, it's the same thing. But it will test it again. Our option is troubleshooting. I'll go in and hit. Enter in troubleshooting. Now the next option is installed. Sent to us in basic graphical mode. Again, you're not installing. We're doing rescues. Come down to the selection to the option with his rescue. A center where? System? If you're using redhead, it would say it rescue a red hat system. So hit. Enter. Now it's basically starting up the the operating system, not actual operating system but the system that is actually on the disk that is used to go through the installer. See, it's a starting installer. What? Well, in fact, is not doing the installer, so don't be alarmed by that Now, here we are, in the rescue mode. Read. Read it very carefully, says the environment. The rescue environment will now attempt to find your linens installation and mounted under the directory slash mounts Lassus image. You can then make any changes required to your system. Choose one to proceed with this step. You can choose to mount your file system, read on Lee instead of read, write by choosing to if for some reason, this process does not work true, street to skip directly to a show. So if I mounted, if I picked one than it will mount my file system, which is route two slash Manti sis image. So suddenly I lost the screen anyway, so I don't want to mount that. If I mounted, then I cannot run fck, which I will be in the same situation. I don't want to mount it as read only, so I will just skip straight to the shell. So I will pick option three and hit Enter now I have the shell, so I run DF minus H command and you will see none off the file system will show up here that actually the petitions that you have been the actual operating system runs. So it's this the one that you see right now it is active coming straight from the CD. So you know that already your file system that you need to clean actually lives on Deb s d A. So you will run now you're on F S C k minus. Wipe. You want to Dev s a. D A one? Because you have to specify the entire petition for every petition. Do what you have on the disc how you had entered and it says FSC K from utility two D to three d two has been fs Ikea xfx file system. It means I cannot run FSC k for the petition for that is on that lives on or that has assignment off XFL file system. So I have to run the command f s c k dot Except for us Now run Dev s d A one now if you wish to check the consistency off except foster somewhere repair damage fall system. See this Now it's saying, now go to this command. This is the one I was talking about. You would have to run this command instead of FSC cape. So now you run a dev s t a one hit enter and it's going through all the phases Phase one through six and it's actually resetting the content resetting, checking the blocks and it's verifying it Say's verified and correct link counts and at the end, done So basically it went through the whole lot. If you had a big disk space, a lot of data on it, then it will take a lot long time as it mentioned. So now, since it's mounted, it's it's cleaned. Your corruption is cleared on your foster them. Now you could simply do ah, reboot. But before you do the reboot just unm mount the U opticals drives. It won't start off the ISA image force on Mount and hit reboot. It will revival reboot, and it will come back as clean disk and no corruption. You will also check in the marlak messages anyway. So this is about this lecture file system corruption. Then you have to follow these steps one by one. Again. If you have any questions, please send me a message and I'll be happy to answer anything that you have in mind.
207. IP Address Assigned but not Reachable: i p address assigned but not reachable. Okay, so I'm sure some of you probably have experienced the issue where you do see the i P address. But you cannot connect to that machine through ssh or from another machine, of course, using as a sage. So that's where we are going to focus on this lecture is about troubleshooting issues that focuses on how and what could be the reason that machine has an I P address. But we still cannot connect or still cannot go outside off that machine to other machines. So the troubleshooting steps the vehicle goal were, is the 1st 1 Israel check. If you are on the correct and network by running F convict, What does it mean if you have multiple interfaces? So let's say if your machine has three interfaces and set a one, then you need to make sure you are picking the right interface where you have assigned the I P address because the network team now I'm talking about ah like commercialization team or the network team. What they do is they. If there are, like cables connected in the back off a computer, then they will give an i p address to one cable and not the other two. So make sure that cable that is connected to the correct interface is the interface is actually being configured for that I p address. So we'll take a look at that in a little bit when we log in tow Olynyk machine. Also check to see if you got the right subject mask and gateway. You also you always get the submit information and gave information from your network engineer. So make sure when you're talking to your network engineer, make sure they have given you the correct sub net and cook gateway. That might be a typo. That might be, um ah, fat finger when they essentially an email instead, off like one I, too. Once you wonder what one gay way they probably given it to. And then you are just trying and figuring off so hard, but it's just not working. Then ping the gateway. If you are on the right gay way than simply paying. That gave it just to make sure if you could reach that gateway. If you cannot reach, they gave with. And of course, there's something wrong with the gateway or something wrong with their routing, which will take a look in a in a bit. Check if the gave it is assigned. So if your configuration is correct, then the gateway will be assigned itself. But if it is incorrect than most likely, you will have a problem where the gateway will not show up. So a gateway is like a gate with actually transport all your traffic from your machine to another machine. So if the gateway is not set in the routing table, then you're gonna have a problem. Check with the network team. If the correct villain is a sign on the switch side, what does it mean? It means that every network I P addresses are different, right? So the I P address that that is given to you is actually assigned to the correct I P range , which is referred to as V Land on the switching side. If that is assigned to the correctly, let if you have given an I P address for example, one night to 1 68 1 dot well and that in the back on the switch side, it is configured for I p address $10.1. $72.16 dollars one. Then, no matter how many times you try, it will not work. Your computer will be OK. You're setting on. Your computer will be OK, but the network switch side is not OK. So make sure when you talk to your note working folks tell them that you are using this I p address. Please make sure it is actually associate it to the correct villain on the switch side. Run tools like Keith Tool or me tool to check the next status. So of course, if you are not at the data center, you cannot really physically um, verify if the cable is connected, right, you cannot see the blinking light on the port. So there are tools that could tell you if the link status is up or down and those tools are eats tool and M. I'm I tool, we'll check in in a in a little bit. Also run the command if up space, the interface command to bring up the neck port. Or you could just do if down and then if up just to reset the interface, Maybe it was not set up correctly, and you probably have to restart. Restart network system. Of course. Which you'll do everything for you. Um, if you things are not working, something is wrong. If you doing system CTL, restart network and there is something wrong with the New York setting, it will tell you where exactly the problem is. Check on the status off neck by running if config or i p address command. Ah, we know that we ran that command many times, but on the neck itself, you probably see the I p address. You probably see it is a sign and Nick is up. But the actual interface and neck is probably not showing up as U P meaning up. So we have you'll check that in a little bit. Also check to see if the I P is assigned to some other device. Okay, Yeah, that happens to me too. In the past, if you are trying to assign an I p especially static I p to your machine and everything looks good but still having a problem, Then there could be a possibility that the I p that is given to you has already been assigned to another machine. People make mistakes. That's flying. Maybe they engineered. The number congenial has given you that I p which is a duplicate I p and you is gonna cause I p conflict. So what will happen is you will try to bring your i p address up and it will come up, but it won't won't work because it's already up by an other computer. Your i p address. Will Onley work when you and the other computer shuts tell? So again, make sure there's no high P conflict. And sometimes there are firewalls rules in place at the operating system level or at the networks. Which level which will prevent you to paying or ssh from one machine to another to make sure your firewall is turned off at the lowest level, as well as the firewall configuration is done right at the networking level. So again, bring it up with the no contain. Ask them if there are any issues with the firewall that has been sitting in the middle off one computer. But you're working to another computer where you're trying to reach to, so there are a few troubleshooting steps. Let's go into our length machine, and we will actually, um, go through all these items. Okay, this is my legs machine. I have it up and running, and I am logged in as root. So now that C first check if you are on the correct network interface. So if I do if conveyed or if I do i p space a our address. You'll see all the interfaces that you have available. Right now. You see, you have e n p zero s three l o which is a loop back. This is some to you don't have to worry about you. Ignore it. And the same way you have the word about the virtual bridge adapter. If you had e and P's OS three hair and you had another 10 and E and P, sir as four as 53 of them, then you are trying to probably assign this I p one i to 1 61 36 37 Whatever the I p is given to you, you probably assigning to s three. Well, in fact, it should go to E N p. 00 s four. If that's the case, make sure you are assigning it to the correct one. How do you know? You know you're assigning it to the correct one. Well, the tools that you could use to check the status if the link status it up or not is by running the E t h Tool or M M I tool. So if I have to interfaces, I could do eat Tool E and P zero is three. When I hit Enter, you'll see right here tells me the speed off this, um, into face. And somewhere here it will tell you something about like, um, yes, already bottom. You see, it's his Lincoln detected. It says yes. It means the cable in the back is connected. Of course, we are using virtualization, um, letting machine, but it will still read it as if the cable is connected. So you see right here says Linked. Addicted? Yes, perfect. If you had E and P's or as four Crest five and you had link detected coming up as no, then you know right away. Okay. This I p address is not ah, set up for that interface. You'll assign it to the correct one. Now, the question is what if you have three interfaces and all of them show up as linked Detective Yes. Then basically, you have to go through the round robin thing. You have to assign the I P to the first interface than the second and in the third, and then see if it works or not. Otherwise, if you want to find out the easier way, you have to talk to your networking guy to find out which cable a rich port has, which v land. I'm sure every company would have a Pacific way off doing things. Um, sometimes companies that I worked is very good in the documentation they actually have. Spreadsheet words will tell which port on the switch on the networks, which goes toe which port on the server. Because a server could have multiple ports, it will tell you exactly where it is going. Also, if you're networking team is not the ones that doing all this work off running cables, then you probably be a have an installed team or data center team that will perform all these task for you. They are the one who will have that spreadsheet or the information that would tell you exactly which cable is going toe, which port and which poured or which cable has which of the land aside to check with them? Um, Then check to see if you got the right subject mask or gateway. So even you do if config your snow tous that your sub net mass for this interface, That mask is 2552552550 k You're looking at it and you let you like. Okay, I have the gate near the sometime. Ask then why I cannot connect to this I p address. Or why cannot I go from this machine to another machine? Probably your subject mass that is given to you is incorrect. Maybe it's 255255254 or to 53 depending on how your network is configured. So again, confirm with your networking team that you got the correct sub damask. Now, please remember this whole scenario I'm talking about the static I p assignment. If you are on the d a c p I p assignment which is not static, then the your computer, your operating system will pick up the correct net must not mask itself. You don't have to worry about it. Also, it will pick up the gateway itself. But in the static world, you do have to specify the mask and the gateway that, as I said, make sure you are given the correct name it Net Mask and Craig eight with the How do you check the Gateway, the command that I use to check the gate with his net two stat space hyphen R and D. This will tell me right here the first line. First of falls, right appear, it's telling you. Theater the labels of the columns. Then right here, the first column selling you all the traffic, which is coming from whichever the I p in this machine, which is that's what's given Zeros are 000 All that traffic should go to the Gateway 1 90 to 1 61.1 And that gateway is telling it, and all that traffic should be routed through the interface E and P zero history. That's how you see it. And then you'll see right here all the traffic. A one i 216 year 11.0 should go to this gateway, which is eventually were routed to this gateway, and then it should have a sub net mask off. 255255255 The last one you could ignore because I said said, this is for the bridge or Stourbridge adapter. You could even disable that adapter if you want. But anyway, let's not get into this one. I don't want to confuse you. All right? So make sure than the sub damask and gateways correct. Then next thing is, if you think it is correct and it's given you by the network folks, the right gave it and Pinkett so paying one night to 1 $68.1.1. If you are getting a response back, which is, say, 64 bites and you are getting the ICMP response back, it means the gateway is listening and it is responding. And it is up this gateway in the real corporate world. This is the I. P assigned. Most likely assigned it to the networking switch where all the computers are connected. So you picked it works. Check if the game is assigned. Ah, just co word that by running the command nets that minus rnb, if you do not see that gateway that is given to you assigned here then you probably have incorrect configuration in your configuration files on various the configuration file. It's an Etsy, says convict network scripts. And if you do If C f g e N P s three, you'll see this is the static configuration files setting. And this will tell you right here, huh? The configuration. It should be set up. And if it's ah, it should have a gateway in here as well. Right now, you don't see it because the type is set up for DCP. That is why you don't see it. If you want to have a static, you will have to add it that get what in there next one is. Check with the network team. If the correct villain is assigned on the switch, there isn't any commands that you would have to run for that you will basically have to pick up a phone or send an email to your network engineer and ask them that you are on the correct of the land. Then, um, check their tools. Each tool or Emma, my tool. I already covered that, but just go were quickly run each tool e and P zero as three on your interface to check the status of your interface. If you want to know the speed off that port, if you want to know whether it's full duplex have to flex the length status. You will run that command. The other command is m I I dash tool E N P zero as three, and you will see E and P did a type it correctly e n p o no interfaces correct E and P zeros three. Now you'll see here it says known order Negotiation 1000 which is one gig offs, interface flow control and link is okay. This is the same link, OK, as if you see here is link detected? Yes. And the last one. If you are still trying everything, you could always try to reboot your machine. Or you could just simply do system CTL, our system control restart network, and this will again go back to your configuration files. Find out if there are any issues. If they are, it will notify you. Check on the status of the neck by running. If convict command, we have covered that also we could check if it's up and down. But looking at one Pacific thing that I was going to show you is Ah, right here It says E and P's or S three and you see right here says up. If it is not up sometimes what happened is you probably do see that I p a sign and everything is ah working and some Damascus Correct. But you don't see this little thing say's upright here. So in order for two for you to bring this up, then you could run the command. If config e and ps three the NP zero as three up and then when you've done if config again , then you will see. Actually, this will come up as up and it will Also second thing you have to check is it's running right here. It's running as if you see here it says up broadcast. But there it is not running to make sure it is running, and then check to see if the I P is assigned to some other devices. And the only way you could do that is if you go to another machine and paying that I p address that you're trying to assign, see if it exists. But if it is pain, Kable than try to log into it and see if you're getting landing into the right machine or not. And the last one I said, Turn off the fire world. This is one of the things that you could rule out by doing system. See, Thiel, stop in the newer version is firewall D in the older words in its services service I P table stop. And it is telling you, since this is a newer version of offering system is saying I'm redirecting you to system See Thiel. And in there you should use this Stop I p table service. So if I use that, I'm sure it is still exists. But it is deprecate ID not loaded, meaning it is there, but it is not loaded. Failed to stop because it's not up and running. Why? Because we have actually started running firewall D. Now it's a newer version. There runs on in your, um, sent to us or red hat operating system. So these are the pretty much the steps that you need to take in the corporate environment, and I am very, very sure very hopeful. If you go through all these steps off troubleshooting the I p address. Then it is actually shows up that it is up and running. But somehow you cannot reach it. That's what probably one of the reason. I'm sure you when you go through it, you'll find it right there. Yes, that was one of the reasons. And again, if you're still having an issue, I'm always here to help. I'm always here to add more content to newer things that come in.
208. System is Running Slow: system is running slow. Okay, this is a lecture where I'm going to cover a lot of commands to sit tight and make sure you're ready to go or all the commands, because many, many, many times you have this issue. When people's a system is running slow and you are, you are being reported this problem by someone else, either in your group or somewhere else. Or actually you find out your own system is running slow. And what are the things that you have to do well, first off all, you need to understand the problem as I discussed that earlier as well, understanding the problem. Where exactly is it coming from? This is the more important thing before you actually start troubleshooting any issue, so you need to find out whether it's it's processes related. Your process is the one that's running slow or what exactly the problem is with the desk is that the disk is causing the issue. Maybe you have external disk where ah, your system is writing or you even have your internal disk that probably one of the discus has issues or bad blocks or D created. You need to find that out. After that, you have to look into the networking to like file transfer. Like if someone is transferring files from your system, toe another system or anywhere within the network, you have to find out whether that transfer is causing by processing desk issue or networking itself or memory that is actually in use. So memory will be the poor off the processing as well. Then at the end, we had no whether it is hardware related. So these are a few things you have to keep in mind by there's processing or memory desk issues, networking issue or horror issue. So we have different tools for every one of them, while when we are troubleshooting the system slowness issues. So we'll talk about the troubleshooting steps. Now the trouble should accept. The first thing is, always check if the right system is reported or you are on the right system. Yes, um, when someone reports there's a problem with System ABC and that, in fact it's not ABC, it's it's X y Z. So you need to find out what system they are reporting. The problem on whether it's a database, sir, where it's a system server, our Web server. Once you find that out, when you log into that system, of course, always do host Name to check. You are on the right system before you start troubleshooting. It's are digging into it because I don't want you to spend like hours and the end finding out you are not on the right system. Then we'll check that this space, the dead space. The first thing you'll check is if the disk is full because, um, most of time and the disk is full, it will cause problem for everything that is processing memory networking or are disk related issues. Everything will be actually end up at the desk if your disk is 99% full. Your memory or processor cannot do anything at that point because they cannot write to the desk because it's full. So the commands that you'll learn is about DF and do you, which we are already covered by how quickly, quickly cover in this lecture as well, Then, about the check, the processing and memory, of course, and the commands Able cores Top free list memory will check the product. Memory in Fort that is currently in use will check the mom Virtual memory status P map, which will tell me which process individual process is using. How much memory, not just entire system D M I. D. Code, which will tell me some information about the hardware. What happened Hard. Where I have installed in my or added to my system this CPU house. What's the process is listed? How much is used, how much it is used by other processing. Also, the proxy beauty in for you could use the same thing that will give you the same up as lists CPU, a little color about the check and disk issues. And the main command that I always use is I. O stat, and I have every five second interval and Terrible's a wild your troubleshooting issue. You grew on the of stand and check the disc status. Meaning what is going out? What is coming in to your system and what's the status on that traffic going in and out? Then we'll also cover the L S O f. It stands for list open files, any files that you are trying at any files that that are up and open at this point that is taking up the memory or C P. What are those falls that are open? We'll find those out That l s o f Our command is also used Sometimes when you're trying to , ah, unm mount ah, file system and you can not because telling is busy, but you don't know how it is busy. Maybe there's a script in it. Maybe there's a file in it in the mounted file system that is used by another process or another user. So you will use el eso have to find that out, and you could kill that process, Then comes to the Czech networking port. So the networking commands that we will be using is the main one. Is that TCP dump with minus I optional use on the interface I sent for interface. Also at the same time, we'll use less oh f to see what is listening What? The port is open and will also grew up for the listen what the files are open. What protocol? What sockets are open and what is it listening to? We'll use nets stad minds pl n t. And by the way, nets Dad has been replaced in the newer version off Lenox system in Santo s and Red Hat is a place with S s as in socket. And same options can be used that for use in nets that then there's another command if top , which is a very useful when you are troubleshooting Network related issue. If top does not come a pre installed with your operating system, you would have to actually install a couple off packages like Yum Install Apple release and then you'll insult yum install if top, then this command will be available to you. It's like a an add on command, but it is very useful that will tell you exactly how what is going coming in, what is going out? What is being exported? Trash word. What is a trash for rate? If it's high to low, there will also check the system up time because the system is running slow. Most sometimes what happens? System crashed, and it just you don't know if it's crashed or not, so you should check whether the system just been update. Ah, booted up or not, So update will give you the time when it's has been up and running, and it also give you the system load every 5 10 and 15 minutes. That is pretty much the same way the load that you see on the top command. We've also checked the logs. Log is one of the main, um, a resource that you have that where you could actually go and and check if there is something wrong with your operating system. Kernel memory, CPU hardware any type of errors that are reported will be reported in your logs. Then there are other, um, things that you could check on the hardware side that are available to your operating system. And if you cannot get to the hardware issue, you need to actually go into the system consul to actually find that information out. Then there are other tools that you could install again. These tools are not added when you install the operating system. You would have to install these using your junk command. And some of these tools are H top io top PF traffic um, PS account. It's related to the user account status, So these are the few commands. If you want to use it, keep them hand to keep them. Keep them in your mind. So these are the few commands that you need to know for being a good system administrator, how you will use them, how you will run them in the system and then you get the output. How are you going to read them? So let's log into my Lennox machine and I will show you each one of thes commands one by one, and hopefully will co are pretty much all of them. So, as I said, first check you are on the right system or their system that is reported to you is the right system. So for that, you always run the host name, which will tell you Oh yes, this is the right host name. Because many times and bigger organization you have servers 10 20 servers using the same host name. But they have 010 to our or incremental numbers at the end. So just make sure you have you are logged into the right system. Then check the disc space. That's that's the first thing you should always do. And to run that you do DF minus h. Sorry. The F minus H h for human readable. So this is going to tell you the file system on the left side the size, what is used, What is available in percentage and what is it mounted on? Um, all the temp fs can be ignored because these are the memory files system. You could run DF minus age and you could group minus we to exclude temp fs to exactly see the status. So if you look at my system status, I have a pretty healthy system in terms of display. Um, the route is at 59%. Ah, as the one is at one and the boot is 17. Since the system at the disco level, these usage of the disco looks okay. If you see anything here, this is 99% or 100% or any threshold that you think has exceeded the the normal threshold. Then you have to check where, why it is using that much. And for that, you will have to use the command d'you When you do d u minus a to all and specify which file system that you're trying to look for. You'll see all the file system that's come, that all the files in the system that will show up here and it will tell you every file and it's size you could do. Um, the minus h for human readable as well. And it will tell you in kilobyte megabyte or gigabyte as well. If you want to sort this out, you could do sort in the reverse order. So you'll see that the highest usage off file and the top you will do this and it will sort everything for you. But of course, it's gonna go so fast, so you will have to actually mawr it so pipe it to more. So it is actually going to the Prock, which is just a memory wants and no such file. While you're running it, don't worry about it. You could ignore any of that that comes up and says cannot access. But if you are getting an error message that saying, Hey, um, permission denied that it means definitely means that you are not route, so make sure you are route before you run the d. U minus, um, a command or H command on any file system, so it could go into every file without getting their permission denied error That's clear. This green, then the next step is about check processing so the meat make this window a little smaller so we could go or the commands one by one. The 1st 1 we have top, which we have already covered previously as well. I'm just gonna go or quickly again. The first line tells you about the system up time. How many users are logged in and the load average in every 5 10 and 15 minutes. This one tell you total task that are running Hominy sleeping. This line tells you about the CPU status. This line tells you about the memory status. This line tells you about the swap status, then coming down. This is the list off every process that you are running in your system, mostly the high utilized process you'll see at the top. The first column is the process i d. Who is using it? Um, the virtualization resident a reservation shared CPU, memory time command and has, ah, a lot of information as well. Then we'll go into the next command, which is free. Free is specifically for memory utilization. You could also do free minus M for if you want to see and megabytes. So this will tell you how much member you have total. How much use, how much free shared, how much of that buffalo and a homage is available to be used by the other process. Other, um processes. Yes, other scripts or other programs. Okay, now, next one, we have list memory ls meme. This is tell you exactly about the memory block size, total online memory that we have available to the system. It is one gig total offline memory that is sitting that you're not using, which is zero. We don't have any said. This is going to tell you about your memory as well. Same thing pretty much when you do product memory in full cat. Sorry, Prock Member in full. This is going to tell you exactly what is going on in the system right now. Total memory free memory memory available. It has a bunch of information about your memory and each and how memory is allocated to every process. Every pages in your system. So you have to read through it every one of them. If you do not. If you really want to know exactly what each of them means. If I start explaining them is gonna take me forever. So I would recommend you. You could just go to Google and type of product memory info. And it will give you a lot of information about meme in full, then VM stat, which is a virtual memory status. This is telling you about your swap. Space swap is pretty much as the same as a virtual memory. How much it has been assigned? Well, how much is it free? How much is it? Buffer. This will also tell you if you have memory. So if you are running free minus m and you see, the total is 9 91 and used is 9 91 Nothing is used then the next thing you have to find out is whether you have the same issue. Would you show up or virtual machine? Sorry. Virtual memory as well, by the way, free can also give you both as well. Um, the regular memory and swab memory as well. So check the memory status. Make sure the memory is not used. If it is used, then you actually have to assign mawr memory to this machine. Um, because it is using up a lot of processes if you run top again and If you see a lot of processes here and that are using this column right here, this column is used up a lot of memory, but a lot of different processes. Then you actually have to add more memory. Or you could also use the new command. And I'm gonna show you which is P map to right here. It's you notice the top command has a process i d. 6610 So if I do open up another session and I type p map and put in the process, I d that it is telling me this is a total process that is being used by the top command, the top process that I'm running. So just that that Pacific information about the P map, you can also find out about the other process. If you want to know, like, let's say process I d one. This one had to give you the process information. Sorry. The memory information off one particular process. Instead of going around and finding out every process, you could check it over here. Okay, So next one is d M I D code d m I D. Code. This is going to give you a lot of information about your hardware. What is inside of your computer? So when you run this and if you notice you have an issue with CP or Memory and you have to actually, um, call the Wender and the Winder ask you some information about give me the information about the CPU serial number, our memories, your number, what's the size, or what Serra lease or what's aversion information. You will find all the information right here. As you could see, the manufacturer information the product name the chassis Information says manufacturer is Oracle Corporation. So you know who call when you are trying to open up a case and with who. So if you do not know which server that you are on, this is the D. M. I. D. Code will tell you whether it's HP Oracle Machine Spark machine. Sorry, not sparks. They have different ones. Um, like any other hardware like tell or any of the hard word that run, um, 64 bit operating systems. Okay, then. L s CPU, which is kind of similar to ls meme It give you the information about your CPU architecture . CPU architecture is X 86 64 bed. It actually supports 32 bit and 64. But models the bite size CPU is one and a socket. Any core per socket? Um, the Wender CPU family model, model name Intel, CPU, megahertz. Everything that you need to know about CPU can also be fine in L s CPU. Okay, next one ISS proxy BUE, which is again a similar to less list CPU approx, CPU info, if you notice pretty much the same as the other one. But probably it is rearranged, but it gives you similar information to what you would get with L s CPU. Okay, let's clear the screen. So you have find out so many things about CPU. You know, your memory information, your disk information now moving on to the disc status. You know the disc When you run DF minus age, you say you see that the disk usage is good and it's actually 59%. So there isn't a disk in terms off this capacity issue, but maybe the disc input output disk itself is running in a degraded mode. So for that to find out, you have to run i o stat. Meaning input up statistics minus wiviott five. I always use that because I, um I kind of used to it. And I will say that this way there are many other options that you could use with Iot stat as well. Um, I would say there are many, many options with every command that I'm showing you. So the best way is that you run a man on every command and find out every options that is available to you. Anyway, let's run. I start minds. Why? With every five second now, this is actually going to the desk, and it's gonna ask this. Give me your statistics every five minutes. Sorry. Every five seconds. And here it's telling you, your disks. You have to disk esti a STB, and it's read kilobyte read kilobyte written how much it is reading, how much it is writing it. So by looking at my system, my system is running very, very efficient because it's pretty much 0.0. Nothing is I don't run any like production type of application of my system. So that's why you see that everything is zero. But if you are running, you will see how it is going through. How much is, um que be reading how much it is writing. How much is transferring per second? All that information was show up here. If you see the number of very high, it means either you are, of course, writing so much or reading so much or it's just your discus. Simply having some issues reading or writing or active queuing up the entire transactions. So this is about Io stat. Now let's get into networking port now. You notice Ah, you confirmed. Nothing is wrong with it. Disk. Everything looks good at the processor. Everything looks good on the memory side. Now let's look at the networking if you are. Actually, if you're programs are actually involved into transferring our actually receiving, you would have to check the networking. So first Commander TV will run Is TCP dump? It's, um TCP. Every portal call that goes in and out is mostly on TCP. So with minus I option, it's interface. First, you need to find out what interferes you're gonna run TCP dump on. So for that you have to run if config and you notice my interfaces e and P zero s three. So I'm gonna run on my TCP dump minus I e and P s 03 And when I run that e and p off wrong into face spelled wrong. Okay, Now you see, it is going so fast because I am in my PC where I'm running my machine over. I am actually showing you this whole lecture. It is communicating to this washing machine. That is why it's going back and forth, back and forth, back and forth If I just close this or control Siart if it and are and open up another window whether you have to be route to run most of these commands, so always log in route. Now if I try to do Ping, let's see google dup dup dup dot google dot com It is pinging, but now, as is pinging, I could actually check this traffic on my TCP dump. So let's just grab for let's say, Google so as it going down, Um, no, actually, it is actually not going to Google. It's actually going to the I P address. So TCB dump actually does not is not gonna give you Google. It's actually gonna give you the i P address. So let me grab for 1 62 to $43. $10.1. 51. And there you go. See? It's telling me my machine, which name is my first links VM is going. It's to the Google with the protocol icmp Any time you paying a machine, that pearl call is known as ICMP. And so this machine, my machine is using icy and people will call and pinging this machine, which is Google. The Pearl call is listed at your requests and again this machine, which is Google coming back to my machine and acknowledging the traffic, is getting reply. So I am Look at this very carefully. This in my machine, going to Google with this protocol and requesting to send the sequence the length of 64 bit 64 bites right here. Sequence time, I CMP that's what it's telling you. So then once when it goes there, the Google is coming back to me and say, Hey, I got it. You're the one who was pinging me and I'm replying back to you and telling you Yes, I am alive. I'm available. So it's just a simple way off doing TCB dump. If you are trying to troubleshoot an issue where your machine is talking to a database server. Then I would say, put that database over I p address or use the portal call in the TCP dump. There are different options to use a protocol specifically for that. Sorry, um, for the port. Sorry. Not the protocol I meant to say the port, if you are going to, let's say one night to 1 61 about 13. And that is your database server. And that is using a protocol. Let's say 20 for nine. Um, no, Sorry. The database protocol is sorry. The port number that is used on database is anywhere forgot. But I hope you understand what I'm trying to say. So you could actually specify that port number to listen whether this is listening on that port number or not. So TCP dump is a very long, um, kind off discussion that I could go into, but I want you to try it on. And this will give you a lot of information when you troubleshooting traffic issues. Next one is L S O F list open files with minus I minus p and minus end. this will give you what is open. What is listening? So let's say if my machine, this is the one is actually running. Um, a service. Let's say, um ssh and I cannot connect from this machine to this machine using Ssh. Then I will come into this machine. I'll run that command and I will grab for 22. And as you could see right here, this will list all established connection and also listening Connection right here to say is s s age is listening on poor 22. So I'll I could tell. Hey, my machine is listening. I have no problem. Is something is your machine that's not listening. Or maybe you haven't listening. Maybe my machine is listening and probably I have a fire wall that is blocking any traffic coming from this machine to my machine. So I have to check firewall as well. Okay, then. The next one I have is that's that that p l nt this is pretty much gave me the same information that I just type in a different way. So this is another command. Another thing that I was gonna talk to you about his net stat is now deprecate id and the new command that is uses S s, which stands for socket because use the same, um, options to list all your ports that are open or listening. You can also do man on SS and you'll find another utility to investigate sockets that are open sock. It is something that runs on your computer, which actually attaches the port number and opens up every time a traffic comes in on that port or anything that comes in and trying to knock on the door, that has 20 to label on it. The last one is about check networking, and I have this command if top And as I said earlier, if top is actually that does not come with your Lennox offering system. You have to install that and to install that, you have to run the command. Yum. Install apple release and then Yemen sold if top. I have already installed us this command in my system, so I'll run it if top and you will see right here. This is telling me about the trash for that is going from to this machine and from this machine to any other place. So if I'm using FTP to trash for some files from one machine to another or I'm using protocols like NFS or Ah, SC people called every time you use them every time you run those commands. And if you wanted to know how how much bandwidth is used and how much, um, mag abide or kilobyte per second is being trash forward. This command is amazing. It will give you all that information from to the rate and kilobyte. How much is has trash word How much is remaining and whole bunch of information. If you want to learn more about it, I think it when you install it. It actually also installed a man pages, I believe Yes, it did. And it says display bandwidth usage on an interface by host. So use that command if you do not have it higher the highly recommend you toe install it with the instruction I have given you. Next one is check system up time. See if your system has been rebooted recently. The time is there with the system load average moving on the check the logs, All the logs are in the bar logs and when you do ls minus l lt or whichever the option you prefer. And the best log which have all the information. Or log that I always look for his messages. I could always do tail minus 100. Give me show me last 100 lines off messages and I could easily grab for error. There is no error, so I could just take out entire tail, just cat it and grab for errors. And here I will see if there are any errors have been reported that might help me find the issue. I would also say Look for always put minus side. By the way, I would also say Put warning. I will also say put ever, I will say Put fail as in failure, you'll find so many information that could help you troubleshoot issue. Check the hardware status by logging into the system council. You could do that by locking. And if it's HP goingto, I'll o open up a browser. Put in the hype. I low I p and you will see the logs in there If it's Dell put in the I drag. And if it's other system, every system does have consul axes. Find that out and log and find that harbor information or hardware message. The last one. There are other tools. There are other tools that are available to use. You have to download them as well, just like I downloaded. If top these are the tools are also helpful. Some of them, like age to io top I atop is helpful, which works the same way for disks as I have stat. Um, so Steelers some off the tools. I want you to actually go through them one by one. Read about them. They will definitely help you. If you are pursuing system administration, type of job or Lennox related job or any type of computer early job, you will be using thes type of commands quite often.
209. Running Linux on Web Browser: Hello. In this lecture, I'm going to cover about Lennox running on a Web browser. What does it really mean? It means that if you do not have enough resources on your personal computer, or if you wanted to just test or run certain commands on a lyrics machine as a practice and you don't want to run them on your own Lennox machine, then the best way to do is you could open up a browser. And there are certain websites that allows you to actually start up a Lennox instance on there on their server. But you could actually access it through. Your Web browser is just like that. I'm given this. This is Green shot off one off The Observer that allows me to run Lennox, so I do not have any preference of which one you pick. So the way I do it, I go to the if our, um, Internet Explorer or Firefox in whichever browsers you have an hour type of run Lennox in browser, then it will give you a lot of different options or will actually take you to a lot of different other websites that allows you to run Lennox on the reps on the browser. So if I were to pick the 1st 1 it takes me to a website called Geek Flare. Anyway, this website it's not something that I am promoting or I have any affiliation with. It's just that something came up on my search and it has a list off all of a browser like Ron Lennox from my browser with these six websites. So the 1st 1 is years Lenny's copied on a sage by mail tutorial, point and so on. You could pick any one you like, as long as you are able to get onto the council or terminal and drawn your commands. So if I pick the 1st 1 Gs Lennox, it actually takes me to this website, which is right now starting up my Lennox machine. So I'm gonna leave that, as is, if I go to copy shh, which is right here, which has already started the next machine for me and you notice I have logged in as root and I do ls minus ltrc their commands. I could also create files I created test file earlier, and I could do again ABC file and it runs a any created the files. So you have access to this lace machine as root. So of course, you could run many commands. And if you wanted to practice before your run of the command in production and you do not have a key way or lab environment, you could actually use these resource. Is that a free online to run and test your commands? Just like that? I have another one of which is on mass record at, um some J s UNIX. And here you notice who am I? There's no command like that by a less Marcel has it. So touch ABC do ls minus. Lt are and it stays that it has created my file again. Which ever that, you think is is the website that is actually allowing you to run a certain commands. As for practice or as well as run them before you run them in production, these other resource is that you could use All right, So if you have any questions, let me Now again, if you have a Lennox machine on your virtual box, that is the best option. You could do whatever you want, but if you don't want to use that, or if you have a limited resource is and you want to use one of these Lennox machines on the browser, then this is the way you could access it. One of my students actually recommended me that I should share this as a resource with other students. So thank you so much. Of course. And for those people who wants to learn more about it, go ahead and do a Google search and you'll find them. Tons of resource is out there. Were you girl in letting machine on or to the bribe? Fibras. All right, good luck.
210. Improve Typing Speed: Hello, everyone, that this is the lecture or a quick tip slides where I'm going to cover how you could improve your typing speed. I know you have, um, learned so much on this Lennox. Now you want to go find a job, But really, if you are not ready or do not know how to use your keyboard properly, or how to type of fast enough so you could reply, respond to emails or run the commands fast enough, then literally, it's It's not good. It's not gonna look good on your part. So as one of the things I've seen a lot of my students, which I realized later on that they do learn a lot of new things, but they forget to learn. The basic off computer is, of course, typing. And that's what before the computer was a typewriter, when people started writing letters to the typewriters. So anyway, I'm putting this this lecture together to help you or give you the resource is where you could improve your typing skills. So falling, or a few websites that allow you to practice learning or take a course and improve your typing skill Number one is you to me and as you to me as always, is one of the best of upside to learn, um, on your own pace, plus the amount the jeremy charges. It's so less as compared to the actual course you could you would pay, like, thousands of dollars. So final coupons you probably could find anywhere, like 9 $10 to, like $30 coupon, depending how, how, how the course is listed. But anyway, you Timmy, is one of the best website that you should go and look for the courses that help you improve your typing skills. Um, another website that I like. By the way, these websites after you, to me that I'm going through I have no affiliation with any of thes, nor I'm getting paid from them is just a few websites that are free that help you improve your skill. So I'm not promoting them. I'm just telling you that you can use these upsides to improve your typing skills. 2nd 1 is typing club dot com. It's interactive upsides which actually make you go through certain lectures. Sorry, certain lessons and make you type in as you go along to every lesson next one is a key. Be are, of course, BR for board. So try that one. And the last one is typing test dot com. These are the four ones I picked that I like the most. Excuse me. Um, so let's go to our 1st 1 which is are you know me. So if you go to you to me dot com and you type typing speed, you're gonna find a lot off a lot of training tools allowed to training courses that are online. Picked the ones you like. If you wanted to go to the rating, go ahead and read the ratings, See what people has to say. And then you pick the one and there are few of them that, like, literally like one hour, 1.51 point 5 44 minutes. These are the ones that you need to peg to improve your skills. All it takes one hour to find out if you can prove it or not. So definitely look into it. Second, that the website that I told you is about typing club. So if you go to this website, you're gonna go and and click on get started, okay? And then It gives you a few lessons at all. All the lessons are organized to go ahead and pick the 1st 1 And this is basically telling you hopes this is giving you all a lecture and telling you everything about what this website is about. And how is gonna help you close these, um ad. So now you're gonna come to this point Where is going to tell you new keyboard instruction type the F key using your left index. So put your fingers as it as they are shown on the keyboard. So put f f As soon as you hit, F is gonna ask you to enter the next word. J enter. Good job. See? Now, next view will practice f n j Perfect. So go ahead and click. Continue. So type F f f f j j j c. That how easy it is for you to practice. So, please, I'm not gonna go into more details. I am. I'm sure you got the idea What? I'm trying to get you This third website is keyboard, so it is blinking on the bunch off words bunch off. It's a whole big sentence, but doesn't make any sense. on the sentence, but but you have to type where your, um, cursor is blinking. So right now it's blinking on, and it's a type, and as soon as you type I, it will advance to the next one type E. It will vast to the next one, so this is going to help you learn as well. The last one is typing test. It gives you some typing practice. It also give you some test typing game zones. If you are into games and you want to learn keyboard or improve your typing skills wise, you are playing games. This is the website for you. Anyway, I gave you through four different options this for you to pick. But please do pick because you do need to improve your typing skills or make sure your fingers are on the right. Keys while you are typing are good luck.
211. What is Virtualization: Hello, My awesome students. A lot off. You have asked me to go over some of the virtual ization technology. Like how the virtual ization works. So I know a lot of you are starting Lennox for the first time, or even the I t are getting into the I t for field for the first time. And when you get into the Lennox, you probably noticed a lot of letting service actually run on the virtual technology. So what exactly is virtualization? So I'm gonna take some time off yours, and I'm gonna try to try my best to explain you what were civilization is so you would have a better understanding when someone is talking about martial ization, what is virtual? Something that is not physically existing. So you could say something If it's lit. A computer is a virtual. It means it's in reality. You cannot really physically touch it. It's a virtual that is based that computer that it based on a software related teibel computer. So what is a virtualization technology? Virtualization is the process of creating a software based or virtual representation off something such as a virtual application, server, storage and network. So again the virtual technology. Let me take a couple of steps back, and I will tell you how people came up with virtualization. So you have a physical machine, as you could see right now, two additional server architecture right here at the bottom. You have a physical machine. You go. For example, you goto, um ah, computer store. You buy your computer, then that computers, You have a pre installed operating system on it, right? Maybe if you're buying a regular Dell or HP server, you probably going to see that it has a windows installed on it. And then when you have the window installed, you actually run all the applications. So what? The applications like Firefox, Um, even a Microsoft Office word calculator and all of those are applications, right? So now So let's say if your application, the only purpose of your computer is to run that application and that applications using only two ah, gigabit off memory. So what happened? If your computer has 16 gigabyte? So, Dad, remaining 12 gigabyte is useless, right? So everybody got together and says, Hey, we gotta do something about it. We we are. We are wasting the resource is. So they came up with the idea of Hey, how about we duel? Partition the computer and we could boot one offering system at a time. Okay, Perfect idea. Everybody got together. Now, the problem with that, you could only run operating system one offering system at a time. So still not optimized way. You're you couldn't get the same results out off it as you wanted. Then they got back again, back, and they got back again together and say, What should we do to utilize that remaining are unused memory. Then came the virtual ization technology. The virtualization technology. What happens here is you have a regular physical server. Just like any other server, you install a layer of virtualization layer on top, just like in this case, you wouldn't In the other case, the older kids you would install like a regular operating system. But in this case, you would install an operating system that is ah, hyper visor. That's called a hyper visor layer On top of it. Once you have that high provides earlier on top off it. By the way, that's also saw for then a You could run a multiple operating system at the same time. So if your computer has, let's say, 16 gig off memory, then you tell me how many worker machines you could run if each Worster machine requires two Gig eight, right? But I would say not really aid. But let's say 77 because you do want to give at least two or three cakes to your own machine. The machine that is right here at the bottom, right? So that's how the virtualization technology works again. To wrap it up. I am. Please pay close attention. Worship ization is basically a machine that does not have a physical, um, hardware underneath it, actually using a software based computer processing and memory. All right, so now let's talk about the companies that are offering virtualization products. So if you wanted to get into I T and you start looking for a job, it is important for you to know what are the companies out there that are offering socialization or have their product as a virtualization product on the number one? I would say the VM where that's the one that came over the virtualization technology, primarily the beginning and a lot of market share is actually used today by a VM Ware. The next one is Microsoft. Everybody knows Microsoft. Their technology is called hyper V eyes. Ah, hyper wiser that runs and allows you to run multiple operating system. Then we have Citrix read A had also have a virtualization technology as well as Oracle, Amazon and I'm sure a lot of people know Amazon a w x cloud. You ever heard of it? So yes, they do have a virtualization technology as well and also all for a huge platform, a cloud platform. Then we also have Google, and you probably heard of Google Azure. Sorry, Asagoe, it's Microsoft is the azure, which is a cloud technology. So Google also have their virtualization technology. IBM has it and Hawaii? Hawaii. I hope I'm pronouncing it right. So that's another company that actually all first virtualization technology are moving on, some off the terms. I think you should really know because I don't want you to go out, um, on the I t field or go out for the for the interview. And some of the terms are being thrown at you, and I don't want you to look at yourself. And so what exactly does it mean? So let's take some time and let's understand some of the terms that you should really know . Regardless, if you are learning Lennox Windows or whatever operating system you're learning, this is something I t terminologies in terms of virtualization. Hyper visor. Now, any time when you run your virtual machines on top off a server, so the underlying host that is allowing you to run those words a machine that that's offer is called hyper visor. You need to remember when someone says hyper wiser, it means not the virtual machine. It's actually machine that's running under it. Or that that was the machine that supporting it. That, hyper wiser is also referred as it host. Many times is referred as a host or War chul server, so it's a interchangeably terms. If someone says, Hey, virtual server, it try to clarify, if therefore ing as a host or hyper visor host. When someone says host, I was in nine out of 10 times. People are referring to the actual hyper visor and then someone says hyper visor. Then you know it is that actually I provides moving on virtual machine any virtual machines that you run on top of the high riser is called Virtual Machine. It is also referred as guest operating system or insured. Bm um. Then, in order to manage the bunch of hyper visor together, you need a some kind of software. Ah, and that software is called over like abortion ization, manager envy and where it's called V Center. An Oracle virtualization platform is called OVI M Manager on then Virtual Desktop. You heard of that as well? If you're working for a company, you probably given ah, virtual desktop. It is basically an ah VM as well, but it is given a name as a virtual desktop is because it is used for your regular day to day work where you were given. Instead off a laptop, you're given a virtual desktop where you log in and do your regular day to day job, and it is like a your personal debt stop kind of wait. It's not a server. It's a desktop p two. We you probably gonna hear the word p TUI, which means physical tour troll. The reason we have this term of use of many times it because a lot of companies who are still running, um, on physical environment, they are moving from physical to virtual. They do want to save money. They do want to go physical. The oh, they want to go virtual. So the term they use is p two we. So it's not t Oh, it's actually number two soapy to a physical war ritual. And there are many different of software that are used to convert a physical machine to a virtual machine. Like the number has a, um a software called the American border that allows you to convert a physical machine toe works for machine. Um, by the way, before I get into snapshot out, there is also something called V two V, meaning virtual to virtual. So if you are running on VM Ware platform and you want to migrate toe Oracle platform, then you use a tool to my great virtual machine to work through machine. Um, of course, the term exist like a V virtual machine to physical machine. Um, very rarely used, meaning the actual procedures very, really, really used. I don't know why someone would want to, ah, move from virtual to physical. The only reason I could think off if someone wants to move from virtual to physical is at one point. When they moved to virtual, they weren't they weren't getting the required resource is or the application was not function properly, so they decided to move back to physical. That's when I could think that it would be ah V two p. Our next one is Snapshot. Ah, snapshot is a term like when it's It's. It's a technology that is used in virtualization platform, which allows you to take a snapshot off your virtual machine. Meaning if you if you If you click on your washing machine and click on the option take snapshot, it will actually take the exact same, um, Sichuan or the exact same state off the virtual machine. Kind of like back up. But it's not a backup. So let's say, if you if I take a snapshot off a virtual machine today or at this time and tomorrow, um, I install a softer and my software crashes my entire machine. Now I could come back and revert back to the today's a snapshot. That's the beauty off taking snapshots, and that's a beautiful technology, which I love in virtualization. The next one is clone or cloning. Ah, that's also another term that you're gonna hear a lot of times when you are in war, actual technology world. What it means is when you have a machine of virtual machine, um, and you need to have a second worker machine, which is pretty much exact same one as the other one. Then instead, off spinning up a new worker machine and installing the operating system from scratch and doing the configuration, you could actually make a copy out off the another virtual machine. And that copy actually means or actually referred or termed as clone or cloning. All right, so this is all about the virtualization that I wanted to cover their still many more things that you should know about work realization. But I hope, um, what I have covered kind of have given you enough information in terms off the how the virtualization technology works. If you still have many questions that that's perfectly fine, you are more than welcome to send me a message. And I will definitely try my best to answer as as much questions as you asked. Thank you
212. Introduction to VMWare: hello once again and welcome to my next lesson, which is really where. And I have created this lesson specifically on the upon the request off my students. Ah, lot of students asked me, Can you tell us a little bit more about what being were virtualization technology is So anyway, I'm taking some time to go over what really v and where is be and where is basically the name of the company as its it is. And it's product name is also via where so we and where INC is a public publicly traded software company, you could look it up online and you're gonna find its stock if you want to buy it. VM E provides cloud computing and virtualization software and services. We already talked about virtualization, the virtualization, the main function of the main products off of E M. Where is actually virtualization. They also have a cloud computing. If you wanted to host your applications on their cloud on their virtualization software, where everything is on their data center, then you go with the other cloud computing. So it was one off. The first commercially successful companies to work relies the X 86 architecture. That statement. It's right off the Wikipedia. You could look it up as well if you just type what is being where you're gonna find that statement in there as well. Now we and we're saw for allows users to create multiple water environment or worship computer systems on a single computer or server. So those who are familiar with the virtualization technology you guys do know that the virtualization technology is basically allow you to run multiple washing machines on a single hardware VM. Where does the same thing? It's just that the name of the company is different from other organization technology and now being were still owned 60 to 75% off the market share, meaning a lot of companies in the world they actually using almost like sex 60 to 75% of the market. Now let's look at the VM ware products and tool and see what are the terms or technologies that used to make the virtual environment off from for any company. So let's see you bring a ah hardware. You have a hardware regardless off who the manufacturer is, whether it could be HP or Dell Server. So that's actually Ah, hardware. When you get a hardware, usually it does not have any operating system on it. Now, I know when you go outside and by your person, computer or your laptop, it does come with an operating system. But in a real world, in the corporate world, bigger servers don't come with any type of software or operating system. So you have to install an operating system. So again, back in the days when there was no virtualization technologies, you would install one operating system and then be done with it. And you're stuck basically with one server if it's underutilized. Um, that's the problem. If it's over utilised, that was great. But anyway, so what was it? You have a hardware and on top off the hardware, you install some type of operating system for re in where you would install the operating system called E S X. I. Now this is ah, hyper wiser software. Maybe they don't refer it as an operating system. But I'm just telling you as an offering system, because for you to understand it easier that do do need some type of software in order to communicate with your hardware. So that s X I server. When you install it, it actually go through, ask you to go to the older visitors. And at the end of the visited, it will actually ask Give you this screen, as you could see on the right hand side as yellow screen. It will also ask you to provide the I P. Address. The user name password of Deanna's information subject came Sebnem. Ask a went all bunch of information. So you could actually one status set up you could actually access. That s X I server using something called V Sphere. That's Visa is a Klein that you need to access. That s excise server. Now, if you're using older version off SX I, which is like five or six, then you could use actually V and we're V's for decline. But if you're using the newer version, I would say about I think six starts two or $6 5 the newer version offs. Ah, the sphere. So are the newer Ginny S X I they do not work on the visa for client. Then you need to access. That s x I through the web browser. So you put in the I p address off the Essex ice over the web browser opens up, and I will show you this feast here. Then, if you wanted to add it Multiple, yes, excites over the reason you wanted to add multiple. Yes, excise server is what if one es excise over goes down and it has 10 v EMS running on it. Then you lose all those 10 v android. So that's why they come together again. And they said, You know what? We gotta fix this issue. And in order to fix this issue, we could have multiple years. Exile servers work together, as in a cluster. Now, OK, Perfect. Now which software will manage that cluster? So first they they said. Okay, let's put all those years excise over together, and we're gonna manage that through a software called of these center. The V Center is the one that will manage all three off them, and it will put them in a cluster. Aren't moving on now. Once you have that cluster wants everything set up, you would use the same. These were client because these center is a management software that uses the same visa for client to access all those servers. So when you access said, this is how it looks like you could just simply I just got this picture off the Internet. It's It's not mine or I'm not trying to steal someone's picture. It's just that I got this picture online. It was free. So I just used it for my training anyway, when you access it or your Environmental V's center using the V Sphere client, this is how it will look like on the home page. You notice this one has a V center. It will tell you everything about Davey Center that you have installed. The 2nd 1 has hosted clusters, which will tell you how many server host hyper visors we have and how many clusters we have in. And so how many closer and how Maney host we have in that cluster, then VM and templates when you click on it will give you the list of all of the ems that you're running in your environment. On the storage. The storage is something that is attached to your hyper wiser. To your host, you go do the networking. You could also divorce from networking, and there are some other tools that are available with that, and then it has monitoring. If you want to know what is going on with your environment, you could check with the monitoring and you could do also system administration task meaning Who can access a what and what kind of services. If you see on the left side there is a left side tree, which tells you that pretty much the same thing. But it's a shortcut way to access all those different menus. So this is how the V's center looks like. If you have not seen it, you can Also, I would say I recommend you could also go to the YouTube and look for, ah, some off the tutorials where they gave you a walk through off these center or V's fear. You're probably gonna find those tutorials from being where directly so that's great. They probably they have done a great job explaining it. So if you want to learn more of a definitely recommend you go there on a website and look or understand how the center or V sphere works. Good luck, and if you have any questions, let me know. Thanks