Click here to load reader

Linux Network Administration (LPI-1,LPI-2)

  • View
    804

  • Download
    14

Embed Size (px)

Text of Linux Network Administration (LPI-1,LPI-2)

  • Linux Network Administration (LPI-1,LPI-2)

  • Mc LcChng 1: Gii thiu h iu hnh Linux 3Chng 2: Ci t CentOS 19Chng 3: Tp lnh cn bn 53Chng 4: Qun tr ngi dng 100Chng 5: Qun l h thng tp tin 120Chng 6: Qun l Boot loader 143Chng 7: Qun l cng 174Chng 8: Qun l tin trnh v dch v c s 191Chng 9: Ci t phn mm 244Chng 10: Ci t, cu hnh mng 261Chng 11: Network File System (NFS) 277Chng 12: FTP 290Chng 13: The Secure Shell (SSH) 302Chng 14: DHCP 312Chng 15: Domain Name System (DNS) 323Chng 16: Web Server 340Chng 17: Mail Server 347Chng 18: Samba 359Chng 19: Squid Proxy Server 377Chng 20: Linux Firewall 388Chng 21: Sao lu & Restore 403Bonus 417

  • Chng 1: Gii thiu

    H iu hnh Linux

  • Cc vn tho lun

    H iu hnh.

    Cc thut ng.

    Tho lun v h iu hnh Linux.

    Cc phin bn Linux.

    CentOS.

  • H iu hnh

  • Cc thut ngOpen Source:

    L loi phn mm cung cp lun c m ngun cho php ngi dng

    chnh sa m ngun theo nhu cu m khng phi tr mt loi ph no v

    bn quyn.

    Closed Source:

    L loi phn mm khng th mua c m ngun. Thng thng tr ph

    cho bn quyn l bt buc i vi mt s phin bn.

    Freeware:

    L mt loi phn mm Closed source min ph hon ton.

    Shareware:

    L mt loi phn mm Closed source khng cn tr ph mua nhng

    phi tr ph sau mt thi gian s dng n.

  • H iu hnh Linux l g?

    Mt phn mm m ngun m c y c im cacc h iu hnh khc.

    H iu hnh rt n nh, hiu nng cao v ang cpht trin bi hng trm ngn lp trnh vin trn ton th gii.

    Nhiu cng ty, t chc chnh ph s dng Linux.

    H iu hnh a tc v, a ngi dng.

    L h iu hnh h tr a nn tng v trn nhiu loing dng mng.

  • Lch s v H iu hnh Linux

  • Gii thiu v H iu hnh Linux

    Open Source Software Multiuser Multitasking Network support

  • nh ngha cc phin bn Linux

    Phin bn ca mt h iu Linux c nh nghada trn Linux kernel version gm 2 thnh phn:

    Major numberMinor number

    V d: CentOS 6.4 kernel 2.6Ubuntu 13.10 kernel 3.2

  • u im ca LinuxRisk reduction: Gim thiu ri ro.

    Meeting business needs:Khng b rng buc v tnh thng mi v vn bn quyn c gii quyt.

    Stability and Security: n nh v bo mt.

    Flexibility for different hardware platforms:Uyn chuyn tng thch vi nhiu loi phn cng.

    Ease of customization: D dng iu chnh sa cha.

    Ease of obtaining support: d dng h tr khi gp s c.Cost reduction: Gim thiu v mt chi ph.

  • Linux s dng dng lm g?

    Web Hosting. Softwares Development. File and Print services. Document Publishing. E-mail Servers. Database Servers. Network Routers. Workstations.

  • Tnh n nh ca Linux

    D dng qun l khi cng vic s ca mi trngkinh doanh hin nay.

    My tnh s dng Linux c th hot ng n nh nhFTP server, Web server, Mail server, DNS server.

    Khng khi ng li my sau khi ci t cc phm mmv cc dch v mi vo.

    D dng khi phc hot ng khi gp s c v mt in.

  • Bo mt

    M hnh open source cho php cc chuyn gia kim trasource code trc khi pht hnh.

    Khi li tm thy, nhm cc nh lp trnh vin thuc cngng m ngun m trn th gii s khc phc li ngay.

    Virus hu nh khng tn ti trn Linux.

    Mt h iu hnh cc k n nh v c h tr nhiu loitng la chuyn dng khc nhau.

  • Cc phin bn Linux

    Red Hat Linux. SuSE Linux. Slackware Linux. Debian Linux. Turbo Linux. Mandrake Linux.

    www.distrowatch.com

  • CentOS

    CentOS l g?L h iu hnh pht trin da trn nn nhn Red Hat(bn thng mi) tuy nhin CentOS hon ton min ph.

    V sao s dng CentOS? Mang y tnh nng ca mt h thng Linux. Hu ht cng ng m ngun m u tin dng. Tnh n nh cao v kh nng sa li d dng khi c s c. c s dng rng ri trong hu ht cc cng ty ln nhtrn th gii.

  • CentOS

  • Hi & p

  • Chng 2: Ci t CentOS

  • Cc vn tho lun

    Ci t CentOS.

    Chia phn vng cng.

    Demo ci t.

    Shells. Terminals. Kernel.

  • Cc cch ci t

    Ci t mt FTP server qua mng.

    Ci t HTTP Web server qua mng.

    Ci t NFS server qua mng.

    Ci t SMB server qua mng.

    Ci t Virtual Network Computing (VNC) qua mng.

    Ci t nhng gi phn mm trn a cng.

  • Tin hnh ci t

    - Chn ngn ng, ngn ng bn phm, chut, mn hnh.- Chn cch ci t.- Chia partition.- Cu hnh Boot Loader.- Cu hnh mng v tng la.- Chn ngn ng h thng v mi gi.- To ngi dng root (ngi dng ti cao).- Chn cc gi ci t ph hp vi mc ch s dng.- Hon tt ci t.

  • Ci t CentOS

    Tho lun v vn chia phn vng:/boot: t 100MB n 200MB.swap:

    Nu RAM 4GB: Swap = 16GB.** i vi server Oracle: Swap >= 24GB.

    / : Phn cn li ca cng.

    Cu hi: Ti sao phi chia li partition m khng h thngt chia?

  • V d phn vng mc nh

  • Cu hnh Bootloader

    - GRand Unified Bootloader (GRUB).- Boot Record (MBR).- First hard disk sector.

  • Shells - Terminals - Kernel

  • Terminals

  • Thc hnh ci t CentOS

    Demo Ci t.+ Ci t qua giao din ha.

    + Ci t qua text mode.

    Hc vin thc hnh ci t trn my cc phin bn CentOS.

    Bi tp lm thm: Hc vin th ci t cc Distro khc nh:Ubuntu, Fedora, OpenSUSE, Backtrack.

  • Demo Ci t

    Boot t CD CentOS

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

  • Demo Ci t

    Chng ta chn nhng gi ci t cn thit cho server.

  • Demo Ci t

    Bt u ci t.

  • Demo Ci t

    Sau khi ci t thnh cng Mn hnh login u tin ta s thy:

  • DEMO khi phc password user root.DEMO cch tt tng la.

  • Hi & p

  • Chng 3: Tp lnh c bn(Command Line)

  • Cc vn tho lun

    Gii thiu Command Line. Gii thiu h thng tp tin. Qui c t tn & ng dn. Lm quen vi cc tp lnh c bn. iu khin cng vic. Bin mi trng. Link. Son tho vn bn vi vi. Restart & shutdown.

  • Bn tng xem qua cc super hacker thao tc th notrong cc b phim?

    CLI (Command Line Interface) l cch tt nht, nhanh nht ngi qun tr thao tc vi my tnh.

    3 Nguyn tc khng th thiu ca mt ngi qun trh thng gii cn phi c:

    - Lm ch hon ton Command Line.- T ng ha tt c.- Sao lu ton b d liu.

    Lazy sysadmin is the best sysadmin Anonymous

    Ti sao s dng Command Line?

  • Shell l mt chng trnh gip ngi qun tr chuyn ccthao tc ln bn phm xung cho h iu hnh bit phi lmg.

    Hu ht tt c cc phin bn Linux u s dng chng trnhshell t d n GNU c gi l bash.

    Shell l g?

  • Filesystem Hierarchy Standard (FHS):

    /bin Cc lnh c bn cho tt c ngi dng.

    /boot Cha kernel v cc file s dng cho vic boot.

    /dev Cha cc khai bo v thit b.

    /etc Cha cc file cu hnh h thng v cc ng dng.

    /home ng dn mc nh cha th mc ngi dng.

    /lib Cha cc th vin dng chung.

    /mnt L mt th mc rng s dng cho vic mount.

    Gii thiu h thng File trn Linux

  • /proc Thng tin process v kernel.

    /opt Cha cc chng trnh phn mm thm vo.

    /root Th mc ca ngi dng root.

    /sbin Cha cc tp lnh qun tr.

    /usr Cha nhng tp lnh ca cc ng dng.

    /tmp Cha d liu tm.

    /var Cha cc File log.

    Gii thiu h thng File trn Linux

  • - Ti a 255 k t, dng bt k k t no, k c k t c bit.

    V d: Very ? long - file + name . test

    - Tp tin (th mc) n c bt u bng du chm .

    V d: .bash_history

    Qui c t tn

  • ng dn tuyt i: bt u bng /

    V d : / /bin /usr /usr/bin

    ng dn tng i: khng bt u bng /

    V d: etc/httpd/ usr/bin

    ng dn t bit:.. - th mc cha.. - th mc ang lm vic.~ - th mc home ca ngi dng hin hnh.

    V d: Nu ngi dng ang th mc /etc, mun tham chiu n tp tin/etc/vsftpd/vsftpd.conf th ng dn tng i s l ./vsftpd/vsftpd.conf

    ng dn

  • Chuyn ngi dng (Switching Users): su$ su# su pqdung$ su vnlamp

    Kt thc mt Terminal Session:#exit

    Lm quen cc lnh c bn

  • C php: command [flags] arg1 arg2 arg3

    Cc thnh phn cch nhau mt khong trng.

    Cc c thng theo sau du - hoc -- (nht l cc c nhiu k t).V d: #ls -a -l -F hoc #ls --color

    Nhiu c c th dng chung mt k t -.V d: ls -al tng ng ls -a -l Mt s lnh c bit, khng cn k t - trc cc c. Mun xem tr gip dng tham s --help hoc man.

    V d: ls --help hoc man lsGhi ch: C kh nhiu loi shell trn Linux, kim tra ang dng loishell no:echo $SHELL

    C php lnh

  • Tn tp tin hoc th mc lm tham s dng lnh c th dngkhng tng minh.

    Trn Linux khng phn bit phn ui m rng.

    Dng k t thay th cho mt phn hoc ton b tn.* : mi chui k c rng? : mt k t bt k[aeg] : tng ng vi mt trong cc k t a,e,g[a-h]: mt k t trong khong a h[^abc]: khng phi a,b,c\ : loi b ngha c bit ca cc k t *,?,)

    K t thay th

  • Nhn t ng in y dng lnh:$ cd /usr/lo (/usr/local)$ cpcp cpp cpio cproto$ cd dirdir1 dir2 dir3

    T ng in dng lnh

  • Cc lnh gip Help:#man#help

    Lnh thao tc cc th mc v ng dn:#pwd In th mc ang lm vic.#cd Thay i th mc.#ls Lit k th mc.

    Cc lnh thng s dng

  • #mkdir To th mc.#mv Di chuyn.#cp Sao cho.#alias To lnh thay th.#rm Xa file v th mc.#rmdir Xa th mc rng.#file Xc nh loi file.#touch To file rng.#tee Va xut kt qu ra mn hnh va xut vo file.

    Cc lnh thng s dng

  • #cat Xem ni dung file.#tac Ngc li ca cat.#head Xem cc dng u tin ca file.#tail Xem cc dng cui ca file.#wc m s dng, s t hoc s byte ca file.#nl nh s dng ca file.#grep Tm kim ni dung.

    #updatedb Cp nht cc thay i ca c s d liu h thng.#locate Tm kim file.

    **Ch : #tail -f xem log ng.

    Cc lnh x l chui

  • Cho bit ngi dng ang ti th mc no:#pwd

    Chuyn th

Search related