Se ha denunciado esta presentación.
Se está descargando tu SlideShare. ×
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Cargando en…3
×

Eche un vistazo a continuación

1 de 29 Anuncio

Más Contenido Relacionado

Similares a Hands on presentatie (20)

Anuncio

Más reciente (20)

Hands on presentatie

  1. 1. Hands On LinuxHands On Linux
  2. 2. ● Inuits ● Open Source ● http://inuits.be ● Jan Vansteenkiste ● jan@inuits.be IntroductieIntroductie
  3. 3. Virtual BoxVirtual Box ● Virtuele Machine ● KVM ● Xen ● VirtualBox ● ... ● Virtual Box ● Installatie – Windows: http://<my.ip>/ – Linux: Afhankelijk van distributie ● Ubuntu: sudo apt-get install virtualbox-ose
  4. 4. Virtual BoxVirtual Box ● Aanmaken nieuwe Virtuele Machine ● Configureren nieuwe machine ● Installatie Linux
  5. 5. Installatie LinuxInstallatie Linux ● Partitionering: Uitsplitsen? ● /var, /boot, /home, /tmp, ... ● Netwerk instellingen ● Root wachtwoord (in ubuntu: gebruiker aanmaken & wachtwoord instellen) ● Installatie basis systeem ● Installatie van packages ● Kernel (/boot) ● Bootloader ● Grub / Lilo
  6. 6. Filesystem Hierarchy StandardFilesystem Hierarchy Standard ● Voorspellen locatie bestanden ● Software / OS ● Gebruikers ● Bestandsysteem ● Bestanden die kunnen gedeeld worden <-> Bestanden die NIET kunnen gedeeld worden ● Statisch <-> Variabel
  7. 7. Filesystem Hierarchy StandardFilesystem Hierarchy Standard ● / - 'root' filesystem – start punt voor alles ● /bin - 'binary' – uitvoerbare bestandeen (voor gebruikers) ● /boot - bestanden noodzakelijk voor booten (opstarten) ● /dev - 'devices' – speciale directory (niet aanpassen) ● /etc - '' - systeem configuratie ● /home - peresoonlijke files ● /lib - gedeelde libraries ● /lost+found – filesystem controle ● /media - verwijderbare media (usb disk, cdroms) ● /mnt - permanente mounts ● /opt - optional – externe software (bv java, ...)
  8. 8. Filesystem Hierarchy StandardFilesystem Hierarchy Standard ● /proc - kernel info / configuratie ● Voorbeeld: 'cat /proc/cpuinfo' ● /root - 'home' folder van root gebruiker ● /sbin - systeem binaries. Enkel beheerder heeft toegang ● /selinux- pseudo-filesysteem (zoals proc) voor selinux (security) ● /srv - plaats om bestanden aan te bieden door services ● /tmp - tijdelijke bestanden ● /usr - deelbare, -optionele) alleen-lezen data. Niet vereist om basis systeem werkend te krijgen. ● Verder onderverdeeld in: bin, lib, sbin, ... ● /var - 'variabel' – snel veranderende data ● /var/log - log bestanden ● /var/spool - nog te verwerken bestanden (mail bv) ● ...
  9. 9. RunlevelsRunlevels ● Linux opstarten: ● bootloader -> kernel ● init (/etc/inittab) – runlevels ● Runlevel bepaalt welke services opgestart worden ● Speciale runlevels: ● 0: halt (shutdown) ● 6: reboot ● 1: single user ● 5: start grafische interface
  10. 10. RunlevelsRunlevels ● /etc/init.d/ ● opstart scripts ● /etc/rc*.d/ ● runlevel configuratie ● symlinks (gebruik ls -l) ● Configuratie tools: ● rcconf ● service ● chkconfig (chkconfig -l -A)
  11. 11. ShellShell ● Text based - Terminal ● Shell: Bash ● Prompt (username / hostname / directory) ● Build in commands: – echo, exit, export, history, kill, ... ● Ctrl-c : afbreken ● Ctrl-r : zoeken in history
  12. 12. ShellShell ● Uitvoeren van commando's ● ls <opties> <argumenten> ls --help ls -la ● Bewegen door directory structuur ● Relatieve vs Absolute paden – '.' '..' – ~ – vb1: ../../folder vb2: /path/to/folder vb3: ~/folder/ ● Commandos: – pwd – cd – ls
  13. 13. ShellShell ● Hulp op de shell: ● commando --help ● man <commando> q - afsluiten /zoekstr - zoeken – Zoek op wat '-o' doet bij het 'ls' commando
  14. 14. ShellShell ● Bestand & Directory operaties ● mkdir - make dir ● touch - maakt lege bestanden aan ● cp - copy ● mv - move ● rm, rmdir - remove / removedir ● cat ● less, more cat bestand.txt | less ● find find . -iname *.log
  15. 15. ● Maak een volgende structuur aan (mkdir, touch) <home-folder><home-folder> `-- handson`-- handson |-- nog_een_folder|-- nog_een_folder | `-- bestand1| `-- bestand1 `-- voorbeeld`-- voorbeeld `-- sub`-- sub |-- file1|-- file1 |-- file2|-- file2 `-- file3`-- file3● Kopieer bestand1 naar bestand2 in dezelfde map ● ls /dev | more ls /dev | less (ls afsluiten met 'q')
  16. 16. Quick solutionQuick solution Sneller alternatief: mkdir -p handson/voorbeeld/sub mkdir handson/nog_een_folder Nog sneller: mkdir -p handson/{voorbeeld/sub,nog_een_folder} Bestanden aanmaken mbv (bash-)scripting for nr in `seq 1 3`; do touch handson/voorbeeld/sub/file$nr; done mkdir handson mkdir handson/voorbeeld mkdir handson/voorbeeld/sub mkdir handson/nog_een_folder touch handson/nog_een_folder/bestand1 touch handson/voorbeeld/sub/file1 touch handson/voorbeeld/sub/file2 touch handson/voorbeeld/sub/file3 cp handson/nog_een_folder/bestand1 handson/nog_een_folder/bestand2
  17. 17. Text EditorsText Editors ● vi (vim = vi improved) ● commando's: – esc - verlaat huidige mode – i - insert mode – x - wis karakter – dd - wis lijn dw - wis woord – :q - afsluiten :q! - geforceerd afsluiten (niet opslaan) – :w - opslaan :wq - opslaan en afsluiten (idem :x) ● nano ● toetsenbord combinaties onderaan: ctrl-?
  18. 18. Systeem commandosSysteem commandos ● ps ● kill ● top ● df ● du ● shutdown ● sudo (visudo!) su / su <user> sudo su <-> sudo su - ● which ● PATH variabele
  19. 19. Users / Groups and PermissionsUsers / Groups and Permissions ● Gebruikers ● User IDs / Group IDs ● /etc/passwd, /etc/shadow ● /etc/group, /etc/gshadow ● useradd, usermod, userdel, id, 'who am i', w – id root ● Permissies op filesystem: ● ID, GID (numeriek) ● Bitmask
  20. 20. PermissiesPermissies ● drwxr-xr-x 2 handson users 4096 Nov 4 08:07 folder ● r : read w : write x : execute (andere betekenis bij folders) ● <user><group><other> ● drwxr-xr-x - : normaal bestand d : directory l : symbolische link c : 'character' device (printer, tty) b : 'block' device (disk, cdrom)
  21. 21. Number Binary Rights 0 000 ­­­ 1 001 ­­x 2 010 ­w­ 3 011 ­wx 4 100 r­­ 5 101 r­x 6 110 rw­ 7 111 rwx Permissies: OctaalPermissies: Octaal
  22. 22. Permissies: AanpassenPermissies: Aanpassen ● chown - change owner chgrp - change group ● chmod - change file mode bits ● voorbeelden: ● chown handson bestand chgrp users bestand chown handson:users bestand chown :users bestand ● chmod 700 bestand chmod u=rwx,g-rwx,o-rwx bestand chmod a+w bestand
  23. 23. Software InstallatieSoftware Installatie ● RPM / DEB ● Ubuntu ~ debian ● DPKG ● .deb pakketten – binary of source ● hoofd pakket management tool ● APT - Advanced Package Tool ● Frontend voor dpkg ● Automatisch downloaden / installeren pakketten ● Aptitude
  24. 24. APTAPT ● /etc/apt/sources.list ● apt-get ● apt-get update ● apt-get upgrade ● apt-get install ● apt-get remove ● apt-cache ● apt-cache search
  25. 25. APTAPT ● Zoek een alternatief om runlevel(s) te configureren ● Installeer een van deze programmas ● Gebruik het programma om de cron daemon te starten (cron voert commando's uit op geconfigureerde tijdstippen)
  26. 26. NetworkingNetworking ● Configuratie ● Ubuntu maakt gebruik van 'NetworkManager' ● Manuele configuratie via 'ifconfig' – ifconfig -a - lijst alle interfaces ifconfig eth0 - toon configuratie van eth0 – ifconfig eth0 192.168.0.1/24 ● Automatische configuratie via dhcp – dhclient eth0 ● /etc/network/interfaces – Configuratie bij het opstarten
  27. 27. Systeem configuratieSysteem configuratie ● /etc ● Algemene Systeem Configuratie: – Debian: /etc/default – Redhat: /etc/sysconfig – ... ● Pakketten – /etc/apache2/ – /etc/cron* ls /etc/cron* – ...
  28. 28. Remote werken via SSHRemote werken via SSH ● Belang van Encryptie ● Onveilige protocollen: – telnet, ftp, http, pop3, imap – voorbeeld smtp login -> 'plain' password ● Veilige alternatieven: – ssh ftps, https, pop3s, imaps mbv ssl (Secure Socket Library) ● SSH ● ssh -l <user> <remote host> ● ssh-keys
  29. 29. ssh-keygenssh-keygen ● Aanmaken van een key pair: ● private key ● public key ● ssh-keygen – ~/.ssh/id_rsa – ~/.ssh/id_rsa.pub ● Inhoud id_rsa.pub naar remote host toevoegen aan bestand: – ~/.ssh/authorized_keys

×