Networking Project

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 42

CONTENTS

1. LINUX FILE SYSTEM

2. LINUX PERMISSIONS

3. DNS

4. WEB SERVER

5. NFS

6. DHCP

7. FIREWALL

8. SAMBA
LINUX FILE SYSTEM

Linux File System or any file system generally is a layer which


is under the operating system that handles the positioning of
your data on the storage, without it; the system cannot knows
which file starts from where and ends where.

Linux File System Directories

/bin: Where Linux core commands reside like ls, mv.


/boot: Where boot loader and boot files are located.
/dev: Where all physical drives are mounted like USBs DVDs.
/etc: Contains configurations for the installed packages.
/home: Where every user will have a personal folder to put his
folders with his name like /home/likegeeks.
/lib: Where the libraries of the installed packages located since
libraries shared among all packages
unlike windows, you may find duplicates in different folders.

/media: Here is the external devices like DVDs and USB sticks
are mounted and you can access their files from here.

/mnt: Where you mount other things Network locations and


some distros you may find your mounted USB or DVD.
/opt: Some optional packages are located here and this is
managed by the package manager.
/proc: Because everything on Linux is a file, this folder for
processes running on the system,
and you can access them and see much info about the current
processes.

/root: The home folder for the root user.


/sbin: Like /bin, but binaries here are for root user only.
/tmp: Contains the temporary files.
/usr: Where the utilities and files shared between users on
Linux.
/var: Contains system logs and other variable data.

Types of Linux File Systems


A standard Linux Distribution provides the choice of
partitioning disk with the file formats listed below, each
of which has special meaning associated with it.
1. ext2
2. ext3
3. ext4
4. jfs
5. ReiserFS
6. XFS
7. Btrfs

ext2, ext3, ext4


These are the progressive version of Extended
Filesystem (ext), which primarily was developed
for MINIX. The second extended version (ext2) was an
improved version. Ext3 added performance
improvement. Ext4 was a performance improvement
besides additional providing additional features.

JFS
The Journaled File System (JFS) was developed by IBM
for AIX UNIX which was used as an alternative to
system ext. JFS is an alternative to ext4 currently and is
used where stability is required with the use of very few
resources. When CPU power is limited JFS comes
handy.

ReiserFS
It was introduced as an alternative to ext3 with improved
performance and advanced features. There was a time
when SuSE Linux‘s default file format was ReiserFS but
later Reiser went out of business and SuSe had no
option other than to return back to ext3. ReiserFS
supports file System Extension dynamically which was
relatively an advanced feature but the file system lacked
certain area of performance.

XFS
XFS was a high speed JFS which aimed at
parallel I/O processing. NASA still usages this file
system on their 300+ terabyte storage server.
Btrfs
B-Tree File System (Btrfs) focus on fault tolerance, fun
administration, repair System, large storage
configuration and is still under development. Btrfs is not
recommended for Production System.
Clustered File Format
Clustered file System is not required for booting but best
suited in shared environment form storage point of view.
Non-Linux File Format
There are lots of File format not available under Linux
but are used by other OS’s. Viz., NTFS by Microsoft,
HFS by Apple/Mac os, etc. Most of these can be used
under Linux by mounting them using certain tools
like ntfs-3g to Mount NTFS file system but not preferred
under Linux.

Unix File Format


There are certain File formats used widely in Linux but
not preferred under Linux specially for installing Linux
root System. e.g., UFS of BSD.
Ext4 is the preferred and most widely used Linux file
System. In certain Special case XFS and ReiserFS are
used. Btrfs is still used in experimental environment.

Disk Partitioning
The first stage is disk Partitioning. While partitioning we
should keep the below points in mind.
1. Partition keeping backup and recovery in mind.
2. Space limitation mark in partition.
3. Disk management – Administrative Function.
LINUX PERMISSION

Linux is a multi-user operating system, so it has security to


prevent people from accessing each other’s confidential files.

There’s a lot of information in those lines.


1. The first character will almost always be either a ‘-‘, which
means it’s a file, or a ‘d’, which means it’s a directory.
2. The next nine characters (rw-r–r–) show the security; we’ll
talk about them later.
3. The next column shows the owner of the file. In this case it
is me, my userID is “aditya314”.
4. The next column shows the group owner of the file. In my
case I want to give the “aditya314” group of people special
access to these files.
5. The next column shows the size of the file in bytes.
6. The next column shows the date and time the file was last
modified.
7. And, of course, the final column gives the filename.
Deciphering the security characters will take a bit more work.
Understanding the security permissions

First, you must think of those nine characters as three sets of


three characters (see the box at the bottom). Each of the three
“rwx” characters refers to a different operation you can perform
on the file.
--- --- ---
rwx rwx rwx
user group other

Read, write, execute and –

The ‘r’ means you can “read” the file’s contents.


The ‘w’ means you can “write”, or modify, the file’s contents.
The ‘x’ means you can “execute” the file. This permission is
given only if the file is a program.
If any of the “rwx” characters is replaced by a ‘-‘, then that
permission has been revoked.

User, group and others

user – The user permissions apply only the owner of the file or
directory, they will not impact the actions of other users.
group – The group permissions apply only to the group that has
been assigned to the file or directory, they will not effect the
actions of other users.
others – The others permissions apply to all other users on the
system, this is the permission group that you want to watch the
most.

Reading the security permissions

For example, consider that the user’s permissions for some


files is “rw-” as the first three characters. This means that the
owner of the file (“aditya314”, i.e. me) can “read” it (look at its
contents) and “write” it (modify its contents). I cannot execute it
because it is not a program; it is a text file.
If “r-x” is the second set of 3 characters it means that the
members of the group “aditya314” can only read and execute
the files.
The final three characters show the permissions allowed to
anyone who has a UserID on this Linux system. Let us say we
have the permission (“r–“). This means anyone in our Linux
world can read, but they cannot modify the contents of the files
or execute it.

Changing security permissions

The command you use to change the security permissions on


files is called “chmod”, which stands for “change mode”,
because the nine security characters are collectively called the
security “mode” of the file.
1. The first argument you give to the “chmod” command is ‘u’,
‘g’, ‘o’. We use:
u for user
g for group
o for others,
you can also use a combination of them (u,g,o).
This specifies which of the three groups you want to modify.
2. After this use
a ‘+’ for adding
a ‘-‘ for removing
and a “=” for assigning a permission.
3. Then specify the permission r,w or x you want to change.
Here also you can use a combination of r,w,x.
This specifies which of the three permissions “rwx” you
want to modify
4. use can use commas to modify more permissions
5. Finally, the name of the file whose permission you are
changing
An example will make this clearer.
For example, if you want to give “execute” permission to the
world (“other”) for file “xyz.txt”, you would start by typing
chmod o
Now you would type a ‘+’ to say that you are “adding” a
permission.
chmod o+
Then you would type an ‘x’ to say that you are adding “execute”
permission.
chmod o+x
Finally, specify which file you are changing.
chmod o+x xyz.txt
You can see the change in the picture below.

You can also change multiple permissions at once. For


example, if you want to take all permissions away from
everyone, you would type
chmod ugo-rwx xyz.txt
The code above revokes all the read(r), write(w) and execute(x)
permission from all user(u), group(g) and others(o) for the file
xyz.txt which results to this.

Another example can be this:


chmod ug+rw,o-x abc.mp4
The code above adds read(r) and write(w) permission to both
user(u) and group(g) and revoke execute(x) permission from
others(o) for the file abc.mp4.
Something like this:
chmod ug=rx,o+r abc.c
assigns read(r) and execute(x) permission to both user(u) and
group(g) and add read permission to others for the file abc.c.
There can be numerous combinations of file permissions you
can invoke, revoke and assign. You can try some in your linux
system.
DNS

The Domain Name System (DNS) is


a hierarchical and decentralized naming system for
computers, services, or other resources connected to
the Internet or a private network. It associates various
information with domain names assigned to each of the
participating entities. Most prominently, it translates
more readily memorized domain names to the
numerical IP addresses needed for locating and
identifying computer services and devices with the
underlying network protocols. By providing a
worldwide, distributed directory service, the Domain
Name System has been an essential component of the
functionality of the Internet since 1985.
The Domain Name System delegates the responsibility
of assigning domain names and mapping those names
to Internet resources by designating authoritative name
servers for each domain. Network administrators may
delegate authority over sub-domains of their allocated
name space to other name servers. This mechanism
provides distributed and fault-tolerant service and was
designed to avoid a single large central database.
The Domain Name System also specifies the technical
functionality of the database service that is at its core. It
defines the DNS protocol, a detailed specification of the
data structures and data communication exchanges
used in the DNS, as part of the Internet Protocol Suite.
The Internet maintains two principal namespaces, the
domain name hierarchy[1] and the Internet
Protocol (IP) address spaces. The Domain Name
System maintains the domain name hierarchy and
provides translation services between it and the address
spaces. Internet name servers and a communication
protocolimplement the Domain Name System. A DNS
name server is a server that stores the DNS records for
a domain; a DNS name server responds with answers to
queries against its database.
The most common types of records stored in the DNS
database are for Start of Authority (SOA), IP
addresses (A and AAAA), SMTP mail exchangers (MX),
name servers (NS), pointers for reverse DNS
lookups (PTR), and domain name aliases (CNAME).
Although not intended to be a general purpose
database, DNS has been expanded over time to store
records for other types of data for either automatic
lookups, such as DNSSEC records, or for human
queries such as responsible person (RP) records. As a
general purpose database, the DNS has also been used
in combating unsolicited email (spam) by storing a real-

time blackhole list (RBL).


WEB SERVER

A web server is a system that manipulates requests via HTTP


protocol, you request a file from the server and it responds with
the requested file, which might give you an idea that web
servers are only used for the web.Actually, web servers can
also be found embedded in devices such as printers, routers,
when you open your router configuration page, there is a web
server behind it.

When you open the printer configuration page, there is also a


web server behind it serving your requests, so web servers are
important today because they are used everywhere.

There are many Linux web server implementations available


for you to use:

 Apache server
 Nginx
 Lighttpd
 Apache Tomcat
 Monkey HTTP Daemon (used especially for embedded systems)
There are more Linux web servers, but this list is the most used
web servers.

The most used web servers are Apache and Nginx.

In this post, we will use Apache server for several reasons:


 It is stable.
 It is flexible.
 It is secure.

When you request a file or a page from a web server, the client
at first connects to the server on port 80. After successful
connection, the client then sends HTTP commands (also
methods) to the server. This command includes a request
header which includes information about the client.
NFS

NFS (Network File System) which is basically


used to share the files and folders between Linux
systems. This was developed by Sun
Microsystems in 1980 which allows us to mount
the file system in the network and remote users
can interact and the share just like local file and
folders.

Features of NFS
 NFS can be configured as a centralized storage

solution.
 No need of running the same OS on both

machines.
 Can be secured with Firewalls.

 It can be shared along with all the flavors of

*nix.
 The NFS share folder can be mounted as a local

file system.

Setup NFS

NFS mount needed at least two machines. The


machine hosting the shared folders is called as
server and which connects is called as clients.
Exporting the Share Directory

We need to decide a directory which we want to


share with the client. The directory should be
added to /etc/exports.
# vi /etc/export
DHCP

The Dynamic Host Configuration Protocol (DHCP) is


a network management protocol used on UDP/IP networks
whereby a DHCP server dynamically assigns an IP
address and other network configuration parameters to each
device on a network so they can communicate with other IP
networks.[1] A DHCP server enables computers to request IP
addresses and networking parameters automatically from
the Internet service provider (ISP), reducing the need for
a network administrator or a user to manually assign IP
addresses to all network devices.[1] In the absence of a DHCP
server, a computer or other device on the network needs to be
manually assigned an IP address, or to assign itself
an APIPA address, which will not enable it to communicate
outside its local subnet.
DHCP can be implemented on networks ranging in size
from home networks to large campus networks and
regional Internet service provider networks.[2] A routeror
a residential gateway can be enabled to act as a DHCP server.
Most residential network routers receive a globally unique IP
address within the ISP network. Within a local network, a
DHCP server assigns a local IP address to each device
connected to the network.
FIREWALL

In computing, a firewall is a network security system


that monitors and controls incoming and
outgoing network traffic based on predetermined
security rules.[1] A firewall typically establishes a barrier
between a trusted internal network and untrusted
external network, such as the Internet.[2]
Firewalls are often categorized as either network
firewalls or host-based firewalls. Network firewalls
filter traffic between two or more networks and run on
network hardware. Host-based firewalls run on host
computers and control network traffic in and out of those
machines.
SAMBA

Samba is a free software re-implementation of


the SMB networking protocol, and was originally
developed by Andrew Tridgell. Samba
provides file and printservices for various Microsoft
Windows clients and can integrate with a
Microsoft Windows Server domain, either as a Domain
Controller (DC) or as a domain member. As of version 4,
it supports Active Directory and Microsoft Windows
NT domains.
Samba runs on most Unix, OpenVMS and Unix-
like systems, such as Linux, Solaris, AIX and
the BSD variants, including Apple's macOS Server,
and macOS client (Mac OS X 10.2 and greater). Samba
is standard on nearly all distributions of Linux and is
commonly included as a basic system service on other
Unix-based operating systems as well. Samba is
released under the terms of the GNU General Public
License. The name Samba comes from SMB (Server
Message Block), the name of the standard protocol used
by the Microsoft Windows network file system.
PROJECT

Step 1: we will open webmin of our linux server(I.P. 192.168.1.100).


Step 2: we will create domains and subdomains in servers ->bind DNS
server
Step 3: Now we will host the domains and subdomains in apache server
.
Step 4: Now we will configure mail server and set the subdomain
mail.netcamp.in.
Step 5: In networking configurations -> networking protocols we will
select all four options and save and continue.
Step 6: Now we will host mail service in apache server wit the help of
squirrel mail service .
Step 7: Now we will open mail.netcamp.in in web browser .
Step 8: Now we will create users and set their passwords using telnet
service.
Step 9: Now we will set the permissions of the users to various groups
we created .

Common data folder for user (only departmental access – only the department people can
read and write on the same

/departmentname/data

Common driver folder for the user (only departmental access – only access (r-x) but they
can’t write on the same)
/departmentname/driver

chairman will have full access on these folder called data and driver
Step 10: Now we will use Samba file sharing for sharing files between
different servers and users and groups .
Step 11: Now we will open web mail and login as the users we created
and send mails among the users.
Step 12: The mail has been sent from one user to other through the
webmail service and is received by the other user.

You might also like