Sunteți pe pagina 1din 166

RED HAT SYSTEM ADMINISTRATOR I

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Red Hat System Administrator I

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Unit One GNOME DESKTOP

Gnome gedit

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

GNOME

GNOME is default graphical environment Lets you use your mouse and keyboard Includes integrated apps

Nautilus File Manager Gedit Te t Editor and many more!!!

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

GNOME

"anel #pplet $ork %pace


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

GNOME
%&itch &orkspace &ith keyboard ctrl ' alt ' ( Left #rro& ) *ight #rro&+ or

%&itch $ork %pace


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

GNOME

Linu is kno&s for it,s -ommand Line $hy graphical Environment .


%ome things are easier /seful to understand differences %upport users as %ysadmin

The command line is very important

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

"ass&ord

*egular /ser *e0uirements1


Must have 2 chars Must not be based on dictionary &ord Must be comple 3-hars4 -aps4 Nums5

/ser root may set any pass&ord


To himself #ny other user

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

"ass&ord

-hange "ass&ord /sing G/I

Or 6 pass&d in 7ash
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Te t -onfiguration Files

Linu !asi" desi#n $rin"i$le


Easier for humans %imple editor can fi problems Most programs use te t configuration files

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

gedit

Graphical tool for editing te t files

-ommand Line Editors1


vi vim nano
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Unit T%o MANAGE &ILES

Nautilus *emote %torage

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Nautilus

Gnome file manager


E plore file8system 9ie& file properties Manipulate files

-opy4 :elete4 Move4-ut4 "aste!!

#pplications ; %ystem Tools ; File 7roser

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Nautilus

:efault vie&1 %patial mode


Open folders in ne% %indo%s May be changed to 7ro&ser Mode

%ystem ; "references ; File Managment

7ehavior ; #l&ays Open In 7ro&ser $indo&s

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Nautilus

#llo&s access to remote systems


FT" $indo&s %hares %%< 3remote login5 NF% 3Net&ork File8system5

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Nautilus

Nautilus tips1

List 9ie& ( 9ie& ; List ) -T*L ' = + <idden Files


Name begins &ith 3!5 period 9ie& ; %ho& <idden Files %ame "artition1 Move :ifferent "artition1 -opy

:rag and :rop


-ommand Line1 ls3List54 mv3Move54cp3-opy54 mkdir


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Nautilus

Nfs shares &ith autofs in >net>host Written by Arthur Berezin 054-2266463


Arthur@Berezins.com

/nit Three GETTING <EL"

Local :ocumentation On8Line *ed <at :ocumentation Getting most from %upport

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Local :ocumentation

Man pages

Most commonly used :ocumenting commands and configuration files :ecided into chapters <yperte t books For desktop environment <yperte t books
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

GN/ Info

Gnome help system


Gnome <elp 7ro&ser

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

GN/ Info

To access open GNOME help bro&ser


Go to ; GN/ Info "ages %earch info1(node name+

For e ample info1G*/7

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Man pages

On GNOME help 7re&ser

%earch man1man8page

%ame items on different pages can appear %pecify chapter

Man1pass&d3?5

-ommand Line1 man4 info More documentation in >usr>share>doc


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

On8Line *ed <at :ocumentation

:ocumentation

<ttp1>>access!redhat!com>docs

*elease notes Installation Guide Migration "laning Guide :eployment Guide

-ustomer "ortal

7unch of info @no&ledge8base


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Getting most from %upport


:efine the problem4 ho& to reproduce. :o your home&ork


:ocumentation k!bases %oft&are versions %osreprot collects logs and conf! files
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

7ackground info

:iagnostics Info

/nit Four LO-#L %E*9I-E%

The root /ser %ystem -lock "rint Aueue "rint Bobs

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*ole of user1 root


/ser root is the superuser <as all po&er over the system <as po&er to override normal privileges install4 remove4 soft&are4 Manage configuration Most devices controlled by root

E eption1 /%7

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*ole of user1 root

C$ith Great "o&er -omes Great *esponsibilityD %tan Lee

/nlimited po&er to damage the system

$e &ill use normal user4 and gain po&er &hen needed


-ommand1 su substitute user -ommand1 sudo e ecute command as another user


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

%ystem -lock

Net&ork Time "rotocol 3NT"5


Time synchroniEation "rotocol Makes the seconds shorter if it rushes *educes time differences bet&een systems *ecomended to have at least three NT" servers

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

%ystem -lock

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

"rinters

-ommon /ni "riniting %ystem 3-/"%5 Locally or net&ork %upports I""4 L":3Linu "rinter :aemon5 and Microsoft %hared "rinters

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

"rinters

Each printer has one or more 0ueues "rint Fob is sent to a 0ueue %ystem #dministrator sets a printer %ystem ; #dministration ; "rinting $eb interface T-" port 2GH

<ttp1>>localhost12GH <ttp1>>localhost12GH>help

Man1 man system8config8printer3H5


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit Five 7#%<

7ash %ynta /sing 7ash Launching graphical commands as root

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Introduction to 7ash

%hell -ommand Line Interface 7ash I *ed <at :efault %hell 7ash I Cbourne again shellD Improved version of old uni bourne shell3sh5 Looks like &indo&s cmd!e e

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/sing -ommand Line


#pplication ; system tools ; Terminal right click on the desktop ; Open Terminal "rompt line

-urrent user %hort hostname :irectory ' for normal user ( for superuser
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/sing -ommand Line

-ommand line usually have three basic parts


)ommand O$tions

One dash for short 38a5 or t&o for full option name 388all5

Ar#uments 6 df 8h >home 88help for synta


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/sing -ommand Line

-onventions

(+ !!! ) J;

is optional is N times choose any of the options variable :ata


JFILEN#ME; for e ample

Man is your friend4 man bash

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/sing 7ash

6pass&d 6 id 6 su ( 8 + username

8c for single command 3similar to *un #s!5

6 e it

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/seful Features

Tab -ompletion

#llo&s 0uickly complete commands

<istory

KJ;

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Launching Graphical Tools from bash

-ommand L -T*L ' c -ancel -T*L ' E 7ackground 6 Fobs I running commands 6 fg 8 bring to front ground
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit %i M#N#GE %TO*#GE I

"- %torage Model :etermine :isk /sage Manage 9irtual Guests -reate a Ne& File %ystem

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

"artitions

<ard disks are split into partitions 3I7M5 Each partitions has a file system Each partitions can be used for a different purpose

E ample1 home partition4 system partition

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Master 7oot *ecord

*<EL3*ed <at Enterprise Linu 5 and $indo&s use Master 7oor *ecord partitioning system This backs to I7M "- 3early MN,s5

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Master 7oot *ecord

M7* is the first %ector of the <ard :isk 3?H= bytes5


First OO2 is part of the *oot Loader Last 2O is the Partition Ta!le

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

"artition Table

<as room for O primary partitions

-ontains info on each partition


first sector Last sector -ode that indicates information type3fs4 lvm!!5

If more needed one is used as e tended partition

:ivided into logical partitions


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

:isk /tility

Graphical utility to easily manage disk partitions List available devices4 :isk "artitions4 Info #llo&s to re8partition the disk #pplication ; %ystem Tools ; :isk /tility

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

:isk /tility

#llo&s to create ne& partitions "artitions must be formated %tandard system uses EPTO filesystem To use filesystem &e need to mount it
Mount +t ,-ilesystem ty$e. ,de/i"e. ,Mount Point.

Mount point I empty directory $hen mounted the filesystem can be vie& as content of the directory

This is called CMounting file8system on mount8pointD

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

>etc>-sta!

Te t file lists all mounted partitions on boot -an be edited only by root E ample line1

>dev>sda2

>data>

e tO

defaults

H =

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit %even M#N#GE LOGI-#L 9OL/ME%


L9M -oncept :isplay L9M /sage :eploy L9M E tending L9M %torage E tending File8system on L9M *emove a disk form L9M

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Logical 9olume Management


# fle ible &ay to manage disk space :isk "artitions are pooled together4 then divided into Logical 9olumes This allo&s 1

creating file8system larger then physical disks :ividing the disk to unlimited amount E tend file8systems &ithout re8formatting

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Logical 9olume Management

P0ysi"al 1olume2P13 "hysical partition marked &ith L9M type 1olume Grou$21G3 -ollection of one or more "vs39irtual :isk :rive5 Lo#i"al 1olume 2L13 virtual partition &ithin the 9G4 formatted &ith filesystem! P0ysi"al E tent chunk siEe from &hich L9M is built
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

E tending a 9olume Group


9Gs can be e tended by adding additional "9s #dditional 9G can be on same disk or on another disks Or e tending e isting L9s

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

E tending a Logical 9olume


-an be e tended &ith free e tents File8system must be e tended after e tending Logical 9olume

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*emoving "hysical 9olume


/sually done to replace to ne&er>larger disks :ata from "9 can be migrated to another "9 This can be done &ithout disturbing L9M

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit Eight MONITO* %Q%TEM *E%O/*-E%

"rocess4 "riorities and %ignals %ystem Monitor "rocess Management :isk /sage #nalyEer

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

"rocesses

"rocess is running "rogram @ernel keeps track of all process "rocess has

#ddress space memory Threads %ecurity conte t "I:

@ernel tells this info in >proc>J"I:;


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

"rocesses

-hild "rocess 8 $hen a process starts another process -hild prcoess inherits it,s parant characteristics

Environment /ser Group

# child can also have a child $hen the parent dies4 all it,s children die
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

%ignals

The @ernel communicates &ith process thought signals %ignals report events or errors! /sually %ignals result in e iting a process %IGTE*M I terminates a process in a clean manner %IG@ILL I @ills a process immidiately

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

"rocess %cheduling

Only one process can run each time on a core Every process has scheduling priority

*anking system among running processes

Linu process scheduler divides cpu time into slices <igher priority runs first The formula is comple but &e can effect the niceness value
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Niceness

*ange from 8=N to 'HR indicates bonus or penalty Most processes are N nice /sers can only increase niceness *oot can decrease niceness #ll ready processes &ith e0ual nicess &ill share -"/ time e0ually A$$li"ation . System Tooles . System Monitor
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

:isk /sage

:isk /sage #nalyEer is used to analyEe disk space usage # visual tool %ho&s info as bro&sable ring charts A$$li"ation . System Tools . Dis4 Usa#e

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit Nine M#N#GE %Q%TEM %OFT$#*E

%oft&are Inventory *ed <at Net&ork3*<N5 Manage "ackages

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*"M I *ed <at "ackage Manager


%tandard &ay to package soft&are "rovides all needed tools to install4 remove update and manage soft&are Ensures all needed libraries installed #ll soft&are provided by *ed <at is *"M Most vendors provide soft&are to *ed <at Enterprise Linu via *"M "ackages

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*"M 8 *edhat "ackage Manager

*"M is an #rchive contains


#ll %oft&are files -onfiguration Files Information about the program :ependencies I other needed package names 3shares libraries4 supporting soft&are etc,5 Install > /ninstall scripts

# system is a collection of *"Ms "ackages are installed from a repository System . Administration . Add5Remo/e So-t%are
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*ed <at Net&ork3*<N5

centrally managed service for deploying soft&are and updates *emotely manage and monitor systems *<N %atellite is self managed product that can be installed on local server rhnSregister is graphical>te t registration tool

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Install4 *emove4 /pdate "ackages

%ystem ; #dministration ; #dd>*emove %oft&are Individual > package collections %ystem ; administration ; %oft&are /pdate

/pdates itself first

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit ten GET <EL" IN TEPT/#L EN9I*ONMENT


Man reader %earching for key&ords pinfo reader #dditional :ocumentation

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*ead Man :ocumentation

Man is a single !oo4 divided into "0a$ters Each section contains particular type of info

6 User "ommands 7 Kernel system "alls 2entry $oints to t0e 4ernel -rom users$a"e3 8 Li!rary -un"tions 9 S$e"ial -iles and de/i"es : &ile -ormats and "on/entions ; Games < )on/entions= standards and mis"> $a#es ? System administration "ommands @ Linu 4ernel API 2internal 4ernel "alls3

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*ead Man :ocumentation


T&o sections may have same name %ection mentioned in man title

Man 365 pass&d ; title &ould be pass&d365

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Navigation Man "ages

S$a"e Do%nArro% U$Arro% 5strin#

%croll for&ard one screen %croll for&ard one line %croll back one line

%earch for&ard for string in the man page

n *epeat previous search for&ard in the man page N *epeat previous search back&ard in the man page A E it man and return to the prompt %earches use regular e pressions 8 man T rege Man uses ClessD for vie&ing te t
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Man "ages by @ey&ords

%earch for man pages by key&ord

Man 8k pass&d

For sysadmins usually relevant sections are


6 User )ommands : &ile -ormats ? Administration )ommands

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Man "ages by @ey&ords

@ey&ord search is done on a database generates &ith C6 make&hatisD Make&hatis is run automaticlly once an hour -an be e ecuted manually

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

pinfo

GN/ "roFects use the Info system Info pages are books &ith hyperlinks In some cases there,s both man and info 6pinfo has more in8depth documentations

6man tar 6pinfo tar

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

>usr>share>doc

Is everything else that doesn,t appear in man>pinfo <as complete e amples of configuration files %ometimes comes from a separate package

%amba8doc kernel8doc

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit eleven NET$O*@ -ONE-TI9ITQ

IpvO -oncepts Linu Net&ork -onfiguration -onfirming Net&ork Functionality

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Essential Net&ork -oncepts

I"3Internet "rotocol5 sends traffic bet&een hosts across the internet I"vO I G=bit net&ork address I"v2 I H=M bit net&ork address

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Essential Net&ork -oncepts

IpvO normally e pressed as O octets ranging in value from N to =??


PPP!PPP!PPP!PPP

#ddress divided in t&o parts


Net&ork <ost

#ll hosts on same net&ork can talk directly3&ithout a router5 No t&o host on same subnet can have same host part
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Essential Net&ork -oncepts

%ubnet is to kno& &hich part of the I" is the net&ork and &hich is the host The more bit available for host part4 the more hosts can be on the subnet Net&ork #ddress is the first possible E ample

I" HR=!H2M!=NH!H Netmask1 =??!=??!N!N Net&ork HR=!H2M!N!N 7roadcast HR=!H2M!=??!=??


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Essential Net&ork -oncepts

Net&ork mask3netmask5 are e pressed in = &ays1


=O bits 3=??!=??!=??!N5 -I:*3-lass Inter8domain routing5 notation 3M>H2>=O5number of bits that are H <o& many bits of the I" e press the net&ork

7oth have same meaning

H=T!N!N!H &ith =??!N!N!N is localhost


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

I"v2

H=M bit number M colon separated groups *age from NNNN to ffff Net&ork is al&ays first 2O bits3first O colons5 Leading Eeros can be suppressed

1NNdG1 is 1dG1

1NNNN1 is 1N1

11H is localhost 3H=T!N!N!H5

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*outing

Net&ork traffic moves from host to host From net&ork to net&ork Each host has routing table &ith all kno& net&orks If the net&ork is not kno&4 the host for&ards the packet to de-ault #ate%ay

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

:N%

-omputers love to &ork &ith numbers <uman 7eing love to &ork &ith names :omain Name %erver>%ervice>%ystem is distributed net&ork of servers It maps hostnames to I" addresses The host must point to a :N% server :oesn,t have to be on same subnet4 has to be reachable
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Net&orking -ommand Line

6 ifconfig > ip addr sho& 6 ethtool J:E9I-E ; 6 ip route I sho& your routing table 6 host J<O%T N#ME; 8 :N% Lookup 6 nslookup I same as above ( $in# ,IP 5 HOST NAME. test "one"ti/ity )on- -ile 5et"5sys"on-i#5net%or4+s"ri$ts5i-"-#+et0B
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit t&elve /%E*% #N: G*O/"%

-reating :eleting /sers :isabling /ser #ccounts -reating :eleting Groups -hanging Group Memberships Managing "ass&ord #ging

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/sers > Groups #dministration

/ser Manager > system8config8users is the graphical tool for managing users

-reate delete local users and groups #ssign users to groups Lock > unlock accounts "ass&ord aging /ser e piration

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/sers > Groups #dministration

System . Administration . Users and Grou$s

6 useradd>usermod>userdel>groupadd in systems administration II


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit thirteen M#NGE FILE% F*OM -OMM#N:

Linu File system hierarchy #bsolute path names File>directory management *elative path names

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Linu File system hierarchy


In Linu file8systems are organiEed by hierarchy The root of the tree is 5 3called root5 File8systems are mounted on empty directories Each file>directory has absolute path from root %lash3C>D5 is the directory separator

>home>bob>te t!t t is the te t!t t under bob under home in root3>5

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

-ommon "aths

5et" is usually for configuration 5/ar is for regularly changing files 3logs4 etc!!5 -ommands and e ecutable are under

5user5!in 5!in 5usr5s!in 5s!in

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

-ommon "aths

50ome is for home direcotries of users 5root is user root home directory 5tm$ is for temporery data 5media is for removable media 5mnt for manually mounting temp dirs

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

-ommon "aths

In Linu e/eryt0in# is a -ile


5de/ holds files for hard&are devices 5$ro" 9irtual filesystem sho&s kernel data

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

File>directory management

T&o special paths available


U is home of the current user UJuser; is home of user

-omands
6 cd I -hange directory 6 ls I lists files 3usually used CllD &hich is Cls 8lD5 6 p&d I prints absolute current path

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

#bsolute > *elative "aths

#ll files have absolute path


7egins &ith > /ni0ue to every file

%hell keeps track of current directory Files have relative path from your current path $hen using commands in shell Jfilename; arguments can be absolute or relative
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

#bsolute > *elative "aths

#bsolute1

"&d I #bsolute "ath U -urrent user home directory UJ/%E*; /%E* home directory ! !! -urrent directory "arent of current directry

*elative

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

-ommands

-p Jfrom; Jto;8 -opy Ln 8s Jfrom; Jto; 8 %ymbolik Link Mv Jfrom; Jto; Move > *ename *m 8 *emove Touch 8 -reate Empty File Mkdir 8 Make :irectory *mdir 8 *emove :irectory
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

%catter > Gather

/se relative paths &hen files are CcloseD to each other


/se C!!D to point one directory up /se C!!>!!>D to point t&o directories up #nd so on

/se #bsolute paths &hen files are all over the file8system

Ta! )om$letion is you -riend


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

$ilecards

%hell uses V to mach Eero or more matches


rm >tmp>V mv U>Music>*adioheadV >media>usb cp Ureuven>Movies>C>m4/ Uarthur>Movies>

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit fourteen %E-/*E LIN/P FILE #--E%%

/ser>Group>Other Nautilus File %ecurity -ommand Line File %ecuriy

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/ser > Group > Other


#ccess to files is controlled by permissions Linu file permission is simple yet fle ible Files have Fust three categories1 File O%ned by user I the creator usually File #rou$ of the creator 3"rimary group5 #ll ot0ers Most s$e"i-i" $ermission a$$lies
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*ead4 $rite4 E ecute

Bust three permissions apply


r3ead54 %3rite54 3e5 3e cute5

On &ilesD

*ead I vie& file content $rite I Edit the file E ecute I run the file as command *ead I list content of the direcitry $rite I -reate > :elete files in the :irectory E ecute I #ccess the directory 3cd5

On Dire"toriesD

Everything is a files I the directory is too

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*ead4 $rite4 E ecute

*ead only :irectories usually have read and e ecute E e"ute permission on a dire"tory allo&s access files if &e 4no% the name Files can be delete &ith %rite permissions of the dire"tory

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*ead4 $rite4 E ecute

"ermissions changes apply only on files and directories they are set on! Not automatically inherited to sub8directories

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Nautilus "ermissions

*ight click on file>folder "roperties "ermissions

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

"ermissions from -ommand Line


-ommand ls 8l or ll to list permissions -ommand ls 8ld J:I* N#ME; for directory permissions 6 "0mod changes permissions mode

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

-hmod permissions

%ymbolic Method1

6 chmod $hoE0at$hich File ) :irecotry $ho is u4 g4 o4 a 3/ser4 Group4 Other4 all5 $hat is '4 8 4W 3#dd4 *emove4 %et5 $hich is r4 &4

3*ead4 $rite4 E ecute5

E ample1 chmod u'& somefile

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

-hmod permissions

Numeric Method chmod 666 File ) :irectory Each digit represents an access level1

/ser4 Group4 Other *WO4 $W=4 P WH %o T is r& #nd ? is r !!


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

6 is sum of

-hange O&nership

-ommand "0o%n cho&n J/%E*; JFILE):I*E-OT*Q; Option 8* changes o&ner recursively 3#ll sub8 directories5 Only root can change o&ner

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

-hange Group

-ommand "0#r$ chgrp JG*O/"; JFILE):I*E-TO*Q; Group can be set by root and file o&ner Non8root can grant access to groups they belong to!

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

%pecial "ermissions

%et /ser I: 3setuid5 and set Group I: 3set#id5 on e e"uta!le runs process as o&ner4 not file e ecuter

6 ls 8l >usr>bin>pass&d

Sti"4y *it on dire"otry allo&s only the o&ner of the file to delete a file even than others have permissions on the direcotry

6 ls 8ld >tmp

set#id on dire"tory makes ne& files &ithin the directory in0erit #rou$ from the containing directory Written by Arthur Berezin 054-2266463
Arthur@Berezins.com

%pecial "ermissions

E e"uta!leD

u F s W file e ecutes as o&ner4 instead of e ecuting user # F s W file e ecutes as group o&ns the file # F s W ne& files get inherit group from containing directory o F t W /sers &ith &rite permissions can on directory can remove only their o&n files
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Dire"toriesD

/nit fifteen *EMOTE #:MINI%T*#TION

*emote shell access *emote file transfer %sh keys

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*emote %hell #ccess


For remote shell administration use %%< #llo&s remote login and command e ecution /ses en"ry$ted connection Enabled by default Open%%< 3server5/sually doesn,t re0uire modifications The client saves server,s identifier on first connection 3U>!ssh>kno&nShosts5 ssh +B J/%E*;XJ<O%T; 8P indicates P for&arding
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*emote File Transfer

%%< is a useful tool to run commands but also a secure &ay to copy files scp Jsrc; Jdest; rsync I synchroniEes local and remote direcotries "ull1 rsync (/%E*X+<O%T1%*-!!! (:E%T+ "ush1 rsync %*-!!! (/%E*X+<O%T1:E%T 8r for recursive
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

#rchives and File -ompression

#rchive I bundled collection of files and directories #rchive Manager can create>e tract many archive formats 3YI"4T#*!!5 #pplications ; #ccessories ; #rchive Manager

-ompress :ecompress

6 man tar
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

%%< @eys

%%< @ey -haring allo&s pass&ord8less connection %%< allo&s "rivate8"ublic key sharing "ublic key holder 3ssh %erver5 verifies identity of "rivate @ey holder 3-lient5 This allo&s secure authentication &ithout pass&ord Generate = keys1 "rivate4 "ublic -an generate a pass8phrase "rivate should be kept "rivate
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

%%< @ey %haring


-ommand ss0+4ey#en T&o encription algorithems

:%#4 or *%#

%sh version H is not recommended -ommand ss0+"o$y+id -opies your public key to the server

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit si teen GENE*#L %E*9I-E%

Net&ork %ervices %%< <andling 9N- %erver *emote :esktop #ccess

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

%ervice :eployment
In t0e ser/er %orld %e de$loy Ser/i"es

Install 3yum or system ; #dmin ; #dd soft&are5 Start 3service JN#ME; start or %ystem; administrator ; %ervices5 Ena!le at boot time Test the service3ftp4 samba4 &eb etc,!!5
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

%ecuring %%< #ccess

-onfiguring services is a common task #dd ssh server package 3yum list4yum install5 List configuration file 3rpm 80l5 Man on !conf file :isable pass&ord login :isable *oot Login

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

9N- %erver

9irtual Net&ork -omputing39N-5 #llo&s remote graphical :esktops %teps


Install 3yum>rpm>add remove5 -onfigure >etc>sysconfig>vncservers

9N-%E*9E*%WDH1 visitor =1studentD 9ncpass&d

%et 9N- pass&ord

%tart %ervice Enable %ervice


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

#ccess *emote GNOME :esktop


-ommand Line1 /n"/ie%er is 9N- -lient #llpiactions ; Insternet ; Tiger 9N- 9ie&er Found on tigervnc package 9N- is clear8te t4 $e better use tcp tunneling for security layer based on sshd On the 9N- server

vncservers(=+WD8localhostD 6 vncvie&er 8via sshuserXserver localhost1=


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

-onnect

/nit %eventeen M#N#GE "<Q%I-#L %TO*#GE II

File8system "arameters Modify File8system "arameters *emove partitions %$#" %"#-E %$#" Management

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

File8system "arameters

Let,s look under the hood 3I!E! no Graphics5 On *<EL2 the default file8system is EPTO EPTO has many settings3"arameters5 &e can tune -ommand 6 tune=fs 8l JFILE8%Q%TEM;

Note that file8system is not the mount point4 usually under >dev>%OME8:E9I-E

8L to change Label 8F to change Bournals 8o the change default mount options


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Mount Options

:efault mount options are usually set in

>etc>fstab

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

:elete "artition

Freeing a disk is simpe1


6 umount *emove from >etc>fstab *emove from L9M /se :isk /tility Or the hard8code &ay &ith
command 6 dd i-G o-G "ountG !sG

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

%$#" %pace

%$#" is disk space that e tends system,s memory "artitions need to be formatted as %$#"

:isk /tility or fdisk>mks&ap

#ctivate %$#" command 6 s&apon 3like mount5 :ectivate %$#" command 6 s&apoff #dd a line to >etc>fstab
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

%$#" /tiliEation

The @ernel decides &hat is going to the %$#" %ystem Monitor1 *esources %$#" lo&ers performance significantly 7ut is better that to run out of memory /sually the @ernel decides to %$#" out unused pages4 to provide better performance of more fre0uently used pages

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit Eighteen IN%T#LL LIN/P G*#"<I-LQ

#naconda1 *ed <at Enterprise Linu Installer First8boot -ustomiEation

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

#naconda Graphical Installer

*<EL3*ed <at Enterprise Linu 5 installer called #naconda %upports variety of installation methods

:9: /%7 Net&ork1 "PE4FT"4<TT"

Easiest method is bootable :9: Other methods re0uire minimal installation environment
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

#naconda

Minimal installation environment can come from1


Minimal bootable -:>:9:>/%7 "PE %erver

Minimal image available called Cboot!isoD


"rovides first stage of #naconda -ommon &ith net&ork install

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

%tages of #naconda

%tage H I Te t /ser Interface3T/I5

Te t based menus

Language Installation Method3:9:4 <::4 /*L3<TT"4 FT"5 or NF%5 Net&ork -onfiguration

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

%tages of #naconda

%tage = I Graphical Environment

<o& the machine should be installed and configured1

%torage Layout

"artitioning > L9M > Filesystem > %$#"

Time Eone4 /T*oot "ass&ord 7oot loader 3M7*4 G*/74 "ass&ord "rotect5 "ackages

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Troubleshooting #naconda

:ebugging messages on virtual -onsoles


-trl ' alt FH W Installer "rocess -trl ' alt F= W %hell "rompt 3%tage =5 -trl ' alt FG W Installer Log Messages -trl ' alt FO W Installer @ernel Messages -trl ' alt F? W Other3"artitioning4 File8system5

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Firstboot "ost8Install configuration

Firstboot runs on first boot 3I &onder &here it got it,s name from!!5 "erforms basic configuration on first boot1

#gree to *< licensing terms *egister to *<N for %oft&are /pdates @eyboard Layout )reate User A""ount 3Or net&ork authenticate5 Time>:ate 3NT"5 @dump for kernel crash troubleshooting

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit Nineteen M#N#GE 9I*T/#L M#-<INE%

@9M 9irtualiEation 9irtual Guest Installation #uto8start at boot

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

@9M 9irtualiEation

9irtualiEation allo&s single physical machine to be divided into multiple virtual machines Each machine is independent Operating %ystem *<EL2 %upport @9M4 this allo&s *<EL to function as a hypervisor

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

@9M 9irtualiEation

@9M I @ernel 7ased 9irtual Machine @9M is a kernel Module @9M is <ard&are #ssisted 9irtualiEation 9irtIO I paravirtualiEation modules allo&ing guests to obtain ma imum possible performance 3%torage > Net&ork drivers5

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

@9M 7enefits

Fast 8 Takes advantage of <ard&are %upport %imple 8 :esign makes it easy to support4 OptimiEe4 /se

$e gain by every ne& feature added to Linu

%tandard I /nmodified @ernel for guest and host4 can run &indo&s as &ell

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

@9M *e0uirements

Intel or #M: 2O bit -"/ support3no Itanium4 "o&er4 Mainframe4 #*M3Qet5 5 <ard&are must support 9irtualiEation E tensions 3Intel89T or #M:895 Ena!led at *ios

(rootXrhel2kvm U+6 #re$ ++"olor +E Hs/mI/m H 5$ro"5"$uin-o flags 1 fpu vme de pse tsc msr pae mce c M apic mtrr pge mca cmov pat pseG2 clflush dts acpi mm f sr sse sse= ss ht tm pbe syscall n lm constantStsc archSperfmon pebs bts repSgood aperfmperf pni dtes2O monitor dsScpl /m est tm= ssseG c H2 tpr pdcm lahfSlm tprSshado&
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

@9M *e0uirements

lm W Long Mode 32O bit5 %vm 3#M:5 9m 3Intel5

PEN .

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

virt8manager

9irt8manager as command or from G/I 9irt8install4 virt8vie&4 virsh are available 7oot on host start 6 etc>sysconfig>libvirt8guest
6ONS7OOTW

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit T&enty T<E 7OOT "*O-E%%


7oot alternative kernel 7oot into a specific runlevel Overcome bootloader misconfigurations >boot>grub>grub!conf @ernel boot "arameters >etc>inittab

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

#lternative @ernel

Kernel is the heart of the Operating %ystem Interface bet&een the applications3/ser %apce5 and the hard&are *ed <at Linu #llo&s installing Multiple @ernel version #llo&s to test ne& kernel4 and easily go 7ack Re!oot To /se ne& @ernel
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

<ard&are

@ernel %pace /ser %pace

Linu 7oot "rocess


"o&er On ; 7IO% ; First %ector ; >boot> ; G*/7 8 3>boot>grub>grub!conf5 ; Kernel F initial Ram Dis4 2initrd3 %&itch to > %tart %ervices
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Grand /nified 7ootloader3G*/75

-an be used to

7oot alternative @ernel 7oot into single user mode

on boot process stop the autoboot %elect from the menu the kernel to load Edit kernel line to change default parameters

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

*unlevels

$e have G runlevels1

H I %ingle /ser Mode4 for system maintenance G I Multiuser4 for regular server activity ? I Multiuser &ith Graphical Interface

On system boot only one runlevel boots -ommand1 ( runle/el to check current runlevel -ommand1 ( %0o +r to check current runlevel -ommand1 ( init ,6I8I:. to change runlevel 5et"5initta! for default runlevel
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

The G*/7 boot screen


Menu &ith list of bootable images $e can protect the grub &ith a pass&ord

$ for typing a pass&ord root locating of the >boot 3root &here the grub is5 4ernel &ith kernel location3relative to root above5 and command options initrd initial *#M :isk location &hich contains critical device drivers needed to boot
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Each menu entry has on 5!oot5#ru!5#ru!>"on

The G*/7 boot screen


@ey1 Es" to stop from booting automaticly @ey1 e to edit current configuration @eys /"J;:O$N to select entry @ey1 e to edit current entry @ey1 ! to boot &ith changes -hanges are NOT boot persistentK

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit T&enty One :E"LOQ FILE %<#*ING

FT" %erver :eployment L -onfiguration $eb %erver :eployment L -onfiguration

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

FT" %erver

FT" is one of the oldest net&ork protocols "rovides simple &ay to transfer files 9sftp I for 1ery Se"ure &TP De-ault is

anonymous :o&nload8only -hroot to >var>ftp /ser Login1 :o&nload readable4 upload to &ritable
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

:eploy FT"

#s any net&ork service


Install 36rpm 8/vh vsftp4 or 6 yum install vsftp5 %tart3service vsftpd start5 Enable3chkconfig vsftpd on5 Test 3firefo 4 nautilus5

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

FT" -onfiguration

<o& do &e find the conf file .

3rpm 80l "ackage Name5

>etc>vsftp>vsftpd!conf

anonymousSenableWQE% localSenableWNO &riteSenableWNO

$here can &e find more info on conf file.


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

$eb %erver

-onfiguration1

>etc>httpd>conf>httpd!conf

"ut <TML documents to1

>var>&&&>html>

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

/nit T$ENTQ T$O %E-/*E NET$O*@ %E*9I-E%

Fire&all #ctivation Opening Fire&all ports %ELinu -onsept %ELinu Modes %ELinu Managment

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Fire&all

The fire&all is a kernel module %ystem ; #dministration ; Fire&all %ystem8config8fire&all Enabled by default allo& all outbound traffic #llo&s inbound traffic for1

#ll from localhost device #ll traffic that is started by the server itself %sh 3port ==5
Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Fire&all

:esktop also allo&s1


-/"% 32GH>/:"5 %M7 -lient 3HGT>/:" and HGM>/:"5

On command = separate tools available


6 iptables 6 ip2tables

Make sure NOT to block yourself 15


Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

7asic %ELinu -oncept

"rotect data from compromised services! Even root "arallel set of permissions Each process has it o&n cnte t #nd each file>directory has it o&n conte t "rocess can access only match conte t process

For e ample httpSt or tmpSt -ommand ls 8Y to sho& file conte t

To access both local and %ELinu must be permitted

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

%ELinu Modes

%ELinu has G modes


Enforcing1 all %ELinu conte ts are enforced "ermissive1 all %ELinu rules are allo&d4 but logged to troubleshoot :isabled1 %ELinu is NOT enforced

%ystem ; #dministration ; %ELinu Management

Written by Arthur Berezin 054-2266463 Arthur@Berezins.com

S-ar putea să vă placă și