37
RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: Look at the latest objectives for the exam. Remember the commands required. If you don't understand a slide, take that as a clue that you need further study, or contact us. Practice, practice, practice!

RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

RHCE Study Notes

● Systemnotes.org, RedHat Linux Flash Cards● Stuff to remember:

– Look at the latest objectives for the exam.– Remember the commands required.– If you don't understand a slide, take that as a

clue that you need further study, or contact us.– Practice, practice, practice!

Page 2: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Boot Single

● boot into single user mode● at grub screen, "a", "space", "1", enter

Page 3: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Network Configuration

● system-config-network● Files

– /etc/sysconfig/network-scripts/ifcfg-eth0– /etc/sysconfig/network

Page 4: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Hostname Resolution

● /etc/resolv.conf● /etc/hosts

Page 5: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

X Window System

● /etc/X11/xinit/xinitrc.d● /etc/X11/xorg.conf● /etc/inittab● system-config-display● /tmp and /home have enough space● Ctrl-Alt-F1 to F8● Ctrl-Alt-Backspace

Page 6: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Hard Disk Commands

● fdisk /dev/hda● partprobe● mdadm -C /dev/md0 -l 5 -n 3 /dev/hda6

/dev/hda7 /dev/hda8● mke2fs -j /dev/md0● e2label /dev/hda2 /data● mount -t ext3 /dev/hda7 /data7

Page 7: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Configure Printing

● system-config-printer● /etc/cups/cupsd.conf● lpadmin● lpstat, lpq● reject disable● accept /usr/bin/enable

Page 8: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Cron and at Jobs

● copy script to /etc/cron.daily, /etc.cron.monthly, etc. or

● Modify /etc/crontab: crontab -e● List cron jobs: crontab -l● Add an at job: at [-f file] TIME● View at queue: atq● Remove at jog: atrm job

Page 9: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Install NIS or LDAP

● Install ypbind, portmap● system-config-authentication

– check: Enable NIS Support, or Enable LDAP Support

– click: Configure NIS..., or Configure LDAP...● configure firewall, if required

Page 10: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Test NIS or LDAP

● ypwhich● nisdomainname -y● genent services● getent passwd smith● rpcinfo -p

Page 11: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

NIS or LDAP Files

● /etc/yp.conf● /etc/sysconfig/network● /etc/pam.d/system-auth● /etc/nsswitch.conf

Page 12: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Configure autofs

● /etc/auto.master– /home/guests /etc/auto.guests --timeout=60

● /etc/auto.guests– * -rw,soft,intr server1:/home/guests/&

● service autofs restart● chkconfig portmap on● chkconfig autofs on

Page 13: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Manage Users, and Groups

● groupadd -g 1000 groupname● useradd username● usermod -G groupname username

– (-G for primary group)

Page 14: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Manage Quotas

● quotacheck -cuf /home● quotaon /home● edquota username● quota username● repquota /home

Page 15: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Filesystem Permissions

● mkdir -p /depts/finance● chgrp sales /depts/finance● chmod 770 /depts/*● chmod g+s /depts/*● chown sam /depts/managers● ls -l /depts/

Page 16: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Install and Update rpms

● rpm -ivh filenamex.i386.rpm● rpm -Uvh filenamex.i386.rpm● Verify an RPM:

– rpm --import /usr/share/rhn/RPM-GPG-KEY– rpm -K /tmp/rpmversion.i386.rpm

Page 17: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Install from yum Repository

● /etc/yum.conf● /etc/yum.repos.d/

Page 18: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

System Bootloader

● /boot/grub/grub.conf● # root (hd0,0)● # kernel /vmlinuz-version ro root=/dev/vg00/lv00

crashkernel=128M@16M● # initrd /initrd-version.img

Page 19: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Implement Software RAID

● partprobe● mdadm -C /dev/md0 -l 5 -n 3 /dev/hda6

/dev/hda7 /dev/hda8● mke2fs -j /dev/md0● /etc/fstab● mdadm --detail /dev/md0● fail, recover, add:● mdadm /dev/md0 -a /dev/sda1

Page 20: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Set Kernel Run-time Parameters

● vi /etc/sysctl.conf– xxx.xx.xxx=1

● sysctl -p● sysctl -a | grep xxx

Page 21: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Diagnose and Correct Boot Failures

● /etc/rc.d/rc.sysinit● /etc/rc.d/rc adn /etc/rc.d/rc?.d● /etc/rc.d/rc.local● /boot/grub/grub.conf● filesystem● /etc/fstab● fsck /dev/hda

Page 22: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Create a Logical Volume

● First create physical volume, then volume group, then logical volume

● PV -> VG -> LV● pvcreate /dev/hda6 /dev/hda7 /dev/hda8● vgcreate vg0 /dev/hda6 /dev/hda7● lvcreate -L 500M -n data0 vg0● ext2online /dev/vg0/data0

Page 23: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

SELinux

● getenforce● setenforce 1● check context with ls -Z● chcon -R --reference /var/www/html

/var/www/html/wwwnew

Page 24: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Configure HTTP

● install httpd● modify /etc/httpd/conf/httpd.conf file● service httpd restart● chkconfig httpd on● service httpd configtest

Page 25: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Configure Samba Share

● Install samba● vi /etc/samba/smb.conf● configure firewall

Page 26: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

NFS

● Modify /etc/exports ● start nfs & portmap● verify config, & check mounts

– exportfs -v– showmount -e localhost– rpcinfo -p localhost

● service nfs reload

Page 27: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Automount

● mkdir /net● vi /etc/auto.master● start services -- portmap, autofs

Page 28: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

FTP

● install vsftpd● create incoming directory

– mkdir -p /var/ftp/incoming● vi /etc/vsftpd/vsftpd.conf● start vsftpd

– service vsftpd start

Page 29: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Web proxy

● Install squid, and start the service● vi /etc/squid● service squid reload● Configure browser to test

Page 30: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

SMTP

● Install sendmail, sendmail-cf, sendmail-doc● modify /etc/mail/sendmail.mc● m4 sendmail.mc > sendmail.cf (or make)● service sendmail restart

Page 31: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

IMAP, IMAPS, and POP3

● install dovecot● vi /etc/dovcot.conf

– protocols = xxx● service dovecot restart● chkconfig dovecot on

Page 32: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

SSH

● /etc/ssh/● ~/.ssh/

Page 33: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

DNS

● Install bind, bind-utils, and caching-nameserver● vi /etc/named.conf● To verify:

– named-checkconf– named-checkzone example.com

example.com.zone● Check /etc/resolv.conf on client machines

Page 34: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

NTP

● /etc/ntp.conf● ntpstat● service ntpd restart

Page 35: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Firewall

● /etc/sysconfig/iptables● iptables -L● iptables -F● service iptables save● service iptables restart● chkconfig iptables on

Page 36: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

PAM

● /lib/security/● /etc/pam.d/

Page 37: RHCE Study Notessystemnotes.org/download/rhce/RHCE-Flash-Cards.pdf · 2011-04-16 · RHCE Study Notes Systemnotes.org, RedHat Linux Flash Cards Stuff to remember: – Look at the

Configure Service

● Install RPM– rpm -ivh servicename.rpm

● Modify Configuration and FirewallStart Service

– service servicename restart● Set Service to Start on Reboot

– chkconfig servicename on