GNU/Linux Fundamentals Part 3

Slides:



Advertisements
Similar presentations
1 Dynamic DNS. 2 Module - Dynamic DNS ♦ Overview The domain names and IP addresses of hosts and the devices may change for many reasons. This module focuses.
Advertisements

Booting and Shuting Down WeeSan Lee. Roadmap Bootstrapping Boot Loaders Startup/Init Scripts Reboot & Shutdown Q&A.
Genesis: from raw hardware to processes System booting sequence: how does a machine come into life.
Chapter 9: Understanding System Initialization The Complete Guide To Linux System Administration.
Linux+ Guide to Linux Certification Chapter Nine System Initialization.
Linux Booting Procedure
Linux can be generally divided into four major components: 1. KERNEL – OS, ultimate boss The kernel is the core program that runs programs and manages.
Linux+ Guide to Linux Certification, Second Edition
Backups In Linux. The Linux System Many Linux distros set up seperate "/home" and "/" (root) partitions. User configuration files are hidden with a "."
Linux network troubleshooting If your network connection is not working..
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
Linux Installation Chapter II. Linux Distributions Pre-packaged, installable Linux Anyone can compile a distribution, have to inculde GPL Available for.
1 Web Server Administration Chapter 3 Installing the Server.
Module 8 Linux Installation Procedures 8.1 Pre-Installation Tasks 8.2 Installing and Configuring Linux 8.3 X Server 8.4 Post Installation Configuration.
Lesson 4-Installing Network Operating Systems. Overview Installing and configuring Novell NetWare 6.0. Installing and configuring Windows 2000 Server.
Starting and Stopping Linux. Boot Process BIOS initializes hardware –Loads the boot sector MBR loads the bootloader –Point to kernel Kernel initializes.
Linux Setting up your network. Basic Approaches Configure during installation –Disadvantage -> not able to redo easily –Advantage-> holds your hand Configure.
Module 9 - Networking. 1.Network Concepts and Commands 2.Network Files 3.Network Services 4.Configure a network device 5.Network File-System (NFS & CIFS)
Linux Networking Commands
System Administration: Linux Track 2 Workshop June 2010 Pago Pago, American Samoa.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2012 by Scott Orr and the Trustees of Indiana University.
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 7 Connect the SUSE Linux Enterprise Server to the Network.
Chapter 12: Configuring Networks The Complete Guide to Linux System Administration.
Downloading & Installing Software Chapter 13. Maintaining the System Yum Pirut BitTiorrent Rpm Keeping Software Up To Date Up2date Red Hat Network Wget.
V Avon High School Tech Crew Agenda Old Business –Delete Files New Business –Week 10 Topics: Coming up: –Yearbook Picture: Feb 7 12:20PM.
Linux Operations and Administration
Linux Booting Procedure
LPIC-1 TRAINING COURSE Topic 102: Linux Installation and package management.
1 Linux Basics for Networking. 2 Module - Linux Basics for Networking ♦ Overview This module focuses on the basics of networking using Redhat Enterprise.
COSC 4750 Customizing and maintenance. Installing software Redhat/Fedora (and linux in general) has a package installer, called rpm Many programs will.
Linux Package Management Dr. Michael L. Collard 1.
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2010 by Scott Orr and the Trustees of Indiana University.
ITI-481: Unix Administration Meeting 3. Today’s Agenda Hands-on exercises with booting and software installation. Account Management Basic Network Configuration.
Linux Installation and Administration Lesson 3 Tutor: George Papamarkos.
Guide to Linux Installation and Administration, 2e1 Chapter 2 Planning Your System.
A Practical Guide to Fedora and Red Hat Enterprise Linux Unit 8: Installing Software in Linux Chapter 13: Downloading and Installing Software By Fred R.
Linux Network Configuration Linux System Administration /etc/resolv.conf Tells the kernel which name server should be queried when a program asks to "resolve"
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
1 COP 4343 Unix System Administration Unit 11: Networking – basic concepts: IP, TCP, UDP, DHCP – devices: setup, status.
INFSO-RI Enabling Grids for E-sciencE Installation of an APT+kickstart server Giuseppe Platania INFN Catania EMBRACE Tutorial Clermont-Ferrand,
Linux Setting up your network. Basic Approaches Configure during installation –Disadvantage -> not able to redo easily –Advantage-> holds your hand Configure.
Kickstart Installation
Linux Startup Process Presenter: Dipu Gupta.
Network Configuration. NAT Mode, disable DHCP server.
CSCI 330 UNIX and Network Programming Unit XX: Linux Administration.
Linux Operations and Administration
UNIX Startup and Shutdown CSCI N321 – System and Network Administration Copyright © 2000, 2009 by Scott Orr and the Trustees of Indiana University.
Lab 07 Cisco Routers. Project Proposals  Due NOW!  Will review after lecture Will discuss with team captain Note: evening labs may have a longer wait.
Debian Package Management
System initialization Unit objectives A.Outline steps necessary to boot a Linux system, configure LILO and GRUB boot loaders, and dual boot Linux with.
Embedded Software Design Week II Linux Intro Linux Kernel.
Chapter 4: server services. The Complete Guide to Linux System Administration2 Objectives Configure network interfaces using command- line and graphical.
Linux Introduction Linux was developed in the early 1990’s by Linus Torvald computer science student at the University of Helsinki Linux is distributed.
System Administration Startup Process. Why Care? ● Every process on your system comes about by following a specific chain of events from the machine startup.
System Administration Application Management. ● A common task for a system administrator is the installation, updating and removal of software. Several.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com Embedded Linux Training System.
The GRUB bootloader Michael Opdenacker Thomas Petazzoni Free Electrons
Chapter 12: Configuring Networks
Linux network troubleshooting
Lab 07 Cisco Routers.
Network Configuration
LINUX ADMINISTRATION
DHCP server & Client Objectives Contents
Structure of Unix OS.
Ubuntu Working in Terminal
More Scripting & Chapter 11
IS3440 Linux Security Unit 4 Securing the Linux Filesystem
SUSE Linux Enterprise Desktop Administration
Module 12 Network Configuration
Presentation transcript:

GNU/Linux Fundamentals Part 3 TO DO: More slides for permissions (http://oldfield.wattle.id.au/luv/permissions.html) Network sections should be upended Software management should be updated and size increased by Aliaksandr Stelmachonak, Dzmitry Kuchko 1 1

Network Configuration 2 2

ifconfig – configure and control TCP/IP network interfaces Network interface configurator ifconfig – configure and control TCP/IP network interfaces Example: Common uses for ifconfig include setting an interface's IP address and netmask and disabling or enabling a given interface ifconfig displaying the current state of network interfaces 3

Network interface configurator display all interfaces which are currently available, even if down ifconfig –a ifconfig eth0 ifconfig eth0 up ifconfig eth0 down ifconfig eth0 inet 192.168.1.13 netmask 255.255.255.0 displaying the current state of eth0 interface Activating and deactivating eth0 interface Setting configuration for eth0 interface 4

$ traceroute google.com $ tracepath ya.ru Network commands $ ping google.com $ ping –c 5 google.com $ traceroute google.com $ tracepath ya.ru $ host ya.ru $ host 213.180.204.8 $ dig ya.ru $ dig –x 213.180.204.8 sending a ping request show the network route for a given host translate ip address to hostname or vice versa Another method 5

Linux distros hierarchy Slamd64 MOPSLinux Zenwalk SUSE Linux OpenSUSE Yellow Dog – для PowerPC компьютеров, в частности для Sony Play Station 3! Red Flag - ведущий дистрибутив в Китае и азиатском регионе. Red Flag Yellow Dog CentOS Mandrake/Mandriva Fedora Knoppix Xandros Lindows/Linspire/Freespire SimplyMEPIS Ubuntu Family

Differences between distros Debian based Red Hat based /etc/sysconfig/network /etc/sysconfig/network -scripts/ifcfg-ethX /etc/sysconfig/network /etc/resolv.conf /etc/network/interf aces /etc/hostname /etc/resolv.conf

[root@rhel ~]# cat /etc/sysconfig/network- scripts/ifcfg-eth0 Main Settings [root@rhel ~]# cat /etc/sysconfig/network- scripts/ifcfg-eth0 root@ubuntu:~# cat /etc/network/interfa ces DEVICE=eth0 IPADDR=208.164.186.1 NETMASK=255.255.255.0 NETWORK=208.164.186.0 BROADCAST=208.164.186 .255 ONBOOT=yes auto lo eth0 iface eth0 inet static address 192.168.0.10 netmask 255.255.255.0 gateway 192.168.0.1 dhcp BOOTPROTO=dhcp

[root@rhel ~]# cat /etc/sysconfig/network Host name [root@rhel ~]# cat /etc/sysconfig/network root@ubuntu:~# cat /etc/hostname NETWORKING=yes FORWARD_IPV4=yes HOSTNAME=myhost.local GATEWAY=192.168.0.1 myhost.local ;-)

root@generic-linux:~# cat /etc/resolv.conf DNS and search domains root@generic-linux:~# cat /etc/resolv.conf domain minsk.epam.com search epam.com. minsk.epam.com. nameserver 10.6.0.6 nameserver 10.6.0.16 domain имя - Задает локальное доменное имя в качестве стандарного домена. search список_поиска - Задает список поиска для имен хостов. В файле resolv.conf можно указывать до MAXNS (в настоящее время - трех) серверов имен, по одному в строке.

root@ubuntu:~# /etc/init.d/networking restart Restarting network root@ubuntu:~# /etc/init.d/networking restart * Reconfiguring network interfaces... [ OK ] root@rhel:~# service network restart Shutting down interface eth0: [ OK ] Bringing up interface eth0: Determining IP information for eth0... done. [ OK ] domain имя - Задает локальное доменное имя в качестве стандарного домена. search список_поиска - Задает список поиска для имен хостов. В файле resolv.conf можно указывать до MAXNS (в настоящее время - трех) серверов имен, по одному в строке.

Software management (yum & apt) 12 12

Linux distros hierarchy Slamd64 MOPSLinux Zenwalk SUSE Linux OpenSUSE Yellow Dog – для PowerPC компьютеров, в частности для Sony Play Station 3! Red Flag - ведущий дистрибутив в Китае и азиатском регионе. Red Flag Yellow Dog CentOS Mandrake/Mandriva Fedora Knoppix Xandros Lindows/Linspire/Freespire SimplyMEPIS Ubuntu Family

Some definitions A software package refers to computer software packaged in an archive format to be installed by a package management system or a self-sufficient installer. A package management system is a collection of tools to automate the process of installing, upgrading, configuring, and removing software packages from a computer. 14

Red Hat based Debian based RPM rpm yum DEB dpkg apt General Differences between distros Red Hat based Debian based RPM rpm yum DEB dpkg apt

Some definitions RPM (Red Hat Package Manager) is a package management system. Originally developed by Red Hat for Red Hat Linux, RPM is now used by many Linux distributions. YUM (The Yellow dog Updater, Modified) is an open source command line package management utility for RPM-compatible Linux operating systems and has been released under the GNU GPL. deb is the extension of the Debian software package format and the most often used name for such binary packages. Like the "Deb" part of the term Debian, it originates from the name of Debra, then girlfriend and now ex-wife of Debian's founder Ian Murdock  APT, or The Advanced Packaging Tool, is a free user interface that works with core libraries to handle the installation and removal of software on the Debian GNU/Linux distribution and its variants. 16

YUM: configuration and usage /etc/yum.conf main configuration file yum –h Viewing yum options yum list |more Listing installed packages yum info firefox Getting package descriptions yum search firefox Searching for packages yum deplist firefox Viewing package dependencies yum install mc Install package yum remove mc Remove package mc check-update Check for update for particular package yum update Update all of the outdated packages yum clean all Cleaning up the yum cache 17

[root@centos ~]# ls /etc/yum.repos.d/ YUM: repositories [root@centos ~]# ls /etc/yum.repos.d/ CentOS-Base.repo CentOS-Media.repo [root@centos ~]# cat /etc/yum.repos.d/CentOS-Base.repo [base] name=CentOS-$releasever – Base baseurl=http://mirror.yandex.ru/centos/5.4/os/x86_64/ gpgcheck=0 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 [updates] name=CentOS-$releasever – Updates baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ gpgcheck=1 User friendly name of repo Name of repo url to repos activity flag 18

apt - Advanced Package Tool apt-get apt-cache apt-cdrom aptitude 19

apt-get apt-get is a simple command line interface for downloading and installing packages. The most frequently used commands are update and install. update - Retrieve new lists of packages upgrade - Perform an upgrade install - Install new packages (pkg is libc6 not libc6.deb) remove - Remove packages purge - Remove packages and config files check - Verify that there are no broken dependencies

apt-cache apt-cache is a low-level tool used to manipulate APT's binary cache files, and query information from them. showpkg - Show some general information for a single package search - Search the package list for a regex pattern show - Show a readable record for the package depends - Show raw dependency information for a package pkgnames – show all installed packages

apt-cdrom apt-cdrom is a tool to add CDROM's to APT's source list. The CDROM mount point and device information is taken from apt.conf and etc/fstab. add - Add a CDROM ident - Report the identity of a CDROM

Synaptic Package Manager aptitude Synaptic is high-level interface to the package manager

aptitude aptitude aptitude is high-level interface to the package manager

apt: repositories root@host-93:~# cat /etc/apt/sources.list deb ftp://mirror.minsk.epam.com/pub/Ubuntu/ubuntu/ karmic main restricted deb-src ftp://mirror.minsk.epam.com/pub/Ubuntu/ubuntu/ karmic main restricted deb ftp://mirror.minsk.epam.com/pub/Ubuntu/ubuntu/ karmic universe deb ftp://mirror.minsk.epam.com/pub/Ubuntu/ubuntu/ karmic-security main deb ftp://mirror.minsk.epam.com/pub/Ubuntu/ubuntu/ karmic-security restricted deb ftp://mirror.minsk.epam.com/pub/Ubuntu/ubuntu/ karmic-updates main deb ftp://mirror.minsk.epam.com/pub/Ubuntu/ubuntu/ karmic-updates restricted type url to repos name of distr types of repos 25

Samba client 26 26

root@ubuntu:~# apt-get install smbclient Kickstart root@ubuntu:~# apt-get install smbclient root@ubuntu:~# apt-get install smbfs root@ubuntu:~# smbclient -U name_surname -W minsk.epam.com -L 10.6.5.70 root@ubuntu:~# smbclient -U name_surname -W minsk.epam.com //EPBYMINW0777/upload root@ubuntu:~# mkdir /media/1/ root@ubuntu:~# smbmount //EPBYMINW0934.minsk.epam.com/upload /media/1/ -o user=name_surname,dom=minsk.epam.com root@ubuntu:~# ls /media/1/ you must specify existing share!!! 27

Linux boot process 28 28

LILO or GRUB (boot loader) Kernel (+ initrd) init Run Levels Boot sequence summary BIOS LILO or GRUB (boot loader) Kernel (+ initrd) init Run Levels BIOS Master Boot Record (MBR) LILO or GRUB Kernel init Run Levels 29

Boot sequence summary: BIOS Load boot sector from one of: Floppy CDROM Hard drive The boot order can be changed from within the BIOS settings. BIOS Master Boot Record (MBR) LILO or GRUB Kernel init Run Levels 30

GRUB (GRand Unified Bootloader) Boot sequence summary: LILO or GRUB Lilo (Linux loader) GRUB (GRand Unified Bootloader) does not understand filesystems More advanced and commonly used uses the BIOS routines to load Loading sequence Understands file systems load menu code, typically /boot/boot.b config lives in /boot/grub/menu.lst or /boot/boot/menu.lst prompt for (or timeout to default) partition or kernel for "image=" option load kernel image BIOS Master Boot Record (MBR) LILO or GRUB Kernel init Run Levels 31

Boot sequence summary: kernel initialize devices (optionally loads initrd) mounts root filesystem runs /sbin/init which is process number 1 (PID=1) BIOS Master Boot Record (MBR) LILO or GRUB Kernel init Run Levels 32

Boot sequence summary: initrd is a temporary file system used by the Linux kernel during boot typically used for making preparations before the real root file system can be mounted initramfs – modern substitute for initrd The complete linux driver set, covering every interface and file system that might be required, runs to many megabytes of object code. It is undesirable to waste memory on drivers for hardware that the system doesn't have, and so many drivers are provided as kernel modules, that are loaded only when they're needed, instead of monolithically compiled into the kernel itself. This saves memory, as it is not possible to unload drivers that are "monolithically" compiled into the kernel. A system can only boot if it has drivers for the boot hardware. In principle this could include any extant network or storage device, yet if every driver were pre-loaded "just in case" it was needed, the kernel would become infeasibly large. This problem is solved by storing the modules in a ramdisk, which is loaded into memory along side the kernel during the operating system boot process. As all the modules are available in memory, they can then be copied into the kernel without resorting to other drivers. Once the kernel has loaded all the drivers it needs for the available hardware, the ramdisk can be released, and the "real" root file system mounted. Hence initrd, the INITial RamDisk was created. 33

Boot sequence summary: /sbin/init reads /etc/inittab (see man inittab) Run boot scripts, eg for redhat /etc/rc.d/rc.sysinit which: loads modules check root FS and mount RW mount local FS setup network mount remote FS Switches to default runlevel, eg 3 (defined in /etc/inittab, eg: id:3:initdefault: ) run scripts /etc/rc3.d/S* run programs specified in /etc/inittab BIOS Master Boot Record (MBR) LILO or GRUB Kernel init Run Levels 34

Red Hat Linux/Fedora runlevels Boot sequence summary: runlevels The term runlevel refers to a mode of operation in one of the computer operating systems that implement Unix System V-style initialization. Differs for different UNIX systems and Linux distributives Red Hat Linux/Fedora runlevels The term runlevel refers to a mode of operation in one of the computer operating systems that implement Unix System V-style initialization. Conventionally, seven runlevels exist, numbered from zero to six; though up to ten, from zero to nine, may be used. S is sometimes used as a synonym for one of the levels. In standard practice, when a computer enters runlevel zero, it halts, and when it enters runlevel six, it reboots. The intermediate runlevels (1-5) differ in terms of which drives are mounted, and which network services are started. Lower run levels are useful for maintenance or emergency repairs, since they usually don't offer any network services at all. The particular details of runlevel configuration differ widely among operating systems, and slightly among system administrators. The runlevel system replaced the traditional /etc/rc script used in Version 7 Unix. 35

root@ubuntu:~# telinit 5 root@ubuntu:~# runlevel 3 5 Managing init levels root@ubuntu:~# init 3 root@ubuntu:~# telinit 5 root@ubuntu:~# runlevel 3 5 current previous The term runlevel refers to a mode of operation in one of the computer operating systems that implement Unix System V-style initialization. Conventionally, seven runlevels exist, numbered from zero to six; though up to ten, from zero to nine, may be used. S is sometimes used as a synonym for one of the levels. In standard practice, when a computer enters runlevel zero, it halts, and when it enters runlevel six, it reboots. The intermediate runlevels (1-5) differ in terms of which drives are mounted, and which network services are started. Lower run levels are useful for maintenance or emergency repairs, since they usually don't offer any network services at all. The particular details of runlevel configuration differ widely among operating systems, and slightly among system administrators. The runlevel system replaced the traditional /etc/rc script used in Version 7 Unix. 36

Questions? 