
right now so the NSA exit beam Accenture open security titanium level 7 SEC jobs Denham group although Issa and landmark solutions if you haven't already please and go thank our sponsors there in one of the conference rooms over in the University Center thank you so happy to see y'all enjoy the top so we're gonna see if my internet works and then I'll bring up the presentation okay who is new to Linux like within the last year or so alright awesome and who few people ok who's been using it more than two years ok so I don't know how much fun y'all are gonna have because I'm doing like a lot of basic stuff but really I
just did this for fun let's see what happened ok hang on I I can fix this I have the technology in my hand so I couldn't get the University Wi-Fi to work so I got my mobile hotspot here I hear like some feedback is that a problem
okay is this good okay all right so if I hear that noise I know I'm doing something wrong okay so which way okay here we go let's see let's see if internet works if Internet doesn't work I don't know I'm gonna have to just do it live which I can I got the VMS on here but I did record all the demos and I put them online all right so I'm gonna start my talk and we are going to see if we can use what I already recorded I was not smart enough to download them first totally intended to but I did not download them to my computer so you're in the one Linux thing a day and talk
and the reason that I call it this is because this is something I challenged myself to do I tried to produce one a day of a Linux thing that people can do and that hashtag is actually on Twitter I drew it well I didn't not that great at drawing but I wrote it all down and I drew something cute next to every single one of these so I only got about 16 days in and I was like I'm bored now so I turned it into a talk so here you go I work for our hurricane labs and they do vulnerability management and other neat stuff sorry if the colors look weird I don't know how to fix that and if you
know anything about Linux you know the Who am I command which tells you which user you are I purposely put Who I am because that joke like everybody uses this on their entry on there about me slide who am I so I thought I'd switch it up and do who I am and I love Linux I don't know why I put the slide in here but I did so why are we talking about Linux Oh cyber security conference well I googled it I said why Linux for cyber security and I found this article by Sandra Henry stalker and she was actually talking about a book or something that was coming out some sort of resource
she said Linux is open source tool developers and you have a level of access and it's unsurpassed Linux is transparent you can learn to manipulate it in ways that are not possible with most OSS most cyber security tools are written to run on Linux so the thing here is that Linux is customizable you you can get Kali Linux or you can get a bun too or you can roll your own Linux it's also open source you can contribute to it you can see the code you could see the bugs you can report bugs I love reporting bugs and it's awesome and a lot of cybersecurity tools run on Linux and there's an entire this stro called
Kali which is all cybersecurity tools for Linux so I got started with Linux right around the time I got into cybersecurity so I've been using it for eight years so I just the reason I enjoyed it was because I could get on the command line and tell it what to do and up until that point I didn't really like computers I didn't like using computers because you always had to figure out how to get the computer to do what you wanted and I hated that windows I was I was a Windows user I didn't know Linux existed all I knew was dos and windows and I was like man if only we still had dass where you could
just type what you wanted and in 2011 I found Linux and I was like this is exactly what I wanted and I was kind of pissed off that it existed for decades before I knew about it so before we begin if y'all want to take a picture of this and the slides are gonna be on my github website the distro is Ubuntu 1904 now I did test some of these in Red Hat and send to us there is only one of them that doesn't really work in a bun - so if you would like you can get on Twitter or Instagram and you can at me or you can at my employer and you can at the
conference those are Aldi and they look like they're all spelled correctly those are all the accounts so my company hurricane labs would love to know what you think about this talk even if you didn't like it but especially if you did like it please tell them cuz I want them to send me to more conferences so if you don't want to see me speaking at conferences then write like the worst review so so what we're gonna do we're going to do stuff with user management working with files system administration and other shenanigans so I have four different categories here and okay so there will be one specific use case for each command but something about Linux that I
also like there are multiple ways to do things and there are multiple ways you can accomplish the same goal so we're gonna start managing your users and one does not simply use technology at school as intended so schools when I go speak at schools they're like oh you do hacking you know you're you know they they're like oh my god that's so awesome you know we've never done anything like that I'm like well I heard you're not allowed to play roblox at school right you're not allowed to play it in the computer lab and they're like no and I'm like but you do get to play it right and then they start telling me oh yeah we just do
this thing and it gets around the firewall and it doesn't like they know they know how to play they know how to get what they want at school on those computers and and I I'm pretty sure the entire school staff at the last school I was with just gave up because all the students were talking openly about it and the teachers were like yeah we see them in there playing games all the time so I'm sure they tried all sorts of things and it let's see if it worked and at one point they're probably just like well we're just gonna let them play any games I mean in my opinion games are good good for kids because I mean
they're good for everyone because they teach you all sorts of stuff like problem-solving and and how to build things why is this not even clicking see I can't even use my computer okay so I don't think it's gonna connect okay so I am just going to type on this slide real quick for you if you want to take another picture where you can find I'm not going to deal with this this is just disgusting god that does that yeah that works I had to do this in my last talk - I had to add something in there
okay so ASCII ASCII and um I don't know how to say it this is a really cool tool if you're going to be recording demos what it does is from the command line you can record and then it uploads it to your profile so where is the squiggly line I forgot okay okay so that is not showing anything this is the URL if if you want to see the demos I'm gonna go ahead and we're gonna do this in live so let's see what happens here also I forgot to say if you're hard of hearing and you can't hear me and you want me to repeat something just put two fingers up like a peace sign and I'll
repeat whatever I said much louder okay so as anybody's still getting that okay cool we are gonna go on to the demos maybe this is the reason you're here alright so the first thing we're going to do we're going to do add user and delete user so we're going to say that we want to create a new user with a different home directory than the default so by default you're going to be in your own home directory called home but you can make it so that person's default home directory is something else like in this example Juliet's gonna be working on creating content so the content directory is her home directory so it could be a shared
directory that everyone shares and that's going to be her home directory then we are going to delete her as a user and all the files that she owns because she only wrote two articles and then she quit so we need to go ahead and delete her account and we're gonna delete all her files okay so on RedHat or on sent to us its user add and user del it's just opposite let's see I'm going to need to open a terminal oh that that is my Mac terminal we don't want that one it'll work actually it will work on there but we're not doing that we are doing this oh my goodness this is so hard for me ah come
on okay cool now watch there'd be something really embarrassing on the screen I haven't opened this in a while okay cool so this is how I recorded it anyway okay that's clear okay so I'm gonna put the mic down it's possible they might still hear me okay let me go back to this place line I hope we don't run out of time okay am i typing no what happened no hang on okay here we go okay so add users so what we're gonna do sudo add user that's like what you would normally do is you can just type this in and add the user right Oh with the username you would put the username here okay but what we want to
do is the home directory so you do that stuff home it's gonna be slash content I hope we're in the right area for this I think so we'll see uh-oh should not take this long actually what it should do is start asking me questions Oh
user okay so it did it so it added the files her password is going to be password a very bad password okay now it's asking you can just press ENTER to get past all this and say yes the information is correct okay so let's see let's switch user to Juliet and put in her password S sub you switch user all right so now we're in my home we want to go to Juliet's home see the squiggly line for the home that's gonna be whatever our home directory is and we're gonna do PWD print working directory this is gonna tell us where we are and we are in content so see we did it so let's exit
out of her account we're back in my account now my account is where the magic happens so now we're going to delete the user and remove all their files on CentOS are going to use userdel' and you're going to use - - to remove instead of remove all files and it will remove the home directory in the mail spool but will not remove the directory if it's owned by Juliet if it is not owned by Juliet so you would use - - force - force removal but in this case we don't want to force removal because this is a shared directory if you remove all the files and content that's owned by a Juliet it were removed
the directory as well so you may need to change permission if there's other files that need to be kept so you have to make sure that she doesn't own all the files because then all the files will be gone all right so what we're gonna do here is go back over to the screen so I can type there we go all right so I am on the wrong slide now hang on this just sorry this is just difficult for me right now hang on let's get over to the correct slide so I can do the right thing okay somehow this light is going there we go I deleted the slide okay I got it back I
don't know why I'm deleting slides okay so we're gonna do sudo because yep all right sudo delluser Juliet remove all files and spell it correctly okay so once it does this this is a part that looks weird it's gonna be like cannot check this cannot check that I forgot the exact wording see cannot handle special file that just means that Juliet doesn't own the file so it can't really check it or it just means that I don't own the file so I they can't check it so that's all fine that's just ignore them so any of these files are not owned by her anyway so it's okay alright so now that we did adding and deleting a
user we're going to go back to the presentation all right so we're gonna do passwd so the purpose of passwd is actually to change the password and also to manage user accounts so you can check the status of an account using passwd now the output is gonna show a lot of stuff you're gonna get a lot of stuff in the output what we're looking for is the status and the status is going to be l4 locked in p4 no password it is possible to have an account with no password or P which is a usable password some of the other information is stuff that you can set if you look at the man page for
passwd you and it'll show you the date of the last password change it will show you the minimum age and maximum age and the warning period which you can set you can set what those are when it gets to the maximum age it will when it gets to the warning period before the maximum age it will it'll make the user change it will let the user know you need to change your password and then there's going to be the inactivity period which I forgot the reason why but if it's an active account that happened that was in use today you're gonna see the number negative one I don't know why I forgot all right I'm not afraid to
admit it when I forget things okay so let's do this one this one's very quick and easy um where's my there's no virtual machine there we go that's important okay so we're going to do capital s that is that is what we need to use very simple PA SS WD - capital s Bob I forgot if Bob we still have an account for Bob oh sorry of course sudo I'm not root so now it's going to tell us the status I don't know why my machine is running low I'm slow low and slow okay so there's the status the PE means he has a usable password all right so now we can move on oh okay we are
gonna move on to file management quick grab the files that is so bright my goodness what is wrong with this projector I don't know if we can fix that I am sorry all right so that hurts my eyes okay so we're gonna do how much time oh we have 30 minutes awesome all right so we're going to work with cat and cat stands for concatenate so I underlined the cat part okay so sometimes you're going to need add a direction or a destination so what it does is it concatenates files so this is a real thing that I had to do I had a bunch of text messages but I downloaded to my computer and they were all
different files and I was like I need one big file for this so let's say you have all your text messages categorized by month and you want to put them into a file so let's do that that sounds like fun I hope everyone's having fun so far are you okay if you weren't having fun I don't know what to tell you okay I hope I don't know what you want I mean you knew what you were doing when you read the description so I'm gonna put this down I think we need to go to document Smith No okay go back here let's go to text okay so what we can do with this we are gonna remove this alright so as
you can see I got four different months here so they're all text files so if I wanted to I could just do it like this star dot txt instead of listing all of them so I'm gonna go ahead and list all of them because why not I mean I have the time right yes and you can tap complete we're gonna bring it into this file 2019 now we are going to cat the file to look at it there you go there's all the text if you look at just one example it's case sensitive that's what just one of them look like all right so what you can also do is you can use pipe commands such as more less
grep unique sort and more I didn't say the same command twice I really mean and more uh-huh you can you can pipe pipe commands okay so touch the purpose of touch you it's to you can do two things with it create an empty file or update the files timestamp basically it touches a file it's a very easy way to put it so what we're saying is that Jill is reviewing all of your work for the month but you want her to see the best stuff first so you can use stash C's so that you don't accidentally create a new file because if you create a new file because you typed it wrong she's gonna look at
it it's gonna be empty file and she's gonna be like what is this so let's touch files alright so we're gonna go back to our home okay so let's go to I think it I think it's in documents Oh nope god I'm so bad at typing with one hand yeah okay let's go to documents that is not the right place ah I know where we need to go we need to go to my work alright so right now it shows up let's pretend like worse that's first like well that's alphabetical and she's gonna use LS 8lt human readable long listing and t is for for modified sorted by time so the earliest is gonna show first and oh my
god the worst is at the top so what are we gonna do touch - see because we don't want to accidentally create a new file and we're gonna put pretty good and amazing up there and she's gonna see it and she is gonna look at those first and we probably want to put best up there - I want her now let's let's let her see the crappy stuff and then redeem ourselves with best okay so yeah nobody remembers in the middle right okay so we're gonna also do work count so let's say you're writing every single day and you're writing every day for the month and you want to keep a log of the word count and the word count at
the end of every day so we're going to put it into a file word count txt all right so I'm going to do that I hope I'm not being so boring I promise you my demos were way more awesome because I didn't have to multitask alright so everyone having fun so far maybe alright so let's go into our documents that's where I was trying to go earlier we're gonna look at this long story ooh wow alright so what we're gonna do is Nano I use nano because it's easy people are gonna argue about them and stuff I just use it you know alright so I'm doing more words now alright so we are going to save it which
is control o press Enter control X to exit all right so if I look at long story context that's what it looks like I think we have a word count in here let's look at that all right this is what it looks like I made - I made two entries and those were the timestamps so what we're gonna do here we're going to use these squiggly brackets is that the technical term okay squiggly brackets and you need a space before and after so what we want to do is we want to call the date because that's how I got the timestamp by using the date double ampersand because we want to execute both commands WC for work you
know - W - count the words you can use you can count bites characters lines or the length of the longest line we're gonna count just words and we need to tell it what the counts for some reason we need to put a semicolon there that's yeah I don't know why we just need to do it all right so that's the one-liner and in order to check it because you can't really tell what it did right nope we're looking at WordCamp all right there we go there's our new entry from today and the time is incorrect okay so next man I hope this is as fun as I'm as I thought it was all right so let's say you have a
bunch of image files and there's so many memes on your computer that it is just too much so you want to get rid of all the large files what we're going to do is we're going to list all of the image files we're going to list them by by size and we're going to use head to only display the top three the default for head is 10 you can modify you can add dash in with the number that you want to change that so let's see so we are going to do we're gonna go over where are we going pictures probably and we want to look at all the PNG and the JPG files and that
is going to show us the largest files oh I have a microphone stand now yay it says take whatever you get from that and put it into the next command so we just want to look at the top three and there we go face and hacker man that are just taking up way too much space so we're gonna get rid of those guys all right I'm just gonna keep them like up here and pretend we got rid of them so there's also unique where it doesn't find duplicate lines so if you want to only see duplicate entries in a file let's say you have a bunch of shows from a survey of favorite shows and you want
to see only the ones that were mentioned more than once and but let's pretend I think we have to go to let's see no I can bring the mic over here so I can so I can be heard very important part of public speaking is people publicly hearing you speak oh okay well I screwed that up sorry Jason okay can you hear me over there yeah it should pick up your voices just fine and we're related so even better my talks actually have never been recorded it was recorded once but never hosted just talking and he's recorded both of my talks so something bad happened it's his fault okay so we're gonna do niek we're going
to go to our shows why is it not in there I think that was in documents yep yep there it is all right so let's look at shows all right wow we got a lot of shows Wow let's sort them because we want to see them all right so we got them all sorted and what we want to do is just look at the ones that are mentioned more than once now we have to use piping again because if we simply because we have to sort the shows because some for some weird reason unique only works if the lines are next to each other so if they repeat each other next to each other then it will pull it out it doesn't pull
out unique lines if they're not next to each other I don't know why seems a little weird - Dee does to print only the duplicate lines so we're doing piping in those are the ones that are mentioned more than once and I'm just gonna take this opportunity to say I've never seen Game of Thrones I know I know people like to make fun of people that don't see Game Darlington be like oh they always say that all right so now we're gonna do sis admin stuff and I'm gonna try to fly through this so if I don't have time for questions I'll go outside of the room and we can talk it'll just take me a while to hobble up
the steps but we can talk outside all right so we're gonna try this one really really quick this one's so much easier than looking around for a whole bunch of files alright so what a leus does is it defines an action for a name string I'm not even showing the slide right now so I want to hurry up and do it let's say you're tired of typing all these commands cuz there's two two commands when you have to update stuff you have to have to get update you just apt-get upgrade fun fact I did not know about apt-get upgrade until years into using Linux so I thought I was updating but I wasn't nobody told me about it all right
so the alias is gonna be updating single quotes here let's not do that I'm not gonna put a plus sign there all right sudo apt-get update double ampersand that means to execute both commands sudo apt-get upgrade aliases are great what update me sudo oh I'm like what in the world okay please don't do that no forget it forget it okay I don't know what did I do wrong what did y'all see
oh okay so alright thank you so this should be correct right you can see me flawlessly do these things on the URL that I gave all right now let's try update me oh please do it please I don't have internet okay so okay so it worked all right thank you yeah it worked yes now you know you have to update and upgrade don't do one without the other I mean you can upgrade without updating but I don't know why you'd want to do that all right so let let me see what do I have here okay so because we're running short on time I am just going to tell you how to do these next few things
actually the shutdown one that's kind of cool I'm going to show you that one but the other ones I'm just gonna tell you how to do it if you look at the demos alright so make directory mkdir that makes directories we've what most of us can do that easily but what if you want to make a new directory with subdirectories and you want to make you want to have a verbose output so what you do is you use p4 to create January first the January directory first V means for both outputs so what it's going to do is it's going to tell you it created this directory and then you do the squiggly brackets and those are the
sub directories and and I I did dates but there's no 22 to 29 should have been 22 to 28 but whatever so we have four different weeks there and we're creating a sub directory for each week because we're tracking something weekly so that's how you do that that's going to create in one line it's going to create January and then it's going to create all four subdirectories so you're gonna save some time I'll come back to shut down in a minute message of the day this displays a message upon login so this is really useful if you have a bunch of users and you want to broadcast a message to them like in this case I'm
gonna say the next maintenance is at 4:00 a.m. UTC so there's two different ways to do this you can edit the Etsy motd file you can use nano vive em Emacs whatever or you can echo and then use brackets to say hey go into that file and there you go if you use double brackets it will append the file if you use one bracket it will overwrite the file now here are some other things that you might want to know I'm going backwards alright we have history so the purpose of history is to view the history of what you've done on the command line you can search through history you can do that by typing in history and searching
I think there you do backslash I don't remember a forward slash anyway or you can do history say the number of lines that you want to search so in this case I want to know how many times in the past 100 commands that I've done how about you have I typed in clear and so I'm going to do history 100 and then pipe grep - see I'm just gonna hold it it's it's ridiculous all right so - see is to count the number of results so it's gonna tell me how many times and then single quotes clear the dollar sign is there because when I type clear it's going to be at the end of the line so I'm telling it
wherever it says clear at the end of the line that's what I want you to count because what if I'm typing clear for something else anyway that is going to tell me how many times I have used a command what you can also do let's say you're training a new co-worker have you all used what is before nobody what is will give you a line describing what the command does so that's really useful you can create like a little manual for a new coworker and like we're gonna say what is file PWD and PS and it would tell you what it is it would give you a line summary for each one use the double brackets and put
that into a file commands dot txt and then you have like a little manual we're gonna use we're gonna I'm going to show you tree if we have time tree is a different way to view it so one of the issues that I have is I repeatedly type LS over and over and over even though I know what's in there so tree is a way to view the whole structure so you try to type in tree - D because I only want to look at the directories and then if you pipe it to less then you can scroll through that and see the whole tree and it's actually much easier to see that way other things
there's cow or G Cal this is the one that I said didn't work on a bun - I tried cow it's really weird first I tried it on Red Hat not sent to us Red Hat and Cal worked doing the weeks the week numbers on the side then I went in a bun - and it didn't work and I went to the man page and it was in there and it still didn't work so I don't know um but let's say you're making a making bullet journal weekly spreads I do bullet journaling I have to plan my week so I found out that if Cal doesn't work the capital M is for starting on Monday capital M lowercase
for Red Hat because my week I consider my week starting on Monday - W includes week numbers so that will give you a little calendar you can use G Cal - capital K starting the equals Monday and then put in the month and you get a little calendar with the week numbers all right so here are some resources I'm gonna let y'all have a minute to copy those down or take a picture Linux Academy is great I love Linux Academy it is worth it because you get free Cloud Servers that you can just spin up at any time and you just show you one and you can play with them that's that's been a huge resource for
me man pages are great all of this information I got from man pages all of it Lin fo l info org that gives a lot of Linux info cyber city not biz that's Nick's craft on Twitter and penguin tutor comm slash and Linux okay so if anybody needs these resources let me know cuz I am gonna quickly do that demo and then we have to get out of here so fast do we have time for this
no I mean okay okay so which demo was I gonna do the shutdown okay the reason I say this is cool cuz I use two virtual machines but now that I'm thinking about it I don't think I can pull it off in five minutes and what this does though you can see it on the demos that I recorded you can do shutdown and then it will send a message to the user it's like a little broadcast message that said says hey the system is shutting down in ten minutes alright so this is my info let me get to the end oh no I'm at the beginning I'm gonna do the whole presentation all over again
okay so we have another speaker so you can't see it because the color is weird but Roxy did github I will tell you all my WW things and I can take questions outside if anyone has questions or you can email me Roxy at hurricane labs calm thank you for coming to my talk [Applause]