39
Linux System Administratio n Prepared by Prepared by : Chhun Vanna : Chhun Vanna Tel Tel : (855)17 747 878 : (855)17 747 878 Email Email : [email protected] : [email protected]

Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: [email protected]

Embed Size (px)

Citation preview

Page 1: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

Linux System

AdministrationPrepared byPrepared by : Chhun Vanna: Chhun Vanna

Tel Tel : (855)17 747 878: (855)17 747 878

EmailEmail : : [email protected]@gmail.com

Page 2: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

2

Objectives

In this lesson, you will learn to:

• What is Open Source?

• Why Open Source?

• Why Open Source is so hot today?

• How Open Source Software is developed?

• Open Source vs. Commercial Software

• Define operating systems

• Identify the functions of an operating system

• Trace the history of the Linux operating system

• Identify the components of Linux architecture

• Log on and log out from a Linux session

Page 3: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

What is Open Source?3

1) Open source refers to any program whose • source code is made available for use

or modification as users or other developers see fit.

• software is usually developed as a public collaboration and made freely available.

Page 4: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

What is Open Source? (Cont’)4

2) Open Source is a certification mark owned by the Open Source Initiative (OSI). Developers of software that is intended to be freely shared and possibly improved and redistributed by others can use the Open Source trademark if their distribution terms conform to the OSI's Open Source Definition.

Page 5: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

What is Open Source? (Cont’)5

To summarize, the Definition model of distribution terms require that: •The software being distributed must be redistributed to anyone else without any restriction.•The source code must be made available (so that the receiving party will be able to improve or modify it).•The license can require improved versions of the software to carry a different name or version from the original software.•The idea is very similar to that behind free software and the copyleft concept of the Free Software Foundation.

Page 6: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

Why Open Source?6

All software has source code. Open source software grants every user access to that code. Freedom means choice. Choice means power.

That's why we believe open source is inevitable. It returns control to the customer. You can see the code, change it, learn from it. Bugs are found and fixed quickly. And when customers are unhappy with one vendor, they can choose another without overhauling their entire infrastructure. No more technology lock-in. No more monopolies.

Page 7: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

Why Open Source?(Cont’)

7

We believe open source simply creates better software. Everyone collaborates, the best technology wins. Not just within one company, but among an Internet-connected, worldwide community. New ideas and code travel the world in an instant.

As a result, the open source model often builds higher quality, more secure, more easily integrated software. And it does it at a vastly accelerated pace and often at a lower cost.

Page 8: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

Why Open Source is hot now?8

          

With the deepening of the credit crisis, melt down in the financial industry, the IT budgets in the big companies is under squeeze.

Companies are looking at optimizing their IT budgets and seriously looking at Return on their investments. The commercial software license costs; be in hardware, operating system, infrastructure, database, commercial applications and consulting & support, is being reviewed and seriously considered for optimizing and cost cutting.

Page 9: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

Why Open Source is hot now? (Cont’)9

Open source software and solutions have a great opportunity to survive and benefit in this economy as they provide better returns for the companies that are looking to save huge licensing costs and greater availability of solutions and software that can be easily adopted.

Page 10: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

How Open Source Software Is Developed10

For those new to the idea of open source or unfamiliar with the way software gets developed, here's how it works most of the time:•One or more developers--meaning people who have the skills to create software--get an idea about creating software to solve a problem.•The developers start writing code to create a solution. This is frequently called "scratching an itch."

Page 11: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

How Open Source Software Is Developed (Cont’)

11

• The developers put this code where other developers can find out about it, download it, and play with it. There are many locations, such as SourceForge.com, where people post their projects.

• Usually the source code is published under one of several popular open source licenses that ensure that the source code and any derivative works remain open source.

• Through an informal process of sharing ideas, fiddling with each others' code, and trial and error, the software gets better and better, sometimes changing direction to solve new problems as new people discover the software

Page 12: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

How Open Source Software Is Developed (Cont’)

12

At some point, the software gets finished or doesn't. It becomes popular, stays obscure, or fades away. Programs like Linux and Apache have had thousands of contributors. Other projects have been created by one or two people.As time goes on, developers come and go, and projects become active or dormant

Page 13: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

Open Source vs. Commercial Software13

The most important difference between software created by the open source communities and commercial software sold by vendors is that• open source software is published under licenses that ensure that the source code is available to everyone to inspect, change, download, and explore as they wish.•More precise definitions extend this basic concept by adding provisions concerning derivative works, the rights to use the software for any purpose, the rights of the original author, and prohibitions against discrimination.

Page 14: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

Open Source vs. Commercial Software (Cont’)

14(Open Source)

Page 15: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

15

Operating Systems

• Operating system is a software program that manages the computer hardware, system resources, memory, and interaction between the system and its users.

• Some popular operating systems are:

•Linux

•Unix-Solaris, SCO and Irix

•Microsoft DOS

•Microsoft Windows 95

•Microsoft Windows 98

•Microsoft Windows NT Server 4.0

•Microsoft Windows 2000 Server

•Microsoft Windows Server 2003

Introduction to OS

Page 16: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

16

• The functions of an operating system are:

•Translates a command keyed in by a user to binary code for the CPU to understand the command

•Handles requests for memory from various applications running on the system

•Handles communication between the devices and the CPU

•Rations out the CPU time enabling programs to run concurrently

Functions of an Operating System

Page 17: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

Single-User System

•A single user system is a small, general-purpose system, used by one person at a time such as a personal computer (PC).

•The example of a single-user operating system is MS DOS.

Multi-User System

A multi-user system can run multiple programs concurrently, share multiple resources such as printers and disks, and support multiple users working simultaneously on a system.

The examples of multi-user operating systems are:

• Linux

• Unix

• Windows NT Terminal Server

• Windows 2000 Terminal Server

• Windows 2003 Terminal Server

17

Types of Systems

Page 18: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

18

A multi-user system:

• Is a computer with several terminals attached to it

• Can consist of one CPU with high processing power

• Can have multiple CPUs to process multiple applications simultaneously

• Supports multi-programming and multi-tasking

• Has higher capacity hard disk to store large amount of data

Types of Systems (Cont')

Page 19: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

19

There are two types of terminals: Dumb terminal Smart terminal

A terminal is an interface that accepts commands from users and sends them to the server for execution.

A server is a computer that executes the requests sent by the client computers attached to it.

Types of Systems (Cont')

Page 20: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

20

• In 1965, Bell Labs and Massachusetts Institute of Technology (MIT) along with General Electric developed one of the first multi-user computer systems called Multiplexed Information and Computing Service (Multics).

• Around 1969 Ken Thompson and Dennis Ritchie, two Bell Labs engineers developed Uniplexed Information and Computing Service (Unics), which was later changed to Unix.

• In 1973, Ken Thompson and Dennis Ritchie re-wrote Unix using the C programming language.

History of Unix

Page 21: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

21

In 1983, an MIT scientist, Richard M. Stallman, launched the GNU’s not Unix (GNU) project to create Unix-like operating system but free from licensing charges.

To organize the work on the GNU project, Stallman and other people created the Free Software Foundation (FSF).

FSF developed the General Public License (GPL) to build a body of free software protected from those who would use it to create proprietary closed-source systems.

History of Unix (Cont’)

Page 22: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

22

• In 1991, Linus Torvalds, a student, while working on Minix wrote the source code for the kernel, and named it Linux.

• Torvalds made the Linux kernel available on the Internet.

• The Linux kernel was combined with the GNU system resulting in a complete operating system called GNU/Linux because it was a combination of the GNU system and Linux as the kernel.

• Linux follows the open development model which means that the current development version of Linux is always open to everybody.

• Tux, the Linux penguin, is the official mascot.

Evolution of Linux

Page 23: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

The features of Linux are:• Multi-programming• Time-sharing• Multi-tasking• Virtual memory• Shared Libraries• POSIX-Compliance• Samba• Network Information System

(NIS)• Cron Scheduler• Office Suites• Data archiving utilities• Licensing• Web server

The advantages of Linux are:• Reliability• Backward compatibility• Simple upgrade and

installation process• Low total cost of ownership• Support for legacy devices • GUI interface• Multiple distributors• Excellent security features• Support for high user load• Support for development

libraries

23

Features and Advantages of Linux

Page 24: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

24

Components of Linux operating system

Linux Architecture

Page 25: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

25

The kernel is the heart of the operating system. It manages communication with hardware, decides which processes to run, and provides each process with an isolated, virtual address space in which to run. The kernel loads device driver modules. It also allocates hardware resources such as IRQ ports, I/O addresses, and DMA channels.

Summary: The kernel are

• Is the core of Linux operating system program

• Controls the resources of the computer

• Interacts directly with the hardware

Linux Architecture (Cont’)

Page 26: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

26

The shell: Is a user interface providing services that

a user wantsProtects the user from knowing the

intricate hardware details Linux utilities and application

programs: Are a collection of programs that service

day-to-day processing requirementsAre invoked through the shell

Linux Architecture (Cont’)

Page 27: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

27

• Linux was developed keeping Unix as a reference model and continue to have the same basic architecture and features.

• Linux and Unix operating systems differ in:

• Hard disk space requirement

• Availability of shells

• Distributions or variants

• Licensing

Comparing Linux with Unix

Page 28: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

28

• All the distributors use the Linux kernel.

• The distributors add their own utilities and applications and sell these as a customized package.

• The following are the popular distributors of Linux:

• Red Hat and its variations, such as Linux ES, Linux AS, Linux WS, Desktop, and Fedora Core

• Mandrake

• Debian

• SuSE

• Slackware

Distributors of Linux

Page 29: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

29

After you boot the Linux system, the following prompt appears:

Fedora Core release 2 (Tettnang)

Kernel 2.6.5-1.358 on an i686

linuxpc1 login: _

• At the login prompt, you can enter your login name and password: linuxpc1 login: tom

Password: [user enters password here]

• After successful login, you will see the following prompt on the screen:[tom@linuxpc1 tom]$ _

Starting a Linux Session

Page 30: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

30

• You can connect to a Linux server from any computer that has operating systems, such as Windows 9x and Windows NT or 2000, using the following utilities:

• Telnet: You can launch Telnet from the command line by typing the following command:telnet 172.17.55.242

• PuTTY: Is a third-party program.

• Allows you to make ssh (Secure SHell) connections from the computer that has Windows operating system

• Runs as an executable application that does not need to be installed on your computer

Connecting to the Linux Server Remotely

Page 31: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

31

Security for the Linux User: PasswordsLinux ensures that only authorized users can access the system.

• Linux allows you to have a password associated with your login name as an additional measure of security.

• The Linux prompt appears only if you have entered both the user name and the password correctly, otherwise you are asked to re-enter the user name followed by the password.

• Passwords are not displayed on the screen while they are being entered.

• A user can change the password using the passwd command.

• The syntax to use the passwd command is:[steve@linuxpc1 steve]$ passwd

Connecting to the Linux Server Remotely

Page 32: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

32

Ending a Linux Session

• Typing exit or logout at the shell prompt ends your current Linux session.

• The system then displays the login: prompt on the screen to initiate another login session in Linux.

Connecting to the Linux Server Remotely

Page 33: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

33

The Linux File System

Page 34: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

The Linux File System (Cont’)34

• Linux follows the Unix file system which is a hierarchical, inverted-tree like structure.

• All the files are stored on the disk under / (root) directory.

• The directory, /, contains following directories:• /bin: Stores commands available under the Linux system • /dev: Stores all the device-related files for the system• /etc: Stores the system-related data that the users and

the system need to refer to, such as the passwd file • /lib: Contains libraries of data for the compilers installed

on the system, such as the C language routines• /home: Contains all the home directories of users• /usr: Stores the operating systems files not involved in

the boot process • /var: Stores information specific to different utilities of

Linux

Page 35: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

35

• Linux takes the path name as absolute or relative.

• When the path name starts with a character, it is taken as the relative path name with respect to the current working directory.

• When the path name starts with ‘/’, it is taken as the absolute path name.

• To access the file, September 2004, under the /home/steve/baseball directory, Steve can specify the absolute path as /home/steve/baseball/September 2004.

• Alternatively, Steve can specify the relative path, baseball/September 2004.

• Relative path is a more convenient way to specify path names.

Relative & Absolute Path Names

Page 36: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

36

• The filenames in Linux:

•Can be up to 256 characters long

•Can contain special characters, except for ‘/’

•Can contain both upper-case and lower-case alphabets

•Are case-sensitive

•Should not have a blank or a tab

File Naming Conventions

Page 37: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

37

• All information, including devices, is treated as a file in Linux.

• There are three categories of files:

•Ordinary files: Are created by a user and include all the data files, program files, object files, and executable files.

•Directory files: Are created automatically as a directory is created and contains information about the files under the directory.

Types of Files in Linux

Page 38: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

Types of Files in Linux38

Special files: Are associated with input/output devices and are found in the standard Linux directories, such as /dev and /etc. Linux supports the following types of special files:

Character device files: Read and write data one character at a time.

Block device files: Access a block of data at a time. Hard links: Allow a single file to have multiple

names. Symbolic links: Allow a single file to have multiple

names across different file systems.

Page 39: Linux System Administration Prepared by: Chhun Vanna Tel : (855)17 747 878 Email: chhvanna@gmail.com

39

• The following are the user types supported by Linux:

• System administrator: Is responsible for the smooth operation of the system including tasks, such as create users and groups and make backups.

• File owner: Is a user who creates a file and can perform any operation on the file, such as copying, deleting, and editing.

• Group owner: Is a user belonging to a group who can share and access the files.

• Other users: Are users who do not belong to a particular group.

Types of Users in Linux