Presentation is loading. Please wait.

Presentation is loading. Please wait.

GNU/Linux Fundamentals Part 3

Similar presentations


Presentation on theme: "GNU/Linux Fundamentals Part 3"— Presentation transcript:

1 GNU/Linux Fundamentals Part 3
TO DO: More slides for permissions ( Network sections should be upended Software management should be updated and size increased by Aliaksandr Stelmachonak, Dzmitry Kuchko 1 1

2 Network Configuration
2 2

3 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

4 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 netmask displaying the current state of eth0 interface Activating and deactivating eth0 interface Setting configuration for eth0 interface 4

5 $ 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 $ dig ya.ru $ dig –x sending a ping request show the network route for a given host translate ip address to hostname or vice versa Another method 5

6 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

7 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

8 [root@rhel ~]# cat /etc/sysconfig/network- scripts/ifcfg-eth0
Main Settings ~]# cat /etc/sysconfig/network- scripts/ifcfg-eth0 cat /etc/network/interfa ces DEVICE=eth0 IPADDR= NETMASK= NETWORK= BROADCAST= ONBOOT=yes auto lo eth0 iface eth0 inet static address netmask gateway dhcp BOOTPROTO=dhcp

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

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

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

12 Software management (yum & apt)
12 12

13 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

14 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

15 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

16 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

17 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

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

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

20 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

21 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

22 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

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

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

25 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

26 Samba client 26 26

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

28 Linux boot process 28 28

29 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

30 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

31 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

32 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

33 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

34 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

35 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

36 root@ubuntu:~# telinit 5 root@ubuntu:~# runlevel 3 5
Managing init levels init 3 telinit 5 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

37 Questions? 


Download ppt "GNU/Linux Fundamentals Part 3"

Similar presentations


Ads by Google