Sie sind auf Seite 1von 31

Practical Training Report

on
LINUX

Session 2018-19

(Department of Computer Science & Engineering)

SUBMITTED TO: SUBMITTED BY:


Mr. K.K. Agrawal [HOD,CS] Anshul Saini
Ms. Jyoti Mathur [Sr. Lecturer,CS] Namita Mishra
Mr. Arjun Meghwal [Sr. Lecturer,CS] Sanjay Verma
Mr. Rajesh Sonania [ATPO III Cell] Utkarsh Pareek
Acknowledgement

I am highly grateful to the Mr. K.K. Agarwal, HOD(CS), Govt.


R.C. Khaitan Polytechnic College, Jaipur for providing this
opportunity to carry make a project using the LINUX OS.

The help given by Mr. Maninder Singh, for experimentation is


greatly acknowledged.

Finally, I express my indebtedness to all who have directly or


indirectly contributed to the successfully completion of this
project.

I would like to express my gratitude to other faculty members


of our college, for providing academic input, guidance &
encouragement throughout this period.

I would like to express a deep sense of gratitude and thank


Mr. KK Agarwal, without whose permission, wise counsel and
able guidance, it would have not been possible to make the
project in this manner.
PREFACE

In today’s competitive world, computers have assumed their


critical importance in every field. It has been become an
essential qualification for almost all ventures.
In my diploma of computer science, I have been prepared to
be a part of the industrial requirements. But theoretical
knowledge is not just enough in present areas. Theoretical
knowledge accompanied with the practical knows how of the
industrial environment makes me ready for making a good
performance when I entered the industry.
So, the industrial training is a necessary and the project work
undertaken during this training exhibits the practical as well
as the theoretical knowledge of the topic.
As part of my industrial training I undertook a project in
"LINUX” programming at CENTRE OF ELECTRONIC
GOVERNANCE, JAIPUR. While doing this project I learned a
lot and brushed up my earlier knowledge. This training has
provided me an opportunity to have practical knowledge
which has increased my sphere of knowledge to a great
extent.
During my stay here I learned how an actual project progress,
what sort of problems actually occurs during the
development of such project.

INDEX

1. Introduction to Linux
1.1 Kernel
1.2 Linux Kernel
1.3 What is Linux?
1.4 Parts of a Linux OS
1.5 Difference between UNIX and LINUX
1.6 Advantages of Linux over other Operating
Systems
1.7 Popular Linux Distributions
1.8 What is Shell?
1.9 Basic Linux commands

2. Introduction to FTP
2.1 What is FTP?
2.2 What is an FTP Server?
2.3 Features of an FTP server
2.4 Working of FTP
2.5 Popular FTP Softwares
3. Project
3.1 About the project
3.2 Making a local FTP server in CentOS using vsftpd
3.2.1 vsftpd - FTP Server Installation
3.2.2 Anonymous FTP Configuration
3.3.3 User Authenticated FTP Configuration
3.3 Accessing the FTP server
KERNEL

 The kernel is the central module of an operating system


(OS). It is the part of the operating system that loads first, and
it remains in main memory.
 Because it stays in memory, it is important for the kernel to
be as small as possible while still providing all the essential
services required by other parts of the operating system and
applications.
 The kernel code is usually loaded into a protected area of
memory to prevent it from being overwritten by programs or
other parts of the operating system.
 Typically, the kernel is responsible for memory management,
process and task management, and disk management.
 The kernel connects the system hardware to the application
software. Every operating system has a kernel
 For example the Linux kernel is used numerous operating
systems including Linux, FreeBSD, Android and others.
LINUX KERNEL

 The Linux kernel is a free and open-source, monolithic, Unix-


like operating system kernel.
 The Linux family of operating systems is based on this kernel
and deployed on both traditional computer systems such as
personal computers and servers, usually in the form of Linux
distributions, and on various embedded devices such as
routers, wireless access points, set-top boxes, FTA receivers,
smart TVs, and NAS appliances.
 While the adoption of the Linux kernel in desktop computer
operating system is low, Linux-based operating systems
dominate nearly every other segment of computing, from
mobile devices to mainframes.
 As of November 2017, all of the world's 500 most powerful
supercomputers run Linux.
 The Android operating system for tablet computers,
smartphones, and smart watches also uses the Linux kernel.
WHAT IS LINUX?
Tux, the penguin
Mascot of linux

 Linux is a family of open source Unix-like operating systems


based on the Linux kernel, an operating system kernel first
released on September 17, 1991 by Linus Torvalds.
 Linux is typically packaged in a Linux distribution.
 Distributions include the Linux kernel and supporting system
software and libraries.
 Linux was originally developed for personal computers based
on the Intel x86 architecture, but has since been ported to
more platforms than any other operating system.
 Just like Windows, iOS, and Mac OS, Linux is an operating
system. In fact, one of the most popular platforms on the
planet, Android, is powered by the Linux operating system.
Parts of a Linux OS

 The Linux operating system comprises several different


pieces:
 Bootloader – The software that manages the boot process of
your computer. For most users, this will simply be a splash
screen that pops up and eventually goes away to boot into
the operating system.
 Kernel – This is the one piece of the whole that is actually
called Linux. The kernel is the core of the system and
manages the CPU, memory, and peripheral devices. The
kernel is the lowest level of the OS.
 Init system – This is a sub-system that bootstraps the user
space and is charged with controlling daemons. One of the
most widely used init systems is systemd? which also
happens to be one of the most controversial. It is the init
system that manages the boot process, once the initial
booting is handed over from the bootloader (i.e., GRUB or
GRand Unified Bootloader).
 Daemons – These are background services (printing, sound,
scheduling, etc.) that either start up during boot or after you
log into the desktop.
 Graphical server – This is the sub-system that displays the
graphics on your monitor. It is commonly referred to as the X
server or just X.
 Desktop environment – This is the piece that the users
actually interact with. There are many desktop environments
to choose from (GNOME, Cinnamon, Mate, Pantheon,
Enlightenment, KDE, Xfce, etc.). Each desktop environment
includes built-in applications (such as file managers,
configuration tools, web browsers, and games).
 Applications – Desktop environments do not offer the full
array of apps. Just like Windows and macOS, Linux offers
thousands upon thousands of high-quality software titles that
can be easily found and installed. Most modern Linux
distributions (more on this below) include App Store-like
tools that centralize and simplify application installation. For
example, Ubuntu Linux has the Ubuntu Software Center (a
rebrand of GNOME Software? Figure 1) which allows you to
quickly search among the thousands of apps and install them
from one centralized location.
Difference between Unix and Linux?

 You may have heard of Unix, which is an operating system


developed in the 1970s at Bell Labs by Ken Thompson, Dennis
Ritchie, and others.
 Unix and Linux are similar in many ways, and in fact, Linux
was originally created to be similar to Unix.
 Both have similar tools for interfacing with the systems,
programming tools, filesystem layouts, and other key
components.
 However, Unix is not free. Over the years, a number of
different operating systems have been created that
attempted to be “unix-like” or “unix-compatible,” but Linux
has been the most successful, far surpassing its predecessors
in popularity.
Advantages of Linux over other Operating
Systems

 Open source: Linux is an Open source operating systems. You


can easily get the source code for linux and edit it to develop
your personal operating system. Today, Linux is widely used
for both basic home and office uses.
 Low cost : There is no need to spend time and huge amount
money to obtain licenses since Linux and much of it's
software come with the GNU General Public License. There is
no need to worry about any software's that you use in Linux.
 Stability : Linux has high stability compared with other
operating systems. There is no need to reboot the Linux
system to maintain performance levels. Rarely it freeze up or
slow down. It has a continuous up-times of hundreds of days
or more.
 Performance : Linux provides high performance on various
networks. It has the ability to handle large numbers of users
simultaneously.
 Flexibility : Linux is very flexible. Linux can be used for high
performance server applications, desktop applications, and
embedded systems. You can install only the needed
components for a particular use. You can also restrict the use
of specific computers.
 Compatibility : It runs all common Unix software packages
and can process all common file formats.
 Security : Linux is one of the most secure operating systems.
File ownership and permissions make linux more secure.
 Networking : Linux provides a strong support for network
functionality; client and server systems can be easily set up
on any computer running Linux. It can perform tasks like
network backup more faster than other operating systems.
Popular Linux Distributions

These are some the most popular


Linux Distros:
1. Elementary OS
2. Linux Mint
3. Arch Linux
4. Ubuntu
5. Cent OS
6. Fedora
7. RedHat
8. Chalet OS
What is Shell?
 A Shell provides you with an interface to the Unix system.
 It gathers input from you and executes programs based on
that input. When a program finishes executing, it displays
that program's output.
 Shell is an environment in which we can run our commands,
programs, and shell scripts.
 There are different flavors of a shell, just as there are
different flavors of operating systems. Each flavor of shell has
its own set of recognized commands and functions.
Basic Linux Commands

 pwd — When you first open the terminal, you are in the
home directory of your user. To know which directory you are
in, you can use the “pwd” command. It gives us the absolute
path, which means the path that starts from the root. The
root is the base of the Linux file system. It is denoted by a
forward slash( / ). The user directory is usually something like
"/home/username".
 ls — Use the "ls" command to know what files are in the
directory you are in. You can see all the hidden files by using
the command “ls -a”.
 cd — Use the "cd" command to go to a directory.
 mkdir & rmdir — Use the mkdir command when you need to
create a folder or a directory.
 rm - Use the rm command to delete files and directories. Use
"rm -r" to delete just the directory. It deletes both the folder
and the files it contains when using only the rm command.
 touch — The touch command is used to create a file. It can
be anything, from an empty txt file to an empty zip file. For
example, “touch new.txt”.
 man & --help — To know more about a command and how to
use it, use the man command. It shows the manual pages of
the command. For example, “man cd” shows the manual
pages of the cd command. Typing in the command name and
the argument helps it show which ways the command can be
used (e.g., cd –help).
 cp — Use the cp command to copy files through the
command line. It takes two arguments: The first is the
location of the file to be copied, the second is where to copy.
 mv — Use the mv command to move files through the
command line. We can also use the mv command to rename
a file. For example, if we want to rename the file “text” to
“new”, we can use “mv text new”. It takes the two
arguments, just like the cp command.
 locate — The locate command is used to locate a file in a
Linux system, just like the search command in Windows. This
command is useful when you don't know where a file is saved
or the actual name of the file. Using the -i argument with the
command helps to ignore the case (it doesn't matter if it is
uppercase or lowercase).
 echo — The "echo" command helps us move some data,
usually text into a file.
 cat — Use the cat command to display the contents of a file.
It is usually used to easily view programs.
 nano, vi — nano and vi are already installed text editors in
the Linux command line. The nano command is a good text
editor that denotes keywords with color and can recognize
most languages. And vi is simpler than nano. You can create a
new file or modify a file using this editor.
 sudo — A widely used command in the Linux command line,
sudo stands for "SuperUser Do". So, if you want any
command to be done with administrative or root privileges,
you can use the sudo command.
 df — Use the df command to see the available disk space in
each of the partitions in your system. You can just type in df
in the command line and you can see each mounted partition
and their used/available space in % and in KBs. If you want it
shown in megabytes, you can use the command “df -m”.
 du — Use du to know the disk usage of a file in your system.
If you want to know the disk usage for a particular folder or
file in Linux, you can type in the command df and the name of
the folder or file.
 apt-get — Use apt to work with packages in the Linux
command line. Use apt-get to install packages. This requires
root privileges, so use the sudo command with it.
 chmod — Use chmod to make a file executable and to change
the permissions granted to it in Linux.
 hostname — Use hostname to know your name in your host
or network. Basically, it displays your hostname and IP
address. Just typing “hostname” gives the output. Typing in
“hostname -I” gives you your IP address in your network.
What is FTP?
 FTP stands for File Transfer Protocol.
 A protocol is a system of rules that networked computers use
to communicate with one another.
 FTP is a client-server protocol that may be used to transfer
files between computers on the internet.
 The client asks for the files and the server provides them.
 You can work with FTP using a simple command-line
interface, such as the DOS console in Windows and Terminal
in Linux and macOS.
 If you don’t want to use those, though, there are graphical
user interface solutions, such as Filezilla or WS FTP Pro.
 You can exchange any kind of file, including music, videos and
documents. If it’s a single file, you might even get it faster
than you would with HTTP, unless the server is far away.
What is an FTP Server?

 An FTP Server (which stands for File Transfer Protocol


Server) is a software application which enables the
transfer of files from one computer to another.
 FTP is a way to transfer files to any computer in the
world that is connected to the internet.
 FTP servers, and the more secure SFTP Server software,
perform 2 basic tasks: “Put” and “Get.”
 You can put files on the FTP Server or get files from the
FTP Server.
Features of an FTP server

 In order for the client to establish connection to the FTP


server, the username and password are sent over using USER
and PASS commands. Once accepted by the FTP server, an
acknowledgement is sent across to the client and the session
can start.
 In the case of an FTP connection, it is possible to resume the
download if it was not successfully completed earlier. In other
words, checkpoint restart support is provided.
 The FTP server allows the downloading and uploading files.
There could be access restrictions as determined by the FTP
server administrator for downloading different files and from
different folders residing in the FTP server.
 The FTP server can provide connection to users without need
of login credentials; however, the FTP server can authorize
these to have only limited access.
 Files residing in FTP servers can be retrieved by common web
browsers, but they may not be supporting protocol
extensions like FTPS.
 FTP servers can provide anonymous access. This access allows
users to download files from the servers anonymously, but
prohibits uploading files to FTP servers.
 All file transfer protocol site addresses begin with
ftp://192.168.43.100
Working of FTP

 FTP follows client-server program where FTP client is on


one side and FTP server is on another side.
 In this scenario the client is going to open the
connection with the server.
 The interaction between FTP client and FTP server is
based on the TCP/IP protocol of transport layer protocol
to make it reliable.
 Files are exchanged over the internet using FTP
protocol.
 This protocol is secured with an SSL.
 FTP client machine is also called as Local machine which
is connected to the server machine.
 The local machine or FTP Client can download a file
from the FTP server or upload a file from the FTP Client
to the FTP Server.
Popular FTP Softwares

For Windows:
 FileZilla Server
 Xlight FTP Server
 Complete FTP
 Cross FTP
For Linux:
 FileZilla Server
 vsftpd
 proFTPD
 Cross FTP
About the project

We basically made a FTP server on an Ubuntu


virtual machine using vsftpd.
The software used for making virtual machine is
VMWare Workstation Pro.
You can access the FTP server from anywhere in
the local network using an IP address.
The IP address for the FTP server starts with ftp://
Access to an FTP server can be managed in two
ways: Anonymous and Authenticated.
We used the Anonymous method to access the FTP
server.
By using anonymous method, anyone can access
the FTP server without a username and password.
Making a local FTP server in UBUNTU
using vsftpd

 FTP works on a client/server model.


 The server component is called an FTP
daemon. It continuously listens for FTP
requests from remote clients.
 When a request is received, it manages the
login and sets up the connection. For the
duration of the session it executes any of
commands sent by the FTP client.

Access to an FTP server can be managed in two


ways:
 Anonymous
 Authenticated
vsftpd - FTP Server Installation

 vsftpd is an FTP daemon available in Ubuntu. It


is easy to install, set up, and maintain. To install
vsftpd you can run the following command:
Anonymous FTP Configuration

 By default vsftpd is not configured to allow anonymous


download. If you wish to enable anonymous download edit
/etc/vsftpd.conf by changing:

 During installation a ftp user is created with a home directory


of /srv/ftp. This is the default FTP directory.
 If you wish to change this location, to /srv/files/ftp for
example, simply create a directory in another location and
change the ftp user's home directory:

 After making the change restart vsftpd:

 Finally, copy any files and directories you would like to make
available through anonymous FTP to /srv/files/ftp, or /srv/ftp
if you wish to use the default.
User Authenticated FTP Configuration
 By default vsftpd is configured to authenticate system users
and allow them to download files. If you want users to be
able to upload files, edit /etc/vsftpd.conf:

 Now restart vsftpd:

 Now when system users login to FTP they will start in their
home directories where they can download, upload, create
directories, etc.
 Similarly, by default, anonymous users are not allowed to
upload files to FTP server. To change this setting, you should
uncomment the following line, and restart vsftpd:
Accessing the FTP server

 The FTP server can be easily accessed by any


computer which is present on the network.
 To access the FTP server just enter the ftp:// in
the browser followed by the IP address of the
machine hosting the server.
 For example: ftp://192.168.29.1

Das könnte Ihnen auch gefallen