Linux Essentials Before We Start

Linux Essentials Before We Start

DOI: 10.4018/978-1-5225-7628-0.ch002
OnDemand:
(Individual Chapters)
Available
$37.50
No Current Special Offers
TOTAL SAVINGS: $37.50

Abstract

This chapter provides a complete overview of Linux operating system as possessing sound knowledge about Linux operating system is very much essential for learners who aspire to become good ethical hackers. The chapter explores the basic concepts like Linux architecture; Linux commands; file permissions in Linux; Linux configuration settings including user password settings, environment configuration, network settings; Linux processes and services to the advanced topics like shell scripting, configuring IP tables, logging process, configuring putty; Linux-based applications; etc. The chapter also provides examples of python programming in Kali Linux offensive Linux-based operating system. This chapter introduces all basic concepts related to the Linux operating system. To become a good ethical hacker, one should have a good understanding of the Linux operating system.
Chapter Preview
Top

Introduction

Before exploring ethical hacking domain, we would need to be conversant with Linux operating system. While setting up lab, we have already created a Kali Linux virtual machine. We will use it for experimenting Linux commands mentioned in this section. Kali Linux (Denis, Zena, & Hayajneh, 2016) is a Debian-based Linux distribution aimed at advanced Penetration Testing and Security Auditing (Kali, 2018; Vijay, 2017), which we will be using actively in subsequent chapters.

Linux, a free open source unix like operating system (32 or 64 bit, fully networked, multi-user, multi-tasking, portable, secure, written in C) is an ideal operating system for power-users and programmers. There are many Linux distributions like Redhat, Ubuntu, Debian, Kali, CentOS, Fedora available in market, out of which Ubuntu is popular for personal use, Kali is popular for offensive security learning and Debian is popular for servers (Linux, 2018).

Linux OS consists of:

  • 1.

    Kernel: Core of OS, provides interface between applications and hardware, responsible for management of memory, device, process and handling system calls,

  • 2.

    Shell: Is command line interpreter, provides interface between users and kernel e.g. C Shell (sh), Bourne Shell (bash), Korn Shell (ksh);

  • 3.

    Development Tools and Libraries: Include editors, compilers, and;

  • 4.

    End User Tools/Applications: Consisting browsers, multimedia players, office suites etc. as shown in Figure 1.

Figure 1.

Linux Architecture

978-1-5225-7628-0.ch002.f01

On a Linux system (Richard, 2017), everything is a file; if something is not a file, it is a process; for e.g. Directory—is a file that contain names of other files, Input/Output devices (/dev) are special files, Links are special systems used to make file or directory visible in multiple parts of the systems, Sockets are special file types, similar to TCP/IP sockets providing inter-process networking, Pipes forms a way for process to communicate with each other without using network socket.

Note: Now just start kali linux vm, login to it using username: root with password’s and click on terminal utility as shown in Figure 2 to practice following commands.

Figure 2.

KALI Linux VM Terminal

978-1-5225-7628-0.ch002.f02

To get the useful information about Linux distribution and version type “cat /etc/issue”. A typical Linux system can be configured to boot up into one of five different run levels. During the boot a process called in it looks in the /etc/inittab file to find the default run level. Having identified the run level, it proceeds to execute the appropriate startup scripts to run the services that are required for the system. A sample /etc/inittab file may contain following entries:

# Default runlevel. The runlevels used by RHS are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)
#
id:3:initdefault:
The key line in the example above is: id:3:initdefault:

This tells the in it process that the default run level for the system is run level 3. To change to a different run level simply change the number and save the /etc/inittab file. Before doing this, however, be absolutely sure you know which run level you want. Selecting the wrong run level can have serious consequences.

Now type ls –l, the first character of each line displayed shows the filetype as shown in Figure 3.

Complete Chapter List

Search this Book:
Reset