2. What is Linux?
Linux:
Linux is an open-source operating system and has existed for decades and its system
base-UNIX is the foundation of both Microsoft Windows and Apple(Macintosh).
Accounts on Linus are either Root or User and a user can enact permissions that are
based on root privileges.
There are hundreds of Linux distributions and a distribution is a type of Linus platform
that has been created for a specific purpose or design that separates itself from other
distributions.
Some of the most common types of Linux systems consist of Ubuntu, Debian, Fedora,
and Red Hat.
3. Why Use Linux?
Linux uses less resources and computing power than other operating systems
such as Microsoft Windows.
It will increase the ability to learn the use of other software and specifically,
information security tools.
The open-source platform enables multiple systems to have an operating system
without limitations of product keys and licenses.
Although Linux is still vulnerable to malware, the majority of present malware is
crafted to target Windows because it is still the most widely used operating
system.
4. Command Line Syntax
The command line is made up of three components:
Command
Option
File/Location
► Example: root@mint:Desktop/cat cybrary.txt
► The <cat> is the command that instructs the computer to read the contents of the
file, and <cybrary.txt> is the file itself.
► The location should be correct BEFORE executing the command because
otherwise the file will not be found, rendering the command ineffective.
5. Linux File and Folder Structure
The layout of Linux resembles the design of Windows but there are some
variances.
Linux begins with the root directory and it contains a </> slash
Multiple folders are extensions from root and are: /home, /bin, /sbin, /usr,
/mnt, /etc, /dev
/etc has sub folders: /etc/passwd & /etc/shadow
The home directory contains all directories in home
etc contains the passwords and files related to administrators. The shadow folder holds
the encrypted passwords.
Dev (short for device) contains locations of storage and optical drives.
6. How to Use Linux: Terminal
Terminal:
The terminal is the command shell of Linux and it is the hub for the majority of the operations in Linux.
Commands:
ifconfig – Very similar to ipconfig in Windows. Displays network information.
Passwd – Changes the password
Clear – Clears the terminal (Helps when you have a full screen)
Cat – Displays the contents of a file
cd – Change the directory
Cd.. – moves up one level in a directory tree
ls – List files and directories
Pwd – Displays path and name of current directory
su – Become the root user.
Sudo – Run command with root authority
There are hundreds of commands in a Linux system yet I wanted to highlight some of the more common ones.
8. Linux In Action
Kali Linux
► A file titled Cybrary-Note
was created.
► I changed the directory to
Desktop
► The ‘cat’ command was
used to read the file’s
contents.
9. Linux In Action
Kali Linux
► The directory was changed
to ‘dev’
► A ‘ls’ was executed to list
all in ‘dev’
10. Linux In Action
Kali Linux
► The file was read by using
cat and then a ‘mv’
command was done.
► ‘mv’ tells the system to
rename the file.
► Renaming files and other
things can be done by
using the terminal.
12. Linux In Action
Mint
► The user “cybrary” was
added by using ‘sudo’
and ‘adduser’ Sudo
enables permissions
without being a root user.
► A UNIX password was
given to the user.
► Also a few fictional phone
#s for fun.
13. Linux In Action
Mint
► After changing the
directory to /etc , the
command to read the
shadow file was executed
/etc $ cat shadow
► Shadow contains the
encrypted passwords and
the screenshot shows how
the password to cybrary is
encrypted (Bottom of the
screenshot).
14. Linux Commands - Common
• cd – Change Directory
• Cd.. Move up one level in the directory
• Logout – Close the session
• Ls – List all files
• Mv – Rename file
• Rm – Delete the file
• Clear – Clear screen
• Kill – Kill the running process
• Su – Become root user
• Sudo – use root privileges
• Exit – Exit terminal
• Cat – Display contents of file
• ifconfig – Display network
configurations
• Open – open the application
• Apt-get update – update package
• passwd – change password
• pwd – Display the directory path and
name
• mkdir – make new directory
• locate – locate files with specific name
• chmod – modify permissions for files and
directories