Chapter 5
Chapter 5
5.1. Introduction
What is security?
Security for information technology (IT) refers to the methods, tools and personnel used to
defend an organization's digital assets. The goal of IT security is to protect these assets, devices
and services from being disrupted, stolen or exploited by unauthorized users, otherwise known
as threat actors. These threats can be external or internal and malicious or accidental in both
origin and nature.
An effective security strategy uses a range of approaches to minimize vulnerabilities and target
many types of cyberthreats. Detection, prevention and response to security threats involve the
use of security policies, software tools and IT services.
Unfortunately, technological innovation benefits both IT defenders and cybercriminals. To
protect business assets, companies must routinely review, update and improve security to stay
ahead of cyberthreats and increasingly sophisticated cybercriminals.
Linux Operating System
One of Linux's many advantages over Windows is that it is more secure--much more. In
Windows, users are generally given administrator access by default, which means they pretty
much have access to everything on the system, even its most crucial parts. So, then, do viruses.
With Linux, on the other hand, users do not usually have such "root" privileges; rather, they're
typically given lower-level accounts. What that means is that even if a Linux system is
compromised, the virus won't have the root access it would need to do damage system wide;
more likely, just the user's local files and programs would be affected.
UNIX:
You can have many users logged into a system simultaneously, each running many
programs.
It's the kernel's job to keep each process and user separate and to regulate access to
system hardware, including cpu, memory, disk and other I/O devices.
Linux is a free Unix-type operating system originally created by Linus Torvalds with the
assistance of developers around the world.
Developed under the GNU General Public License , the source code for Linux is freely
available to everyone.
LINUX Distributions
Mandrake
RedHat
Fedora
SuSE/Novell
Debian
Ubuntu
Ubuntu
Ubuntu is a Debian-based Linux operating system and distribution for personal computers,
smartphones and network servers. It uses Unity as its default user interface.
The Linux system excel in many area, ranging from end user concerns such as stability,
speed, ease of use, to serious concerns such as development and networking.
• Linux kernel
• Linux networking
The kernel is the central nervous system of Linux, include OS code which runs the whole
computer. It provides resources to all other programs that you run under Linux, and manages all
other programs as they run.
The kernel includes the code that performs certain specialized tasks, including TCP/IP
networking.
The kernel design is modular, so that the actual OS code is very small to be able to load when
it needs, and then free the memory afterwards, thus the kernel remains small and fast and highly
extensible.
Networking comes naturally to Linux. In a real sense, Linux is a product of the Internet
or World Wide Web (www).
Linux is made for networking. Probably all networking protocols in use on the Internet
are native to Unix and/or Linux.
TCP/IP model
OSI TCP/IP
Networking Protocols
• Applettalk DDP
TCP/UDP Overview
o Connection-Oriented
o Reliable Protocol
o Connectionless
o Unreliable Protocol
IP Overview
Network Address
Subnet Address
Host Address
Use the slash(/) rather than the backslash(\) you have been using in DOS.
Standard Directories in Unix/Linux
/dev Files representing the system's various hardware devices. For example, you use the
file `/dev/cdrom' to access the CD−ROM drive.
/root The superuser's home directory, whose username is root. (In the past, the home
directory for the superuser was simply `/'; later, `/root' was adopted for this purpose to
reduce clutter in `/'.)
5.2.3. Security
o unauthorized access
o denial of service
o use TCP wrappers to limit which resources are made available to which categories
of users.
The system determines whether or not a user or group can access a file or program based
on the permissions assigned to them.
Apart from all the users, there is a special user called Super User or the root which has
permission to access any file and directory
Login name
User Id (uid)
Group Id (gid)
Home Directory
Shell
/etc/shadow Contains the encrypted password information for users' accounts and
optionally the password aging information. Included fields are:
Login name
Encrypted password
Remove login id from /etc/passwd & /etc/shadow file and delete home directory
deluser <username>
Use GUI to Delete the user
There are three permissions for any file, directory or application program.
The following lists the symbols used to denote each, along with a brief description:
Each of the three permissions are assigned to three defined categories of users.
One can easily view the permissions for a file by invoking a long format listing using the
command ls -l.
For instance, if the user juan creates an executable file named test, the output of the
command ls -l test would look like this:
The permissions for this file are listed are listed at the start of the line, starting with rwx.
The last set of symbols defining access permitted for all other users.
The ownership of the file or directory can be changed using the command
The group of the file or directory can be changed using the command
-R is optional and when used with directories will traverse all the sub-directories of the
target directory changing ALL the permissions to ###.
• The /proc file system is a specialized file system that lets you view and control system
resources such as processes, memory, and kernel networking parameters
• When you query a filename in /proc, the Linux kernel responds with live information
about the status of a process, memory, or other resource
• The /proc file system contains detailed information about each process running on Linux
• Before you can access information in /proc regarding a specific process, you need to find
the process’s PID number
• To manage your system effectively, you will often need to display detailed information
about specific processes
• The ps command has many options to select processes to be included in the command
output
• The root user can change the priority of any process; other users can raise the nice level
of processes they have started
• The nice and renice commands set a process’s nice level; other command-line and
graphical programs also let you change a process’s nice level
5.4.4. Viewing Processor Usage with top
• The top command lists processes according to how much CPU time they are using
• The top command can also be used to control processes by sending them signals
• The Linux kernel and Linux programs can only interact with information stored in RAM
• The free command displays information about RAM and virtual memory usage
• You can use the vmstat command to view detailed information about how swap space is
used
• When vmstat is run as a regular command, its output is based on information averaged
over time since the system was booted.
• Any program running on Linux can call the shared programming function syslog and
pass it a message
• The klogd daemon (kernel logging daemon) watches for messages submitted by the
Linux kernel
• Each line in syslog.conf defines a set of messages and what action to take with those
messages
There are 113 daemons, Out of them; the following are most widely used:
dovecot : IMAP (Internet Message Access Protocol) and POP3 (Post Office Protocol)
server
gpm : Mouse
network : Networking
Usage
A mail server (sometimes also referred to an e-mail server) is a server that handles and delivers
e-mail over a network, usually over the Internet. A mail server can receive e-mails from client
computers and deliver them to other mail servers.
Types of Mail Servers
Mail servers can be broken down into two main categories: outgoing mail servers and incoming
mail servers. Outgoing mail servers are known as SMTP, or Simple Mail Transfer Protocol,
servers. Incoming mail servers come in two main varieties. POP3, or Post Office Protocol,
version 3, servers are best known for storing sent and received messages on PCs' local hard
drives. IMAP, or Internet Message Access Protocol, servers always store copies of messages on
servers. Most POP3 servers can store messages on servers, too, which is a lot more convenient.
Step #1: After composing a message and hitting send, your email client - whether it's Outlook
Express or Gmail - connects to your domain's SMTP server.
Step #2: Your email client communicates with the SMTP server, giving it your email address,
the recipient's email address, the message body and any attachments.
Step #3: The SMTP server processes the recipient's email address - especially its domain. If the
domain name is the same as the sender's, the message is routed directly over to the domain's
POP3 or IMAP server.
Step #4: In order to find the recipient's server, the sender's SMTP server has to communicate
with the DNS, or Domain Name Server. The DNS takes the recipient's email domain name and
translates it into an IP address.
Step #5: Now that the SMTP server has the recipient's IP address, it can connect to its SMTP
server.
Step #6: The recipient's SMTP server scans the incoming message. If it recognizes the domain
and the user name, it forwards the message along to the domain's POP3 or IMAP server. From
there, it is placed in a sendmail queue until the recipient's email client allows it to be
downloaded. At that point, the message can be read by the recipient.
If you want to share files between your Ubuntu and Windows computers, your best option is to
use Samba file sharing. One of the most common ways to network Ubuntu and Windows
computers is to configure Samba as a File Server. The server will be configured to share files
with any client on the network without prompting for a password.
Installation
The first step is to install the samba package. From a terminal prompt enter:
sudo apt-get install samba smbfs
Configuration
Run the following command to open the configuration file, substituting your editor of choice:
# “security = user” is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
# in the samba-doc package for details.
; security = user
Create a new section at the bottom of the file, or uncomment one of the examples, for the
directory to be shared:
[share]
comment = Ubuntu File Server Share
path = /srv/samba/share
browsable = yes
guest ok = yes
read only = no
create mask = 0755
Changing permissions
Now that Samba is configured, the directory needs to be created and the permissions changed.
From a terminal enter:
From a Windows client you should now be able to browse to the Ubuntu file server and see the
shared directory. If your client doesn't show your share automatically, try to access your server
by its IP address, e.g. \\192.168.1.1, in a Windows Explorer window.