linux proficiency (draft)

45
OVERVIEW ( 31 martie 2015 ) Page: 1 of 45 OVERVIEW Pentru a învăţa LINUX, trebuie pornit cu dreptul. Asta înseamnă că trebuie pornit de la Basics. Generalităţi OS Linux Principalele operaţiuni în Linux Operaţiuni uzuale în Command Line (Tools - vezi Linux Tools Cookbook)

Upload: cintezica

Post on 01-Oct-2015

98 views

Category:

Documents


9 download

DESCRIPTION

Reading Notes

TRANSCRIPT

  • OVERVIEW ( 31 martie 2015 )

    Page: 1 of 45

    OVERVIEW

    Pentru a nva LINUX, trebuie pornit cu dreptul. Asta nseamn c trebuiepornit de la Basics.

    Generaliti OS Linux Principalele operaiuni n Linux Operaiuni uzuale n Command Line (Tools - vezi Linux Tools Cookbook)

  • COMENZI ( 31 martie 2015 )

    Page: 2 of 45

    COMENZI

    Nota 17 octombrie 2014: din lipsa unei structuri (deocamdat) n acest folder, voi include aici comenzile utilepe care le gsesc, nsoite de scurte trimiteri la surs. n viitor, aceste comenzi vor fi structurate n funcie desegmentul pe care l acoper.

    Cum s afli ce distribuie foloseti rspuns aflat pe Superuser.com: lsb_release -irc pe maina mea (laptopul Dell) a dat urmtorul output:

    ciprian@ciprian-Inspiron-1521 ~ $ lsb_release -ircDistributor ID: LinuxMintRelease: 13Codename: maya

    o pe pagina surs mai sunt o grmad de sfaturi care depesc interesulmeu actual, dar care ar putea fi interesante mai trziu

    mai funcioneaz i cat /etc/issue (gsit pe Linuxquestions.org):

    ciprian@ciprian-Inspiron-1521 ~ $ cat /etc/issueLinux Mint 13 Maya \n \l

    Cum s faci update prin terminal

    ciprian@ciprian-Inspiron-1521 ~ $ sudo apt-get updateciprian@ciprian-Inspiron-1521 ~ $ sudo apt-get upgrade

  • COMENZI ( 31 martie 2015 )

    Page: 3 of 45

    APPS

    Voi ncerca s separ aplicaiile disponibile n Linux dup cum urmeaz: aplicaii de tip "Linux legacy", prezente pe toate distribuiile Linux aplicaii prezente pe majoritatea distribuiilor aplicaii specifice unor distribuii alte aplicaii

    o aici ar putea fi incluse aplicaii prezente pe unele distribuii, opionalesau inexistente pe altele

    o tot aici ar putea fi aplicaii care au avut o perioad de development attde scurt (aplicaii foarte noi) nct este posibil ca n ceva vreme nici snu mai aud de ele

    evince GNOME Document Viewer poate fi apelat cu evince filename pentru documente PDF i PostScript n Linux Mint MATE Edition este atril, o versiune modificat evince

  • APPS ( 31 martie 2015 )

    Page: 4 of 45

    Wireless on Dell

    mi-a fcut zile fripte!!! fucking shit!!!

    dup sfatul unui looser de pe YT am activat n Driver Manager (Linux MintQiana) driverul bcmwl-kernel-source

    dup ce c nu mi-a aprut n tooltip n bar vizibile toate reelele wireless(cum i aprea lui), mi-a mai i fcut inoperabil conexiunea wired, prin cablu(care mcar mergea bine)

    am gsit un sfat pentru:

    ciprian@inspiron ~ $ sudo apt-get remove --purge bcmwl-kernel-source

    o poate ar fi trebuit s dau i:

    ciprian@inspiron ~ $ sudo rm /etc/modprobe.d/blacklist-bcm43.confciprian@inspiron ~ $ sudo rm /etc/modprobe.d/broadcom-sta-common.confciprian@inspiron ~ $ sudo rm /etc/modprobe.d/broadcom-sta-dkms.conf

    o dar aparent comanda anterioar le-a scos ea

    cnd a terminat, am dat reboot

    ciprian@inspiron ~ $ sudo reboot now

    dup reboot, am verificat reeaua prin cabluo for fuck's sake, merge!

    ncercat nti cu:

    ciprian@inspiron ~ $ sudo apt-get install b43-fwcutterciprian@inspiron ~ $ wget http://mirror2.openwrt.org/sources/broadcom-wl-4.150.10.5.tar.bz2ciprian@inspiron ~ $ tar xf broadcom-wl-4.150.10.5.tar.bz2

    o Nota: comanda wget nu am fcut-o, am fcut altfel: am scos de peWindows pachetul respectiv, pus pe un USB i abia pe urm l-amdezarhivat cu tar (fcut asta nainte s repar reeaua pe cablu)

  • APPS ( 31 martie 2015 )

    Page: 5 of 45

    ciprian@inspiron ~ $ cd broadcom-wl-4.150.10.5/driver/ciprian@inspiron ~ $ sudo b43-fwcutter -w /lib/firmware/wl_apsta_mimo.ociprian@inspiron ~ $ sudo modprobe b43ciprian@inspiron ~ $ suPassword:ciprian@inspiron ~ $ sudo echo "b43" >> /etc/modulesciprian@inspiron ~ $ cat /etc/modules

    acum ar trebui s apar linia b43 pe ultima linie a fiierului /etc/modules

    Sursa: http://linux-bsd-sharing.blogspot.ro/2012/03/howto-enabling-broadcom-bcm4318.html

    alternativa la pachetul broadcom-wl-4.150.10.5.tar.bz2 este de scos pachetullinux-firmware-nonfree_1.14_all.deb conform soluiei de mai jos:

    obviously the user does not have any connection at all Please download this package and save it in "Downloads":http://de.archive.ubuntu.com/ubuntu/pool/multiverse/l/linux-firmware-nonfree/linux-firmware-nonfree_1.14_all.deb

    Installation/Uninstallation of the Broadcom-STA driver:Commands:sudo dpkg -i ~/Downloads/linux-*.debsudo apt-get remove --purge bcmwl-kernel-sourcesudo rm /etc/modprobe.d/blacklist-bcm43.confsudo rm /etc/modprobe.d/broadcom-sta-common.confsudo rm /etc/modprobe.d/broadcom-sta-dkms.confSursa: http://ubuntuforums.org/showthread.php?t=2158317

  • APPS ( 31 martie 2015 )

    Page: 6 of 45

    BEGINNER STAGE

    GENERALITIINSTALARETHE SHELL

  • Wireless on dell ( 31 martie 2015 )

    Page: 7 of 45

    GENERALITI

    GNU Project:o un proiect pornit de Richard Stallmano scopul: de a construi un set de componente software care s nu

    necesite folosirea de software cu liceno componente:

    bash Emacs gzip automake gcc make

    Linuxo este kernelul sistemelor GNU/Linuxo pornit iniial de Linus Torvaldso sistemele GNU/Linux poart aceast denumire deoarece folosesc Linux

    ca i kernel, iar instrumentele GNU Project sunt incluse

    Linux Minto este o distribuie Linux, care folosete (ca oricare alt distribuie),

    Linux ca i kernel iar GNU Tools ca instrumente software pre-incluseo o distribuie este compus din:

    un kernel (Linux) un sistem de instrumente de baz (GNU Tools) un set de aplicaii software pre-incluse (i pre-customizate)

    Istorie Clement Lefebre a pornit proiectul Mint n 2006 a vrut s experimenteze cteva idei personale privind uzabilitate i design a pornit de la o platform Ubuntu pe care a nceput s o modifice prima versiune s-a numit Ada i a fost lansat ca test dup cteva luni a urmat a doua versiune, numit Barbara odat cu aceast versiune, distribuia a nceput s capteze interes

    internaional comunitatea Mint se gsete la http://community.linuxmint.com.

    Prin ce se evideniaz Mint a fost proiectat s fie uor de folosit i elegant ca aspect meniul principal este organizat n grupuri de aplicaii pentru a spori uzabilitatea, Mint a dezvoltat cteva instrumente proprii:

    o mintInstallo mintUpdateo mintBackup

  • Wireless on dell ( 31 martie 2015 )

    Page: 8 of 45

    o mintUpload spre deosebire de alte distribuii, Mint include o serie de instrumente

    software din start: Java runtime, Flash Player, multimedia codecs

    Ediii Mint are dou ediii: una bazat pe Debian, alta bazat pe Ubuntu ediia Debian se numete Linux Mint Debian Edition (LMDE) ediia Ubuntu este simplu numit Linux Mint ediia Debian nu lanseaz releases, ci este updatat on the fly ediia Ubuntu lanseaz cte un release la ctva timp ediia Debian, mai cutting edge, dar mai riscant pentru nceptori ediia Ubuntu, mai conservatoare, dar mai stabil i mai sigur

    ambele ediii au versiuni 32b i 64b ca i desktop environment, sunt patru versiuni:

    o MATEo Cinnamono KDEo Xfce

  • Wireless on dell ( 31 martie 2015 )

    Page: 9 of 45

    INSTALARE

    Instalarea pe un USB driveInstalarea de pe un USB drive

  • Wireless on dell ( 31 martie 2015 )

    Page: 10 of 45

    Instalarea pe un USB drive

    se alege ediia dorit, platforma (32b sau 64b) i tipul de Desktop se descarc imaginea ISO

    o Hint: nu te chinui cu torrent-ul de pe site, merge ca un rahato ia din lista de mirrors adresa de Romania i descarc cu GetRight, cu

    opiunea de 'segmented download' --> scoate imaginea de 1,2 GB nmai puin de cinci minute!

    se descarc UNetbootin (Universal Network Installer), se instaleazo la fel, nu ncerca s descarci imaginea ISO cu el, merge ca o cizm

    cu UNetbootin, se creaz imaginea pe USB (interfaa este self explanatory)o Space used to preserve files across reboots - este necesar s specificm o

    dimensiune de spaiu aici (512 MB este suficient) pentru a pstra datescrise atunci cnd folosim imaginea ca sistem "on the go" (aici se vorsalva modificrile noastre)

    ateapt o venicie pn UNetbootin i termin treaba (aproape dou ore)

  • Wireless on dell ( 31 martie 2015 )

    Page: 11 of 45

    Instalarea de pe un USB drive

    setm boot-ul pe USB bootm n imaginea de pe drive-ul USB

    pe Desktop se afl iconul Install Linux Mint paii urmtori sunt self explanatory

  • Wireless on dell ( 31 martie 2015 )

    Page: 12 of 45

    THE SHELL

    GENERALITICe este un shell?Istoricbash shell

  • BEGINNER STAGE ( 31 martie 2015 )

    Page: 13 of 45

    GENERALITI

    Ce este un shell?Istoricbash shell

    Ce este un shell? dpdv tehnic, un shell nu este dect un program care poate executa alte

    programe n numele utilizatorului ofer userului o interfa de comunicare cu kernelul sistemului de operare cunoscut i ca CLI (Command-line interface)

    (TOP)

    Istoric primele sisteme Unix au separat shell-ul de restul componentelor sistemului shell-ul putea astfel fi lansat direct de utilizator alte componente ale sistemului, ns, cum ar fi memory manager, scheduler,

    input/output system, comunicau direct cu kernelul, fr interveniautilizatorului

    ediia a 6-a a sistemului Unix a inclus un shell ca interpretor de comenzistandard

    numele era sh i a fost dezvoltat de Ken Thompson n 1979, odat cu a 7-a ediie Unix, a fost inclus un nou shell, numit Bourne

    shell, creat de Stephen Bourne civa ani mai trziu Bill Joy a scris un nou shell, numit C shell (cunoscut ca

    csh) Bill Joy lucra la Universitatea din California, aa nct shell-ul lui a devenit

    parte integrant a unei distribuii specifice de Unix, cunoscut ca BerkeleySystem Distribution (BSD)

    n anii 80 David Korn a dezvoltat un nou shell, cunoscut ca Korn shell (ksh) compatibil cu Bourne shell, ksh ofer n plus cteva facitiliti pentru

    programatori i pentru cei care doresc customizri avansate

    (TOP)

    bash shell majoritatea distribuiilor Linux includ acum Bourne-Again shell, cunoscut

    sub numele de bash shell, care este un shell conceput pentru a fi compatibilcu Bourne shell

    bash este shell-ul standard pe majoritatea distribuiilor

    bash are construite nativ cteva funcii standard (schimbarea directoruluicurent, afiarea coninutului unui fiier, listarea coninutului unui director)

  • BEGINNER STAGE ( 31 martie 2015 )

    Page: 14 of 45

    alte funcii care pot fi operate din bash sunt instrumente separate incluse dedistribuiile GNU/Linux ele sunt considerate tot comenzi bash, dei strictvorbind nu aparin de bash

    (TOP)

  • BEGINNER STAGE ( 31 martie 2015 )

    Page: 15 of 45

    ORIENTAREA N SISTEM

    Despre terminalurile disponibileCteva comenzi elementareFiiereComenzi legate de fiiere

    Despre terminalurile disponibile MATE ofer MATE Terminal Cinnamon ofer GNOME Terminal LXDE ofer LXTerminal

    Cteva comenzi elementarepwdcdwhich

    pentru a afla unde eti: pwd (print working directory)

    ciprian@inspiron ~ $ pwd/home/ciprian

    pentru a schimba directorul actual: cd (change directory)

    ciprian@inspiron ~ $ cd /tmpciprian@inspiron /tmp $

    o ce urmeaz dup cd este practic argumentul comenzii --> calea dedestinaie (unde dorim s ajungem)

    o cd fr nici un argument ne ntoarce la directorul homeo ~ nseamn ntotdeauna directorul home al utilizatoruluio $ este simbolul de prompt, care indic posibilitatea de a introduce

    comenzi noi

    pentru a afla locaia unei comenzi (unde se afl executabilul): whichcomand

    ciprian@inspiron ~ $ which find/usr/bin/find

    o find este o comand pentru cutat fiiereo comanda which ne arat i c /usr/bin/ este inclus n variabila de

    sistem $PATH

    Fiiere un fiier este o resurs persistent pentru stocarea informaiei

  • BEGINNER STAGE ( 31 martie 2015 )

    Page: 16 of 45

    orice informaie este stocat ntr-un fiier: imagini, sunete, programe,comenzi

    de aceea este extrem de important s nvm s cutm, s listm i sexaminm fiiere

    Comenzi legate de fiierelsfindlocatecat

    pentru a lista coninutul unui director: ls (list)

    ciprian@inspiron ~ $ lsDesktop Documents Downloads Music Pictures Public Templates Videos

    pentru a cuta fiierele cu o anumit extensie ntr-un director: find cale '*.extensie':

    ciprian@inspiron ~ $ find /etc/ufw -name '*.conf'/etc/ufw/ufw.conf/etc/ufw/sysctl.conf

    pentru a cuta un fiier al crui nume l cunoatem: locate nume_fiier:

    ciprian@inspiron ~ $ locate .bash_history/home/ciprian/.bash_history

  • BEGINNER STAGE ( 31 martie 2015 )

    Page: 17 of 45

    Title

    text

  • BEGINNER STAGE ( 31 martie 2015 )

    Page: 18 of 45

    NOTETAKING

    KeepNote de la bun nceput aplicaia ar trebui s suporte font aliasing aplicaia nu detecteaz schimbarea tastaturii din En n Ro deci suportul pentru limbi strine ar trebui din start asigurat fonturile cu diacritice importate din Windows ar trebui s funcioneze

    imediat (Cambria, n cazul meu) -- i nu o fac comanda Link din meniul Format nu ofer dect un foarte primitiv suport

    pentru linkuri web simple (o simpl linie de inserare) nici un fel de suport pentru linkare ntre note (esenial!) scris n PyGTK2/Python i se mic ca un dinozaur n KDE, uneori cu timpi

    de rspuns de pn la 1-2 secunde, pe un sistem destul de ok dac folosete absolut tot stilul sistemului, ar trebui inclus o opiune care s

    dezactiveze schimbarea i a backgroundului paginii notesului (care pesistemul meu cu un Oxygen Dark inverseaz culorile n negativ)

    KJots merge un pic mai bine dect KeepNote (Qt4/C++) dar la fel de dezamgitoare,

    pn la urm are un fel de inter-linkare care ns nu funcioneaz de nici un fel Cambria setat la 14 arat aproape ca i cum ar fi fost 10; a trebuit s dau 22

    ca s apar ct de ct rezonabil pe ecran ce se printeaz n fiierul PDF este cu totul altceva dect ceea ce a fost scris n

    documentul iniial: fonturi schimbate, prima linie se comport automat ca icum ar fi fost setat ca titlu, etc.

    uitndu-m la interfa (iconurile, n special), realizez c Writer's Delight dinWindows a fost cu siguran scris n Qt pentru c folosete exact aceleaisimboluri i interfaa arat n general aproape identic

    ConcluziiDac ar fi s ncep s programez pentru Linux n Qt a ncepe probabil cu C++ pentru c Python se mic extrem de greu Python poate c este util atunci cnd nu programezi pentru interfee grafice

    (dei i C++ poate fi la fel de util n astfel de cazuri, dar filosofia "batteriesincluded" din Python ar face mai uor disponibile unele funcionaliti)

    Qt pare s fie extrem de robust dar oricum aparent Calibre este programat nGTK/Python (de verificat) i totui se mic destul de ok chiar i n KDE --ceea ce demonstreaz c de cele mai multe ori e vorba de programator, nu deinstrument

    aplicaii -- innd cont de interesele mele particulare:o o aplicaie de tip TexNoteso o aplicaie care s implice baze de dateo o aplicaie care s lucreze cu protocoale network i web (scuz pentru

    a nva mai multe despre asta)o poate o aplicaie de contabilitate (ceva gen Saga, nu un mastodont ca

  • GENERALITI ( 31 martie 2015 )

    Page: 19 of 45

    Sage sau QB, dar care s aib o interfa mai limpede dect oroarea deinterfa din Saga), care s implice att baze de date ct i networking(opional)

    o un game engine bazat pe OpenGL i C++, ca s neleg mai binearhitectura unui engine (world creation)

    pentru aplicaiile cu interfee grafice heavy cred c C++ se are n vedereaproape fr excepie, pentru c ursc programele care abia se mic pesisteme decente

  • GENERALITI ( 31 martie 2015 )

    Page: 20 of 45

    VirtualBox

    instaleaz dependinele pentru a evita erorilesudo apt-get install dkms instaleaz cheia public Oracle:wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc-0- | sudo apt-key add - adaug cheia public la repository (pentru Ubuntu 14.04):sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian trusty contrib">> /etc/apt/sources.list.d/virtualbox.list' instaleaz aplicaia:sudo apt-get install virtualbox-qt

    Nota: VRDE (VirtualBox Remote Desktop Extension) apare gata instalat, dardac nu ar fi fost, trebuia mers la download.virtualbox.org/virtualbox/4.3.18(sau vezi varianta exact a versiunii curente de VirtualBox), scos__Oracle_VM_VirtualBox_Extension_Pack pentru versiunea curent, downloadati apoi:sudo VBoxManage extpack install numele_fiierului

  • GENERALITI ( 31 martie 2015 )

    Page: 21 of 45

    LINUX Proficiency

    When setting up a server, you should understand these basic things withoutusing a GUI.

    How to install the OS. (will use a wizard, but that's ok)How to network the System (know where eth0 is configured, resolv.conf, etc..)How to configure iptables (firewall to open ports for specific hosts/ip ranges)How to start and stop services, recognize which ports they use, and make themstart automatically when the system boots (chkconfig)How to update the system and configure auto updates via cron.Know the vi editor and its commands.

    For development, I suggest you set up your own project management system ona server and learn to use/administer it. Something like subversion or git, etc.From there I think it would help you to get aquainted with some of the morecommon libraries you might hope to write code that links to them. It sounds likeyou're already aquainted with C/C++ , start pulling down some source tarballsfrom sourceforge and tweaking around with them and compiling/installingthem.

    Using VMs, and using snapshots to save and restore your working environmentwill help a lot. CentOS and Debian would probably be the most rewarding foryou to be familiar with. CentOS is basically RHEL sans the branding, and Debianis just a really great OS.

  • GENERALITI ( 31 martie 2015 )

    Page: 22 of 45

    Linux Professional Institute Certification

    LPIC 1 Study Guide, 3rd Edition, 2013

    EXAM 101 Chapter 1 Exploring Linux Command-Line Tools Chapter 2 Managing Software Chapter 3 Configuring Hardware Chapter 4 Managing Files Chapter 5 Booting Linux and Editing Files

    EXAM 102 Chapter 6 Configuring the X Window System, Localization, and Printing Chapter 7 Administering the System Chapter 8 Configuring Basic Networking Chapter 9 Writing Scripts, Configuring Email, and Using Databases Chapter 10 Securing Your System

  • GENERALITI ( 31 martie 2015 )

    Page: 23 of 45

    Extended Summary 101

    EXAM 101 Chapter 1 Exploring Linux Command-Line Tools

    o Understanding Command-Line Basics Exploring Your Linux Shell Options Using a Shell

    Starting a Shell Using Internal and External Commands Performing Some Shell Command Tricks

    Exploring Shell Configuration Using Environment Variables Getting Help

    o Using Streams, Redirection, and Pipes Exploring Types of Streams Redirecting Input and Output Piping Data Between Programs Generating Command Lines

    o Processing Text Using Filters File-Combining Commands

    Combining Files with cat Joining Files by Field with join Merging Lines with paste

    File-Transforming Commands Converting Tabs to Spaces with expand Displaying Files in Octal with od Sorting Files with sort Breaking a File into Pieces with split Translating Characters with tr Converting Spaces to Tabs with unexpand Deleting Duplicate Lines with uniq

    File-Formatting Commands Reformatting Paragraphs with fmt Numbering Lines with nl Preparing a File for Printing with pr

    File-Viewing Commands Viewing the Starts of Files with head Viewing the Ends of Files with tail Paging Through Files with less

    File-Summarizing Commands Extracting Text with cut Obtaining a Word Count with wc

    o Using Regular Expressions Understanding Regular Expressions Using grep Using sed

  • GENERALITI ( 31 martie 2015 )

    Page: 24 of 45

    Chapter 2 Managing Softwareo Package Conceptso Using RPM

    RPM Distributions and Conventions The rpm Command Set Extracting Data from RPMs Using Yum RPM and Yum Configuration Files RPM Compared to Other Package Formats

    o Using Debian Packages Debian Distributions and Conventions The dpkg Command Set Using apt-cache Using apt-get Using dselect, aptitude, and Synaptic Reconfiguring Packages Debian Packages Compared to Other Package Formats Configuring Debian Packages Tools

    o Converting Between Package Formatso Package Dependencies and Conflicts

    Real and Imagined Package Dependency Problems Workarounds for Package Dependency Problems Forcing the Installation Upgrading or Replacing the Depended-on Package Rebuilding the Problem Package Locating Another Version of the Problem Package Startup Script Problems

    o Managing Shared Libraries Library Principles Locating Library Files

    Setting the Path Systemwide Temporarily Changing the Path Correcting Problems

    Library Management Commands Displaying Shared Library Dependencies Rebuilding the Library Cache

    o Managing Processes Understanding the Kernel: The First Process Examining Process Lists

    Using Useful ps Options Interpreting ps Output top: A Dynamic ps Variant jobs: Processes Associated with Your Session

    Understanding Foreground and Background Processes Managing Process Priorities Killing Processes

    Chapter 3 Configuring Hardwareo Configuring the Firmware and Core Hardware

  • GENERALITI ( 31 martie 2015 )

    Page: 25 of 45

    Understanding the Role of the Firmware IRQs I/O Addresses DMA Addresses Boot Disks and Geometry Settings Coldplug and Hotplug Devices

    o Configuring Expansion Cards Configuring PCI Cards Learning about Kernel Modules Loading Kernel Modules Removing Kernel Modules

    o Configuring USB Devices USB Basics Linux USB Drivers USB Manager Applications

    o Configuring Hard Disks Configuring PATA Disks Configuring SATA Disks Configuring SCSI Disks Configuring External Disks

    o Designing a Hard Disk Layout Why Partition? Understanding Partitioning Systems

    MBR Partitions GPT Partitions

    An Alternative to Partitions: LVM Mount Points Common Partitions and Filesystem Layouts

    o Creating Partitions and Filesystems Partitioning a Disk

    Using fdisk Using GNU Parted

    Preparing a Partition for Use Common Filesystem Types Creating a Filesystem Creating Swap Space

    o Maintaining Filesystem Health Tuning Filesystems

    Obtaining Filesystem Information Adjusting Tunable Filesystem Parameters Interactively Debugging a Filesystem

    Maintaining a Journal Checking Filesystems Monitoring Disk Use

    Monitoring Disk Use by Partition Monitoring Disk Use by Directory

    o Mounting and Unmounting Filesystems Temporarily Mounting or Unmounting Filesystems

  • GENERALITI ( 31 martie 2015 )

    Page: 26 of 45

    Syntax and Parameters for mount Options for mount Using umount

    Permanently Mounting Filesystems Chapter 4 Managing Files

    o Using File Management Commands File Naming and Wildcard Expansion Rules File Commands

    The ls Command The cp Command The mv Command The rm Command The touch Command

    File Archiving Commands The tar Utility The cpio Utility The dd Utility

    Managing Links Directory Commands

    The mkdir Command The rmdir Command

    o Managing File Ownership Assesing File Ownership Changing a File's Owner Changing a File's Group

    o Controlling Access to Files Understanding Permissions

    The Meaning of Permission Bits Special Permissions Bits

    Changing a File's Mode Setting the Default Mode and Group Changing File Attributes

    o Managing Disk Quotas Enabling Quota Support Setting Quotas for Users

    o Locating Files The FHS

    The FSSTND and FHS Important Directories and Their Contents

    Tools for Locating Files The find Command The locate Command The whereis Command The which Command The type Command

    Chapter 5 Booting Linux and Editing Fileso Installing Boot Loaders

    Boot Loader Principles

  • INSTALARE ( 31 martie 2015 )

    Page: 27 of 45

    BIOS Boot Loader Principles EFI Boot Loader Principles

    Using GRUB Legacy as the Boot Loader Configuring GRUB Legacy

    o GRUB Nomenclature and Quirkso Essential Global GRUB Legacy Optionso Essential GRUB Legacy Per-Image Options

    Installing GRUB Legacy Interacting with GRUB Legacy

    Using GRUB 2 as the Boot Loader Using Alternative Boot Loaders

    o Understanding the Boot Process Extracting Information about the Boot Process Locating and Interpreting Boot Messages The Boot Process

    o Dealing with Runlevels and the Initialization Process Runlevel Functions Identifying the Services in a Runlevel

    Basics of the /etc/inittab File The SysV Startup Scripts

    Managing Runlevel Services Checking Your Runlevel

    Checking and Changing Your Default Runlevel Determining Your Current Runlevel

    Changing Runlevels on a Running System Changing Runlevels with init or telinit Changing Runlevels with shutdown Changing Runlevels with the halt, reboot, and poweroff

    Commandso Using Alternative Boot Systems

    Configuring Upstart Using Upstart-Native Methods Using SysV Compatibility Methods

    Using systemdo Editing Files with Vi

    Understanding Vi Modes Exploring Basic Text-Editing Procedures Saving Changes

    EXAM 102 Chapter 6 Configuring the X Window System, Localization, and Printing

    o Configuring Basic X Features X Server Options for Linux Methods of Configuring X

    X Configuration Utilities The X Configurations File Format The X Configure-and-Test Cycle

    X Configuration Options

  • INSTALARE ( 31 martie 2015 )

    Page: 28 of 45

    Loading Modules Setting the Keyboard Setting the Mouse Setting the Monitor Setting the Video Card

    o Choosing the Drivero Setting Card-Specific Options

    Setting the Resolution and Color Depth Putting It All Together

    Obtaining X Display Informationo Configuring X Fonts

    Font Technologies and Formats Configuring X Core Fonts

    Preparing a Font Directory Adding Fonts to X's Font Path

    Configuring a Font Server Configuring Xft Fonts

    o Managing GUI Logins The X GUI Login System Running an XDMCP Server Configuring an XDMCP Server

    Configuring XDM Configuring KDM Configuring GDM

    o Using X for Remote Access X Client-Server Principles Using Remote X Clients

    o X Accessibility Keyboard and Mouse Accessibility Issues

    Standard Keyboard and Mouse Options Using Onscreen Keyboards

    Screen Display Settings Adjusting Default Fonts Adjusting Contrast Using Magnifier Tools

    Using Additional Assistive Technologies Configuring Linux to Speak Using Braille Displays

    o Configuring Localization and Internalization Setting Your Time Zone

    Setting a Linux Computer's Time Zone Setting an Individual Login's Time Zone

    Querying and Setting Your Locale What Is a Locale? What Is Your Locale? Changing Your Locale Modifying Text-File Locales

    o Configuring Printing

  • INSTALARE ( 31 martie 2015 )

    Page: 29 of 45

    Conceptualizing the Linux Printing Architecture Understanding PostScript and Ghostscript

    PostScript: The De Facto Linux Printer Language Ghostscript: A PostScript Translator Squeezing Ghostscript into the Queue

    Running a Printing System Configuring CUPS

    Editing the CUPS Configuration Files Obtaining CUPS Printer Definitions Using the Web-Based CUPS Utilities Printing to Network Printers

    Monitoring and Controlling the Print Queue Printing Files with lpr Displaying Print Queue Information with lpq Removing Print Jobs with lprm Controlling the Print Queue

    Chapter 7 Administering the Systemo Managing Users and Groups

    Understanding Users and Groups Understanding Linux Usernames Linking Users Together for Productivity via Groups Mapping UIDs and GIDs to Users and Groups

    Configuring User Accounts Adding Users Modifying User Accounts

    o Setting a Passwordo Using usermodo Using chage

    Directly Modifying Account Configuration Files Deleting Accounts

    Configuring Groups Adding Groups Modifying Group Information

    o Using groupmod and usermodo Using gpasswdo Directly Modifying Group Configuration Files

    Deleting Groupso Tuning User and System Environmentso Using System Log Files

    Understanding syslogd Setting Logging Options Manually Logging Data Rotating Log Files Reviewing Log File Contents

    o Maintaining the System Time Linux Time Concepts Manually Setting the Time Using NTP

  • INSTALARE ( 31 martie 2015 )

    Page: 30 of 45

    Understanding NTP Basics Locating a Time Source Configuring NTP Servers Configuring NTP Clients

    o Running Jobs in the Future Understanding the Role of cron Creating System cron Jobs Creating User cron Jobs Using anacron Using at

    Chapter 8 Configuring Basic Networkingo Understanding TCP/IP Networking

    Knowing the Basic Functions of Network Hardware Investigating Types of Network Hardware Understanding Network Packets Understanding Network Protocol Stacks Knowing TCP/IP Protocol Types

    o Understanding Network Addressing Using Network Addresses

    Addressing Hardware Managing IP Addresses Broadcasting Data Understanding Hostnames

    Resolving Hostnames Network Ports

    o Configuring Linux for a Local Network Network Hardware Configuration Configuring with DHCP Configuring with a Static IP Address Configuring Routing Using GUI Configuration Tools Using the ifup and ifdown Commands Configuring Hostnames

    o Diagnosing Network Connections Testing Basic Connectivity Tracing a Route Checking Network Status Examining Raw Network Traffic Using Additional Tools

    Chapter 9 Writing Scripts, Configuring Email, and Using Databaseso Managing the Shell Environment

    Reviewing Environment Variables Understanding Common Environment Variables Using Aliases Modifying Shell Configuration Files

    o Writing Scripts Beginning a Shell Script Using Commands

  • INSTALARE ( 31 martie 2015 )

    Page: 31 of 45

    Using Variables Using Conditional Expressions Using Loops Using Functions

    o Managing Email Understanding Email Choosing Email Software Working with Email

    Sending and Receiving Email Checkign the Email Queue

    Redirecting Email Securing Your Email Server

    o Managing Data with SQL Picking a SQL Package Understanding SQL Basics Using MySQL

    Starting to Use MySQL Creating Databases and Tables Storing Data Retrieving Data Combining Data from Multiple Tables Deleting Data Learning More About SQL

    Chapter 10 Securing Your Systemo Administering Network Security

    Using Super Server Restrictions Configuring inetd

    o Setting Up inetdo Controlling Access via TCP Wrappers

    Configuring xinetdo Setting Up xinetdo Controlling Access via xinetd

    Disabling Unused Servers Using netstat Using lsof Using Remote Network Scanners Examining Configuration Files Uninstalling or Reconfiguring Servers

    o Administering Local Security Securing Passwords

    Password Risks Choosing a Good Password Tools for Managing Passwords

    Limiting root Access Setting Login, Process, and Memory Limits Locating SUID/SGID Files

    o Configuring SSH SSH Basics

  • INSTALARE ( 31 martie 2015 )

    Page: 32 of 45

    Setting SSH Options for Your Computer Configuring Basic SSH Features SSH Keys Controlling SSH Access Copying Files via SSH Configuring Logins Without Passwords Using ssh-agent Using SSH Login Scripts Setting Up SSH Port Tunnels

    SSH Security Considerationso Using GPG

    Generating Keys Importing Keys Revoking a Key Encrypting and Decrypting Data Signing Messages and Verifying Signatures

  • INSTALARE ( 31 martie 2015 )

    Page: 33 of 45

    Chapter 1 Exploring Linux Command-Line Tools

    Understanding Command-Line BasicsUsing Streams, Redirection, and PipesProcessing Text Using FiltersUsing Regular Expressions

  • INSTALARE ( 31 martie 2015 )

    Page: 34 of 45

    Understanding Command-Line Basics

    Exploring Your Linux Shell OptionsUsing a Shell

    Starting a ShellUsing Internal and External CommandsPerforming Some Shell Command Tricks

    Exploring Shell ConfigurationUsing Environment VariablesGetting Help

    Exploring Your Linux Shell Options bash

    o The GNU Bourne Again Shell - bazat pe shellul Bourne din Unix darextins

    o este shellul default pe majoritatea distribuiilor bsh

    o shellul Bourne original, rar folosito uneori este un symbolic link ctre bash

    tcsho bazat pe un shell mai vechi, C shell (csh)o destul de popular, dar destul de diferit de bash

    csho shellul C original

    ksho The Korn Shello proiectat s ia ce e mai bun din bash i csh i s le extindo are o comunitate mic dar dedicat

    zsho The Z Shello la fel ca i ksh, ia idei i din alte shelluri i ncearc s le

    mbunteasc

    mai exist i altele, cu comuniti foarte mici bash este omniprezent, de obicei shellul default din sistem poate fi schimbat editnd contul de user (Capitolul

    7)

    fiierul /bin/sh este un link simbolic ctre shellul default (de regul bash) aceast practic permite s faci trimitere ctre un anumit shell la nceputul

    unui script (Cap. 9) i s stai linitit tiind c, chiar dac shellul default esteschimbat de utilizator, scriptul va fi totui executat de shellul specificat

    o lucru foarte important pentru scripturi care vor fi rulate potenial pealte computere

  • Instalarea pe un USB drive ( 31 martie 2015 )

    Page: 35 of 45

    Using a Shell principiul de utilizare al unui shell este simplu: tastezi o comand (urmat

    eventual de cteva opiuni), dai Enter, i computerul execut comanda cea mai mare parte a comenzilor din shell sunt externe: nu fac parte din shell exist totui cteva comenzi care sunt parte din shell i de aceea sunt destul

    de necesare (auto-complete, istoricul comenzilor, etc) comenzile specifice administrrii fiierelor i directoarelor este discutat mai

    pe larg n Cap. 4

    Starting a Shell

    dac te loghezi ntr-o interfa CLI (Command Line Interface) atunci eti dejan shellul standard al sistemului

    dac te loghezi ns ntr-o interfa GUI, shellul trebuie pornit manual asta se poate deschiznd un emulator de terminal, n care de obicei se

    deschide automat shellulo emulatorul nu este exact terminalul, i nici shellul: este doar un

    program care emuleaz interaciunea cu un terminal virtual n careruleaz shellul dorit

    o emulatorul poate fi deschis din meniuri sau cu una din comenzile xterm sau konsole (n funcie de sistem)

    Using Internal and External Commands

    comenzile interne dintr-un shell sunt de regul urmtoarele:o schimbarea directorului curent

    dac nu se specific altceva, shellul ncearc s lucreze cufiierele din directorul curent

    cd schimb directorul de lucru cd /home/sally trimite la folderul home al userului sally cd ~ trimite ctre folderul home al userului care a tastat

    comanda (dac e Sally, e echivalent cu cd /home/sally)o afiarea directorului curento afiarea unei linii de texto execuia unui programo temporizarea unei operaiunio setarea opiunilor de funcionare ale shelluluio nchiderea shellului

    Performing Some Shell Command Tricks

  • Instalarea pe un USB drive ( 31 martie 2015 )

    Page: 36 of 45

    Exploring Shell Configuration

    Using Environment Variables

    Getting Help

  • Instalarea pe un USB drive ( 31 martie 2015 )

    Page: 37 of 45

    Using Streams, Redirection, and Pipes

    Exploring Types of StreamsRedirecting Input and OutputPiping Data Between ProgramsGenerating Command Lines

  • Instalarea pe un USB drive ( 31 martie 2015 )

    Page: 38 of 45

    Processing Text Using Filters

    File-Combining CommandsCombining Files with catJoining Files by Field with joinMerging Lines with paste

    File-Transforming CommandsConverting Tabs to Spaces with expandDisplaying Files in Octal with odSorting Files with sortBreaking a File into Pieces with splitTranslating Characters with trConverting Spaces to Tabs with unexpandDeleting Duplicate Lines with uniq

    File-Formatting CommandsReformatting Paragraphs with fmtNumbering Lines with nlPreparing a File for Printing with pr

    File-Viewing CommandsViewing the Starts of Files with headViewing the Ends of Files with tailPaging Through Files with less

    File-Summarizing CommandsExtracting Text with cutObtaining a Word Count with wc

  • Instalarea pe un USB drive ( 31 martie 2015 )

    Page: 39 of 45

    Using Regular Expressions

    Understanding Regular ExpressionsUsing grepUsing sed

  • Instalarea pe un USB drive ( 31 martie 2015 )

    Page: 40 of 45

    Linux Professional Institute Certification

    LPIC-2 Study Guide, 3rd Edition, 2013

    EXAM 201 Chapter 1 System Startup and Advanced System Management Chapter 2 Linux Kernel Configuration Chapter 3 Basic Filesystem Management Chapter 4 Advanced Disk Management Chapter 5 Networking Configuration Chapter 6 DNS Server Configuration

    EXAM 202 Chapter 7 Advanced Network Configuration Chapter 8 Configuring File Servers Chapter 9 Configuring Web and Email Servers Chapter 10 Security Chapter 11 System Troubleshooting I: Boot and Kernel Problems Chapter 12 System Troubleshooting II: System Resources and the User

    Environment

  • Instalarea pe un USB drive ( 31 martie 2015 )

    Page: 41 of 45

    Extended Summary 200

    EXAM 201 Chapter 1 System Startup and Advanced System Management

    o Exploring the Boot Processo Booting Linux

    Configuring GRUB Configuring GRUB 2 Installing the GRUB Boot Loader Interacting with GRUB at Boot Time

    o Customizing System Startup Understanding Runlevels Configuring SysV Startup Scripts Configuring Upstart Checking Your Runlevel Changing Runlevels on a Running System

    o Compile and Install Programs from Source Understanding Source Code Issues Preparing Source Code Compiling Software Installing Software Uninstalling or Upgrading Software

    o Notify Users of System-Related Issues Setting Login Messages Sending Users Messages in Real Time

    Chapter 2 Linux Kernel Configurationo Understanding the Kernel

    Obtaining and Installing a Kernel Reading Kernel Documentation Locating Kernel Binaries

    o Preparing a Kernel Applying Kernel Patches Configuring the Kernel Source

    o Compiling a Kernel Building a Kernel Installing a Kernel Binary Installing Kernel Modules Preparing an Initial RAM Disk Preparing a Kernel Package Adding a Kernel to GRUB

    o Managing Kernel Modules at Runtime Obtaining Information About the Kernel and Its Modules Loading Kernel Modules Removing Kernel Modules Maintaining Kernel Modules

    Chapter 3 Basic Filesystem Management

  • Instalarea pe un USB drive ( 31 martie 2015 )

    Page: 42 of 45

    o Making Filesystems Available Identifying Filesystem Types Mounting a Filesystem Once Permanently Mounting Filesystems Using an Automounter Determining What Is Mounted Unmounting a Filesystem

    o Maintaining Filesystems Creating Filesystems Checking Filesystems for Errors Tuning Filesystems Manipulating Swap Space

    o Managing Optical Discs Linux Optical Discs A Linux Optical Disc Example Creating Cross-Platform Discs Reading and Writing UDF Discs

    o Managing Devices with udev Understanding udev Preparing to Create udev Rules Creating udev Rules Monitoring udev Activity

    Chapter 4 Advanced Disk Management Chapter 5 Networking Configuration Chapter 6 DNS Server Configuration

    EXAM 202 Chapter 7 Advanced Network Configuration Chapter 8 Configuring File Servers Chapter 9 Configuring Web and Email Servers Chapter 10 Security Chapter 11 System Troubleshooting I: Boot and Kernel Problems Chapter 12 System Troubleshooting II: System Resources and the User

    Environment

  • Instalarea pe un USB drive ( 31 martie 2015 )

    Page: 43 of 45

  • Instalarea pe un USB drive ( 31 martie 2015 )

    Page: 44 of 45

    Putty

    Pentru conectarea cu Putty la o main virtual VirtualBox deja existent se decide asupra unui nume pentru conexiune, de exemplu: linuxmint.dev

    (nu conteaz numele, e doar pentru referin) se adaug o linie n C:\Windows\System32\drivers\etc\hosts:127.0.0.1 linuxmint.dev

    o pentru ca orice referin ctre serverul linuxmint.dev s se ntoarcctre sistemul local

    o Windows va direciona conexiunea fcut ctre linuxmint.dev ctreIP-ul localhost, iar ca port va utiliza porturile definite n VirtualBox

    cu maina virtual nchis, se adaug urmtoarele setri n setrile mainii(clic pe maina virtual, Settings)

    o n Network se d clic pe Advanced... Port Forwardingo se creaz liniile necesare pentru:

    SSH Name: SSH Host Port: 2222 Guest Port: 22

    cnd vom conecta Putty la maina virtual, indicnd numele deserver ca linuxmint.dev, Windows va folosi portul 2222, iarmaina virtual va primi conexiunea pe portul 22

    n Putty se creaz o sesiune nou:o Host Name (or IP adress):

    folosim numele de user folosit cnd am instalat Linux @ host:[email protected]

    o Port: 2222o Saved Sessions:

    sandbox.devo click Save

    Pentru a ne loga n noul sistem cu Putty dup crearea sesiunii (vezi punctul anterior) putem s dm dublu-click pe

    numele sesiunii (linuxmint.dev) i vom fi conectai la maina virtual la prima conexiunea Putty afieaz un mesaj de avertizare c maina este

    necunoscut (ceea ce e normal) OK, i suntem n fereastra de logare, unde ne putem loga cu userul i parola

    create la instalarea mainii virtuale (sau care este default, dac a fost scoasde pe net(Ubuntu Server folosete ubuntu/reverse))

    Pentru logarea automat n noua main virtual pentru a nu ne fi mereu solicitate userul i parola, creem o cheie cu PuTTY

    Key Generator bifeaz (dac nu e deja) SSH-2 RSA click pe Generate mic cursorul peste aplicaie n mod aleatoriu pe durata generrii cheii

  • Instalarea de pe un USB drive ( 31 martie 2015 )

    Page: 45 of 45

    cnd e gata, nlocuiete n comment cu: [email protected] (nu eobligatoriu, e doar pentru a ti de la ce server este cheia)

    Save private key... (Yes pentru salvare fr passphrase) salveaz cheia PPK undeva la ndemn pe HDD, cu un nume oarecare, de ex.

    [email protected] NU NCHIDE PuTTY Key Gen!!!

    din PuTTY Key Gen, copie n Clipboard coninutul din fereastra Public key forpasting... (cu Select All)

    conecteaz-te cu PuTTY la sandbox.dev creaz n home/ un director de configurare ptr. SSH:mkdir .sshecho "....." >> .ssh/authorized_keys ntre ghilimele, n loc de ..... d Paste din Clipboard la coninutul cheii publice

    o Paste n Putty se d cu clic-dreapta Enterlogout nchidem PuTTY Key Gen dublu-click pe fiierul private.ppk (totdeauna nainte de a deschide PuTTY) deschide PuTTY dublu-click pe sesiunea sandbox.dev Succes: logarea se face acum n mod automat