Class-1 Cyber Security Analyst - Linux System Administration-A
Class-1 Cyber Security Analyst - Linux System Administration-A
[email protected]
What is OS ?
Linux is an Operating system (Based on UNIX) which is isn’t a user friendly at all but it suit a
system admin with whatever a simple to complex network & system want.
Also it’s a multi-tasking and multi-user operating system which can handle many at the same time
easily.
History of Linux:
Linus Torvalds of University of Helsinki has created Linux OS on 1991. At the very first of Linux
invention it actually called “freax = freak free x”. But after getting a first project for FTP server,
coworkers have named it Linux.
Advantage of Linux:
Linux is free:
If you want to spend absolutely nothing, you don't even have to pay the price of a CD. Linux
can be downloaded in its entirety from the Internet completely for free. No registration fees,
no costs per user, free updates, and freely available source code in case you want to change
the behavior of your system.
A vendor who wants to sell a new type of computer and who doesn't know what kind of OS
his new machine will run, can take a Linux kernel and make it work on his hardware,
because documentation related to this activity is freely available.
As with UNIX, a Linux system expects to run without rebooting all the time. That is why a
lot of tasks are being executed at night or scheduled automatically for other calm moments,
resulting in higher availability during busier periods and a more balanced use of the
hardware. This property allows for Linux to be applicable also in environments where
people don't have the time or the possibility to control their systems night and day.
The security model used in Linux is based on the UNIX idea of security, which is known to
be robust and of proven quality. But Linux is not only fit for use as a fort against enemy
attacks from the Internet: it will adapt equally to other situations, utilizing the same high
standards for security. Your development machine or control station will be as secure as
your firewall.
From a Palmtop with 2 MB of memory to a petabyte storage cluster with hundreds of nodes:
add or remove the appropriate packages and Linux fits all. You don't need a supercomputer
anymore, because you can use Linux to do big things using the building blocks provided
with the system. If you want to do little things, such as making an operating system for an
embedded processor or just recycling your old 486, Linux will do that as well.
The Linux OS and most Linux applications have very short debug-times:
Because Linux has been developed and tested by thousands of people, both errors and
people to fix them are usually found rather quickly. It sometimes happens that there are only
a couple of hours between discovery and fixing of a bug.
Linux users have the choice whether to use Linux or not, which gives them an enormous
advantage compared to users of proprietary software, who don't have that kind of freedom.
After long periods of testing, most Linux users come to the conclusion that Linux is not only
as good, but in many cases better and faster that the traditional solutions. If Linux were not
trustworthy, it would have been long gone, never knowing the popularity it has now, with
millions of users. Now users can influence their systems and share their remarks with the
community, so the system gets better and better every day. It is a project that is never
finished, that is true, but in an ever changing environment, Linux is also a project that
continues to strive for perfection.
A file-system is the methods and data structures that an operating system uses to keep track of files on a disk
or partition; that is, the way the files are organized on the disk.
Now some one could ask then what’s the different between a File-system and a partition.
And a partition is a logical part of the disk. Just think of a cake as the entire disk, a slice of that cake would
be a partition.
Primary partition:
A hard disk can contain up to 4 primary partitions and not more than that.
Extended partition:
Linux numbers Logical partitions starting with 5: the numbers 1, 2, 3 and 4 are reserved for the
primary partition.
1. BIOS
3. GRUB
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.el5PAE)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-194.el5PAE ro root=LABEL=/
initrd /boot/initrd-2.6.18-194.el5PAE.img
As you notice from the above info, it contains kernel and initrd image.
So, in simple terms GRUB just loads and executes Kernel and initrd images.
4. Kernel
5. Init
Init identifies the default initlevel from /etc/inittab and uses that to load all appropriate program.
Execute ‘grep initdefault /etc/inittab’ on your system to identify the default run level
If you want to get into trouble, you can set the default run level to 0 or 6. Since you know what 0 and
6 means, probably you might not do that.
Typically you would set the default run level to either 3 or 5.
6. Runlevel programs
When the Linux system is booting up, you might see various services getting started. For example, it
might say “starting sendmail …. OK”. Those are the runlevel programs, executed from the run level
directory as defined by your run level.
Depending on your default init level setting, the system will execute the programs from one of the
following directories.
o Run level 0 – /etc/rc.d/rc0.d/
o Run level 1 – /etc/rc.d/rc1.d/
o Run level 2 – /etc/rc.d/rc2.d/
o Run level 3 – /etc/rc.d/rc3.d/
o Run level 4 – /etc/rc.d/rc4.d/
o Run level 5 – /etc/rc.d/rc5.d/
o Run level 6 – /etc/rc.d/rc6.d/
Please note that there are also symbolic links available for these directory under /etc directly. So,
/etc/rc0.d is linked to /etc/rc.d/rc0.d.
Under the /etc/rc.d/rc*.d/ direcotiries, you would see programs that start with S and K.
Programs starts with S are used during startup. S for startup.
Programs starts with K are used during shutdown. K for kill.
There are numbers right next to S and K in the program names. Those are the sequence number in
which the programs should be started or killed.
For example, S12syslog is to start the syslog daemon, which has the sequence number of 12.
S80sendmail is to start the sendmail daemon, which has the sequence number of 80. So, syslog
program will be started before sendmail.
Linux utilizes what is called "runlevels". A runlevel is a software configuration of the system that
allows only a selected group of processes to exist. Init can run the system in one of eight runlevels.
These runlevels are 0-6. The system runs in only one of these runlevels at a time. Typically these
runlevels are used for different purposes.
The "/etc/inittab" file tells init which runlevel to start the system at and describes the processes to be
run at each runlevel. An entry in the inittab file has the following format:
id:runlevels:action:process
Runlevels can be edited manually by editing control scripts in /etc/init.d and symbolic links in
/etc/rc0.d… /etc/rc6.d.