Introduction to Cyber Security
What is Cyber Security?
Cyber Security is like having a superhero shield for your computer and online activities. It’s all about protecting your information, like passwords and personal details, from bad people who want to steal or harm it. Just like you lock your diary to keep it private, cyber security helps keep your digital life safe from hackers and other sneaky villains on the internet.
Cyber Security and Linux
Let’s imagine that you’re playing a game where you need to protect a treasure from being stolen by bad guys. To do that, you need a special tool that helps you keep the treasure safe. In the real world, cyber security experts use Linux as their special tool to protect computer systems from bad guys who want to steal or damage important information.
Linux is like a superpowerful shield that these experts use to defend against attacks. It’s a special operating system (just like Windows or macOS) that is known for its strong security features. It helps keep the computer systems safe from hackers and other cyber threats.
Think of Linux as a secret hideout that only the good guys know about. It’s a place where cyber security experts can work without being easily found by the bad guys. Linux allows them to hide their tracks and protect themselves while they investigate and find solutions to cyber threats.
One of the reasons why cyber security experts prefer Linux is because it gives them more control over their tools. It’s like having a special gadget belt with all the tools they need to catch the bad guys. They can modify and customize Linux to make it work exactly the way they want it to, just like how superheroes modify their gadgets to suit their needs.
In addition to that, Linux has a lot of security features built into it. It’s like having a fortress with strong walls and locked doors. It helps keep the bad guys out and allows cyber security experts to monitor and detect any suspicious activity. They can set up alarms and traps to catch the bad guys before they can do any harm.
So, just like in the game where you’re protecting the treasure, cyber security experts use Linux as their special shield and hideout to protect computer systems from bad guys. It’s their superpowerful tool that helps them keep important information safe and catch the bad guys who try to steal or damage it.
What is Ubuntu?
Ubuntu is a type of computer operating system, kind of like the software that makes your computer work. It’s named after a South African philosophy that emphasizes sharing and caring for others.
What makes Ubuntu special is that it’s free for anyone to use and it’s made by people all over the world who work together to make it better. It’s like a big team of computer experts who want to make the world a better place by sharing their knowledge and creating something that everyone can use.
When you use Ubuntu, you can do all the things you normally do on a computer, like browse the internet, create documents, and play games. But because it’s made by a community of people who care about each other, it’s designed to be easy to use and work well on many different types of computers.
What is Virtual Box
Virtualbox is a computer program that lets you create a pretend computer inside your real computer. It’s like having a secret room inside your room where you can play different games or do different things without affecting your real computer.
This pretend computer is called a virtual machine, and you can install different operating systems (like Windows, Ubuntu, or macOS) on it, just like you would on a real computer. This can be useful for testing out new software, or for running programs that might not work on your real computer.
You can also use Virtualbox to create multiple virtual machines, so you can have several pretend computers running on your real computer at the same time. It’s like having a whole bunch of secret rooms inside your room!
Starting Virtual Box
-
Launch the VirtualBox application on your computer.
-
In the main window, you will see a list of all the virtual machines that you have created in VirtualBox. Locate the virtual machine that you want to start and click on it to select it.
-
Once you have selected the virtual machine, click on the “Start” button in the toolbar or right-click on the virtual machine and select “Start” from the context menu.
Saving Your Work in Virtual Box
- First, make sure the virtual machine you want to save is running.
- In the VirtualBox Manager window, select the virtual machine you want to save the state of and click on the “Machine” menu option at the top of the window.
- From the drop-down menu that appears, select “Close” to save the state of the virtual machine.
- A dialog box will appear asking you to choose the “Save the machine state” option. Make sure this option is selected and then click on the “OK” button.
- VirtualBox will then save the current state of the virtual machine and shut it down.
- To restart the virtual machine later, simply open VirtualBox and select the virtual machine you want to start.
- Click on the “Start” button to boot up the virtual machine.
- The virtual machine will resume from the exact state it was in when you saved it.
Commands
Commands are special words or phrases that you can type into your computer’s “command line” to make the computer do different things. Think of it like giving your computer a set of instructions to follow. Just like how you can tell your computer to open a program by clicking on an icon with your mouse, you can type a Linux command into the command line and press enter for the same result.
Some Linux commands do simple things like creating a new folder or copying a file, while others do more complex things like managing your computer’s storage or running programs. There are many different commands you can use and each has their own specific instructions.
To use a Linux command, you need to know what it does and how to use it properly. You can find a list of common Linux commands online or in a book, and you can learn how to use them by experimenting on your own computer.
Terminal
The terminal in Linux is like a special way of talking to the computer. Instead of using buttons and menus like you do in other programs, you type in words and press the Enter key to tell the computer what to do.
When you open the terminal, you will see a black screen with a blinking cursor that looks like a little line as seen in the image below. This is where you will type in your commands. You can use the keyboard to type in words just like you do when you are typing a story or a message to a friend.
Figure 1
When you press the Enter key after typing in a command, the computerwill show you the result on the screen. It may show you a list of files, or tell you that a program is running, or give you other information.
The terminal can help you do all kinds of things on your computer, such as manage your files, run programs, and even control your computer’s settings. It might seem a little tricky at first, but with practice, you can use the terminal to make your computer do exactly what you want it to do.
Activity: Opening Terminal
- Click on the “Menu” button located on the bottom left corner of the screen.
- In the search bar, type “Terminal” and press Enter. Alternatively, you can navigate to the “Accessories” category and click on “Terminal”.
- A terminal window will open up, displaying a command prompt where you can enter Linux commands.
You can use a keyboard shortcut to open up the terminal. Press the keys “Ctrl + Alt + T” on your keyboard to open up a new terminal window.
Once you have the terminal open, you can start using Linux commands to interact with your computer. It’s a powerful tool that can be intimidating at first, but with practice, you will become more comfortable with it.
Files and Directories in Linux
In Linux, files and directories are like the pages and chapters in a book. Just like how a book is made up of different pages and chapters, a computer’s hard drive is made up of different files and directories.
A file is like a page in a book. It contains information just like a page contains text and pictures. For example, a file could contain a document, a song, or a picture. Files can be opened and edited just like how you can read and write on a page in a book.
A directory , on the other hand, is like a chapter in a book. It’s a way of organizing files, just like how chapters organize information in a book. Directories can contain files and other directories. For example, you might have a directory called “School Work” that contains different files for each of your classes.
Just like how you can flip through the pages of a book to find the information you need, you can navigate through directories to find the files you need. The commands you use to navigate through directories are like the table of contents or index in a book, as they help you find the right chapter or page quickly and easily.
Overall, files and directories are a way of organizing and storing information on a computer. Just like how a book needs pages and chapters to make sense, a computer needs files and directories to keep everything organized and easy to find.
Creating Files
The touch command is a simple but powerful command in Linux that allows you to create an empty file. Here are some examples of how to use the touch command in Linux:
To create a new empty file using the touch command, you can type “touch” followed by the name of the file you want to create. For example, to create a new file called “my-file.txt”, you can type:
touch my-file.txt
The touch command can be used to create multiple files as well. For example, if you wanted to create three files “my-file1.txt”, “my-file2.txt”, and “my-file3.txt”, you can type:
touch my-file1.txt my-file2.txt my-file3.txt
Activity: Creating a new empty file
Use the touch command to create a new empty file called “my-file.txt” in your home directory. Then, open your file manager to see if you can find the file you created.
Activity: Creating multiple files at once
Use the touch command to create three new files called “file1.txt”, “file2.txt”, and “file3.txt” in a single command.
Editing File
The gedit command is a graphical text editor that comes pre-installed in many Linux distributions, including Ubuntu and Linux Mint. This command can be used to edit a file. Here are some examples of how to use the gedit command:
To open a file in gedit, simply type “gedit” followed by the name of the file you want to open. For example, to open a file called “my-file.txt”, you can type:
gedit my-file.txt
This will open the file “my-file.txt” in the gedit text editor, where you can edit it using the graphical user interface.
Activity: Opening a New Empty File
Use the
gedit
command to open a new empty file in the gedit text editor. Save the file with a name of your choosing.
Activity: Opening an Existing File
Use the
gedit
command to open an existing file called “my-file.txt” in the gedit text editor.
Activity: Saving Changes to a File
Open an existing file in the gedit text editor, add your name and the name of the school you attend, and save the changes to the file.
Deleting Files
The rm command is a powerful command in Linux that allows you to remove files and directories from your system. Here are some examples of how to use the rm command in Linux:
To remove a single file using the rm command, you can simply type “rm” followed by the name of the file you want to remove. For example, to remove a file called “my-file.txt”, you can type:
rm my-file.txt
Activity: Deleting a File
Use the
rm
command to delete a file called “my-file.txt” in your home directory.
Activity: Deleting Fultiple Files at Once
Use the
rm
command to delete three files called “file1.txt”, “file2.txt”, and “file3.txt” in a single command.
Listing Directories
To list the contents of a directory in Linux, you will use the ls command. For example, let’s say you want to see what files and folders are in your current directory, you can use the following command:
ls
This command tells Linux to list the contents of the current directory.
Activity: Listing Files and Directories
Use the ls command to list the files and directories in the current directory.
Creating Directories
To create a new directory in Linux, you use the mkdir command. For example, let’s say you want to create a new directory called “my_folder” in your home directory. You can use the following command:
mkdir ~/my_folder
This command tells Linux to create a new directory with the name “my_folder” in your home directory.
Creating a single directory
Use the
mkdir
command followed by the name of the directory you want to create. For example, mkdir newdir will create a directory named newdir in the current directory.
Changing Directories
To change directories in Linux, you use the cd command. For example, let’s say you want to move into the “my_folder” directory you just created. You can use the following command:
cd ~/my_folder
This command tells Linux to change your current directory to “my_folder” in your home directory.
It’s important to remember that you can only change directories to places where you have permission. If you try to change directories to a place where you don’t have permission, you’ll get an error message.
If you ever want to go back to the home directory just type:
cd
Activity: Changing to a specific directory
Use the cd command followed by the path to the directory you want to change to.
Activity: Changing to the home directory
Use the cd command without any arguments to change to your home directory.
Activity: Changing to the parent directory
Use the cd command followed by .. to change to the parent directory of the current directory.
Removing Directories
The rmdir command in Linux is used to remove empty directories. If a directory contains any files or subdirectories, the rmdir command will not remove it.
Here are some examples of how to use the rmdir command in Linux:
To remove an empty directory called “mydir”, use the following command:
rmdir mydir
This will remove the directory “mydir” if it is empty.
To remove multiple empty directories called “dir1”, “dir2”, and “dir3”, use the following command:
rmdir dir1 dir2 dir3
This will remove all three directories if they are empty.
It is important to use the rmdir command with caution, as it will only remove empty directories.
Activity: Removing a Single Empty Directory
Use the rmdir command followed by the name of the directory you want to remove. For example,
rmdir emptydir
will remove a directory named emptydir if it is empty.
Activity: Removing Multiple Empty Directories
Use the rmdir command with the names of multiple directories separated by spaces to remove multiple directories at once For example,
rmdir emptydir1 emptydir2
will remove two directories named emptydir1 and emptydir2 if they are both empty.
Activity: Removing Multiple Empty Directories
Use the rmdir command with the names of multiple directories separated by spaces to remove multiple directories at once For example,
rmdir emptydir1 emptydir2
will remove two directories named emptydir1 and emptydir2 if they are both empty.
Copying Files and Directories
The cp
command is a tool that allows you to make a copy of a file or directory on your computer.
Think of it like making a photocopy of a worksheet at school. You start with one worksheet, but you want to make another copy of it so you can keep the original and work on the copy. The cp command does the same thing, but with computer files.
Here’s an example: let’s say you have a file called “report.doc” on your desktop and you want to make a copy of it in a folder called “backup” in your home directory. You would open up the terminal or command prompt and type:
cp ~/Desktop/report.doc ~/backup/
The ~/Desktop/report.doc part tells the cp command where the original file is located, and the ~/backup/ part tells it where to put the copy. The ~ symbol represents your home directory.
Activity: Copying Files
Copy a file called “book.pdf” from your Documents folder to your Downloads folder.
Activity: Copying Directories
Copy a folder called “pictures” and all its contents to a new folder called “old_pictures” in your Downloads folder.
Moving Files and Directories
The mv command is a tool that allows you to move or rename a file or directory on your computer.
Think of it like rearranging your bookshelf. If you want to move a book from one shelf to another, you pick it up and move it. The mv command does the same thing, but with computer files.
Here’s an example: let’s say you have a file called “essay.doc” in your Documents folder, but you want to move it to your Desktop. You would open up the terminal or command prompt and type:
mv ~/Documents/essay.doc ~/Desktop/
The ~/Documents/essay.doc part tells the mv command where the original file is located, and the ~/Desktop/ part tells it where to move the file to. The ~ symbol represents your home directory.
Activity: Renaming File
Rename a file called “old_name.jpg” to “new_name.jpg” in the Downloads folder.
Activity: Renaming Directory
Rename a folder called “old_folder” to “new_folder” in your Downloads folder.
Activity: Moving File
Move a file called “book.txt” from your Documents folder to your Pictures folder.
Activity: Moving Directory
Move all the files in the “old_pictures” folder to a new folder called “new_pictures” in your Pictures folder.
Putting it All Together
- Open the terminal on your computer.
- Navigate to your home directory.
- Create a new directory called “myfiles”.
- Navigate into the “myfiles” directory.
- Create a new file called “notes.txt”.
- Use the gedit text editor to open the “notes.txt” file and add some text to it.
- Close the gedit text editor.
- List the contents of the “myfiles” directory.
- Rename the “notes.txt” file to “my-notes.txt”.
- List the contents of the “myfiles” directory again.
- Create a new directory called “mydocs”.
- Move the “my-notes.txt” file into the “mydocs” directory.
- List the contents of the “myfiles” directory and the “mydocs” directory.
- Remove the “my-notes.txt” file.
- Remove the “mydocs” directory.
- List the contents of the “myfiles” directory.
- Remove the “myfiles” directory.
Note: Be careful when using the rm command as it will permanently delete files and directories without warning. Double-check the file or directory you want to remove before using this command.
Vocabulary Review
Terms | Definitions |
---|---|
cyber security | protecting your information, like passwords and personal details, from bad people who want to steal or harm it |
ubuntu | type of computer operating system |
virtualbox | a computer program that lets you create a pretend computer inside your real computer |
commands | special words or phrases that you can type into your computer’s “command line” to make the computer do different things |
terminal | interactive way of talking to a computer |
file | contains information just like a page contains text and pictures |
directory | way of organizing files |
touch | a simple but powerful command in Linux that allows you to create an empty file |
gedit | a graphical text editor |
rm | a powerful command in Linux that allows you to remove files and directories from your system |
ls | list the contents of a directory |
cd | change directories |
mkdir | create a new directory |
rmdir | used to remove empty directories |
mv | allows you to move or rename a file or directory on your computer |
cp | allows you to make a copy of a file or directory on your computer |