Вы находитесь на странице: 1из 13

SYSTEMD BOOT TARGET

1. Rd.break:beaks to an interactive shell while still in the initrd,allowing interaction


Before the system disk is mounted

2. Emergency : similar to rd.break but mounts the systemdisk


3. Rescue: equivalent to the old single usermode,where some service are started and disks mounted

Root password forgot


grub>ls
grub>cat
grub>search.file /grub2/grub.cfg
grub>cat (hd0.msdos1)/grub2/grub.cfg
rd.break
swith_root:/ ls
ls /sysroot/
cat /sysroot/etc/fstab
# mount -o rw,remount /sysroot/
Chroot /sysroot
Password for user root
Root
Touch /.authorelabel
Exit
Swithch_root:/ remount ro,remount /sysroot
Sithch_root :/ mount –o ro,remount /sysroot

Control-d to conti:

Emergency /boot/file
Control-d to conti:
-
Managing Individual Processes
Process listing
1. Top command will output a continually updating list of process
2. Kill signals : kill signals are inter process communication kill –l
3. Pgrep :its showing process id
4. Niceness:The priority a given process is assigned it is “nice level”
a. Example ps axo pid,nicelvel,command
b. Renice –n -20 6053
c. Renice –n -20 $(pgep httpd)
5. Top and w and uptime : load average all display something labeled “load average” Lecture:
Lecture: Configure Local Storage
Create physical volume
i. Pvcreate /dev/sda1 /dev/sd2 /dev/sda3
ii. pvdisplay
6. Create volume group
i. Vgcreate myvg /dev/sda1
ii. Vgdisply
7 create logical volume
 -Lvcreate -L 100m myvg –n firstlv
 Mkfs.xfs /dev/myvg/weblv
 Mkdir /mnt/web
 Mount /dev/myvg/wedlv /mnt/web
 Df –h
 blkid
Lecture: Network File Systems
NETWORK file system is a way f mounting directories over a network
a. mkdir /nfs
b. chmod 77 /nfs
c. vi /etc/exports
d. /nfs *(rw,
e. Systemctl start {rpcbind,nfs_server,rpc-statd,nfs-idmapd}
f. Showmout –e localhost
g. Exportfs -a
h. Systemctl start rpcbind
i. client
j. Rpm –q nfs-utils
k. Showmount -e 172.131.119 .211
l. Mount -t nfs 172.31.119 :/nfs /mnt/nfs
m. Cd /mnt/nfs
n. Touch file
o. Ls
Lecture: Network Configuration
There are lots of ways to configure network devices.
Nmcli:
1. yum insall bash-completion –y
2. ll /sys/class/net
3. Nmcli dev status
4. Nmcli con show
5. Ll /etc/sysocnfg/network-scripts/ifcfg-
6. Nmcli con add con-name mycon autoconnect no type enthenet ifname et1
7. Nmcli con show
8. Nmcli con up mycon
9. Nmcli con show –active
10. Nmcli con down mycon
11. Nmcli con add con-name mycon autoconnect no type enthenet ifname eth1 ip4 gw 10.0.0.1
The main difference between ip and ncmli is thatchanges made with the ip command are not
persistent
12. Ip its shows ip address
13. Ip addr add 10.0.0.2 dev etho0
14. Ip a s
15. Ip addr del ip adres
16. Cat /etc/resolve.config (name sever shows) DNS is the foundation of the internet
17. Nmcli con mod system\ eth0 –ipv4.dns 8.8.8.8
18. Nmcli con mod system\ eth0 +ipv4.dns 8.8.8.8
19. Cat /etc/resov.conf
20. Host www
21. DNS Resoultion
a. /etc/nsswith.conf
b. /etc/hosts
i. 10.0.050 www www.linux.com
ii. Nslookup ww
Lecture: Network Time Protocol
22. Time is important for more than just counting days until
a. Timedatectl we use to mange things hving to do with date
b. Timedatectl set-timezome (set time zome)
c. Set-ntp –trun ntp
d. Clock skew
e. Ntp service
i. Chrony (NTP on your server)
ii. Systemctl status chrony
iii. Systemctl status chrony –l
iv. Chrony c tracking
v. Chronyc sources –v
Lecture: Modifying the System Bootloader
23. Uname –a kernel information
24. Yum list kernel
25. Rpm –qa | grep kernel-[1..10]
26. Grubby –info=all
27. Grub2-set-defalut
28. Grubby --set-default 2
29. Grubby –set-default-index
30. Uname –a
31. Grubby –set-default –index 0
Lecture: Updating and Installing Packages
32. Rpm(RED HAT PACKAGE MANAGER) How software is installed on redht server
a. I insall and h give progess information v- verbose U-Upgrde e-erse
33. YUM (yellow dog update manager) software repositories
a. Yum repolist
b. Yum install epel(noting to do
c. Yum search httpd
d. Cd /etc/yum.repo.d/
e. Vim centos-base.repo
f. Vi epel-repo
Lecture: Manipulating User Accounts
1. Id
2. Id cloud_user
3. Grep cloud_user /etc/password
4. Grep cloud_user /etc/shadow
5. Etent psswor cloud_user
6. Getent shadow cloud_user
Lecture: Configuring the Firewall
1. Yum instll firewalld firewall –config –y
2. Systemctl restart firewalld
3. Systemctl restart httpd
4. Curl localhost
5. Second server curl –k 10.0.0.120
6. Firewall-cmd –get-zones
7. Firewall-cmd –get-default-zone
8. Firewall-cmd –list-all ==zone=public
9. Firewall-cmd –add-serice=httpd
10. Firewalld-cmd –list-all
11. Firewall-cmd –reload
12. Firewall-cmd –add-port=80/tcp --permanet
13. Firewall-cmd –list-all
14. Firewall –reload
15. Rpm –q xorg-x11-apps
16. Ssh –Y CLOUD_USER@REBOARTIC
17. EXPORT XAUTHORITY=/HOME/CLOUD_USER/.XAUTHORITY
18. Sudo firewall-conig
Lecture: Disk Compression (Virtual Disk Optimizer)
Virtual data optimizer(vdo) is a method f providing deduplication, compression and thin provisioning
VDO Device-similar to how LVM works (although LVM Can then be layered on top of VDO)
(ONLY IF PHYSICAL STORAGE IS 16TB OR GREATHER)
For the VDO logical size your should use 10 times multiplier of your physical space if the deivce will be a vm
container storage or 3 time for other object storage
1. VDO does have some memory requirements ram 268MB
2. Fdisk –l
3. Yum install vdo kmod-kvdo
4. Systemcl start vdo.service
5. Vdo create –name=myvdo –device=/dev/nvmeln1 –vdologi calsize=
=60gb –deduplication=disabled
6. Mkfs.xfs –k /dev/mapper/myvdo
7. Udevadm settle
8. Mkdir /mnt/vdo
9. Mount /dev/mapper/myvdo /mnt/vdo/
10. Df -h
11. Vdostats
12. Vdostats ---human-readable
Lecture: Using the AppStream (yum modules)
1. The AppStream is a new tool added by Red Hat in RHEL8. It allows admins to install different versions of
popular software, in addition to different profiles for different packages (for example, a
minimal httpd server)
2. Yum install postgresql
3. Yum module enable postgresql:9.6(before 10 versin now 9 version)
4. Yum install postgresql
5. Yum module list
6. Managing process schedulers
a. Chrt –p <pid>
b. Chrt -f –p <pio> <pid>
Lecture: AutoFS
1. AutoFS can mount network shares only when they're being used, and dismount them when
they aren't.
2. Nfs server /etc/auto.master
3. /mis/ /etc/auto.misc –timeout 60
Lecture: Extending Virtual Disks (LVM/VDO)
1. Pvcreate /dev/sdc1
2. Vgextend vdodevo /dev/nvme31
3. Lvextend –r –l + 100% free /dev/vdodev/vdolv
4. Vgdisplay
5. Vdostats
6. Vdostats –human-readable
7. Vdo growphysical –name=LA
8. Vdostats –human-reable
9. Df –h
10. Vdo growlogical –name=LA –vdoLogicalsize=180g
11. Vdostatus –human-reable
12. Df –h
13. Xfs_gowfs /mnt/vdo
14. Df –h
Learning Objectives
check_circleAdd the /dev/nvme3n1 disk to the vdoLV Logical Volume.keyboard_arrow_up
This task has multiple steps.
1. pvcreate /dev/nvme3n1
2. vgextend vdoDev /dev/nvme3n1
3. lvextend -l +100%FREE /dev/vdoDev/vdoLV
check_circleExtend the VDO Physical Disk to 60GB, and the Logical Size to 180GBkeyboard_arrow_up
To extend the physical size, we'll run:
vdo growPhysical --name=LA

And this will extend the Logical size:

vdo growLogical --name=LA --vdoLogicalSize=180G

check_circleGrow the XFS filesystem to match the underlying VDO diskkeyboard_arrow_up


All we have to do here, in order to grow the underlying filesystem, is this:

xfs_growfs /mnt/vdo

Understand and employ general methods for troubleshooting


1.collect system information to aid trobleshoot
a. uptime
b. df -h
c. free –m
d. top
e. ss -lntp
f. ss –lnup
g. ps aux –sort –pcpu | head
h. yum install –y lsof
i. lsof –i
j. yum install –y pcp pcp-system-tools (performance co-pilot)
k. systemctl enble pmcd && systemctl start pmcd
l. pmstat (load and swap usage)
m. pmval,pmifo (metric information)
n. pmval(mertric value)
o. pcp atop (top substitute)
p. pmstat –t 1s
q. pminfo –t (process information)
r. pcp atop (system and process )
s. ./cpuhog.sh & ./iohog.sh
t. Pmstat
u. Fallocate –l 50G somefile(space device_
v. Fallocate –l 7G somefile
w. Du –h –max-depth=1
x. Cd /root /
y. !d
Lecture: Consult documentation resources to aid in troubleshooting
2. Find /usr/share/doc -iname examples –type d –print
3. Yum whatprovides pcp
4. Yum whatprovides repo
5. Repoquery –l httpd
6. Repoquery –l httpd | grep /usr/share/doc
7. Lsblk(block device)
8. Yum search crypt
9. Yum whatprovides ldap
10. Yum search ldapsearch
Lecture: Monitor systems for vital characteristics
11. Yum whatprovides pmlogger
12. Yum makecache (error )
13. Yum provides pmlogger
14. Repoquery –l pcp | grep sysemd
15. Systemctl enable pmcd & systemctl start pmd
16. Yum search pmc
17. Yum install –y pcp-systemtool
18. Systemctl enble pmlogger & systemctl start pmlogger
19. Systemctl show pmlogger
20. ll /var/log/pcp/pmlogger/ip-
21. pminfo –t list of metrics
22. pmval <metric>
23. pcp <logfile>
Lecture: Configure systems to send log messages to a centralized host
1. rssyslog
2. systemctl status rsyslog
3. vi /etc/rsyslog (client)
a. uncomment actionquemax diplca(search remote)
b. *.*@10.0.1.10 :514(client side)
c. Systemctl resart rsyslong
d. Yu m install telnet
e. Telent 10.0.1.10 (client side connect server)
f. Server side
i. Stemplate dynfile “/var/log/system-%HOSTMAE%.LOG”

Diagnose and troubleshoot system start up issues


Lecture: Identify and resolve service failures affecting boot
1. Systemctl status debug-sheel
2. Systemctl list-jobs
3. Yum install bash-completion
4. ./etc/profile
5. Mkdir /etc/systemd/sysinit.target.wants/dubug-shell.service
6. Ln –s /usr/lib/system/system/debug-shell.serice /etc/systmd/sys
7. Rm –rf /etc/systmed/system/sysiniti.target.wans/debug-shell.serv
8. Pcp atop
9. Systemctl status pmcd.service for details
10. Systemcl status –1 pmcd
11. Systemctl list-depandencies pmcd
12. Vi /etc/system/sysem/pmcd.servic.d/dependcey.conf
13. Systemctl status -1 pmlogger
14. Systemctl start pmlogger
15. Vi /etc/systmed/system/pmlogger.servie.d/depenc.conf
16. V I /etc/system/system/pmcd.service./depencey.cof
Lecture: Regain root control of a system
1. Vim -R /boot/grub2/grub.cfg
2. Shudow –r
3. –e edit
4. Vmlinuz-3.0 in the last line rd.break
5. Swith_root:/ # mount –oremount.,rw/sysroot/
6. Chroot /sysroot/
7. Password
8. Load_policy –I && retorecon –RV /etc
9. Touch /.autorelable (followed by a rreboot (8 and 9 reboot after [ctl+d]
Lecture: Troubleshoot boot issues
1. ll / boot/grub.cfg
2. rm -rf /boot/grub2/grub.cfg
3. getting eror grub>
4. troubleshooting opting ->secue
5. click 1 continue
6. please press to get sheel;>
7. chroot /mnt/sysimages/
8. grub2-mkconfig –o /boot/grub/grub.cfg
9. vim -R /BOOT/GRUB2/GRUB.CONFG
10. (KERNAL PANIC ERRO)
a. VIM /BOOT/GRUB2/GRUB.CONFG
b. COPY LINUX16 .IMG LINE AND PAST BEFORE VMLINUZ
c. Restart
d. Start in rescue
e. Select in rescue
f. Logn and password
g. Grub2-mk
h. Grub2-mkconfig -o /boot/grub2/grub.cfg
i. ----------------------------------------------------
j. Grub-install getting erro
Lecture: Identify hardware and hardware problems
1. Cpu
a. Cat /proc/cpuinfo or lscpu
2. Hardware-> dmidecode
3. Disks  lsscsi && lsblk
4. Pci -> lspci
5. Usb lsusb
6. Yum whatprovides */clici
a. Troubleshotting hardware
i. Yum install mcelog
ii. Systemctl enable mcelog && systemctl start mcelog
iii. Hardware errors will be available via journalctl
b. Memory test
i. Yum install memtest86+
ii. Memtest –setup
iii. BIOS # GRUB-MKCONFIG –O
/BOOT/GRUB2/GRUB.CFG
iv. UEFL# GRUB-MKCONFIG –O
/BOOT/EFI/EFI/REDHAT/GRUB.CFG

Diagnose and troubleshoot file system issues


Lecture: Recover corrupted file systems
1.  filesystem repair utilities such as xfs_repair and e2fsck are critical in recovering filesystems back to a
mountable state.
2. Lsblk
3. Mkfs.xfs /dev/xvdg1
4. Mkfs.ext4 /dev/xvdg2
5. Mkdir /storage1 /storage2
6. Mount –t xfs /dev/xvdg1/stroage1
7. Mount –t ext4 /dev/xvdg2 /storage2
8. Tail mount
9. Mount | tail
10. For I in {1..9} ; do dd if=/dev/urandom of /storage1/file_Si bs=100m
Count=1;done
11. For I in {1..9} ; do dd if=/dev/urandom of /storage2/file_Si bs=100m
Count=1;done
12. Ll /storage1
13. Umount /storage*
14. Dd if=/dev/urandom of=/dev/xvdfg1 bs=4096 count=10 seek=10000 && mkswap /dev/xvdf1
15. Dd if=/dev/urandom of=/dev/xvdfg1 bs=4096 count=10 seek=10000 && mkswap /dev/xvdf2
16. Lsblk
17. Mount -t xfs /dev/xvdg1 /storag1
18. Xfs_repair /dev/xvdg1
19. Cd /storage
20. Moun t -t ext4 /dev/xvdg2 /stroae2
21. Error :wrong fs type bad options bad superblock on /dev/xvdg2
22. E2fsck /dev/xvdg2
23. !m
24. Mount | ail
25. Dump2fs /dev/xvdg2 | grep “ backup”
26. Dd if =/dev/zero of=/dev/xvdg2 seek=32768 bs=1
Count=1
27. Umount /storage2
28. E2fsck –n /dev/xvdg2 –b 32768
29. Mkdfs.ext4 –n /dev/xvdg2
30. E2fsck -b 98304 /dev/xvdg2
31. Cd /storage2
32. Ll
33. Mount –t ext4 /dev/xvdg2 /storage2
34. Cd /storage
35. Ll
36. Ll lost+found /
37. Ls –I ./

Lecture: Recover mis-configured or broken LVM configurations


1. Lsblk
2. Pvcreate /dev/xvdc
3. Vgcreate vg1 /dev/xvdc
4. Lvcreate –L 1G –N LV1 VG1
5. Mkfs.xfs /dev/vg
6. Blkid
7. Vi /etc/fstab
a. Uuid=929222222
8. Mkdir /lvm
9. Mount /lvm
10. Mount | grep lvm
11. Cd /lvm
12. For I in {1..8} ; do dd if=/dev/urandom of=file_si bs=10m count=10
13. !D(80%)
14. VI /ETC/lvm/lvm.conf
15. Ll /etc/lvm/archive
16. Lvresize –L 100M /dev/vg1/lv1
17. Lvchange –an /dev/vg1//lv1
18. Cd /
19. Lvchange –an /dev/vg1/lv1
20. Umount /lvm
21. Lvchange –an /dev/vg1/lv1
22. Lvchange –ay /dev/vg1/lv1
23. Mount /lvm/
a. “cant read superblock”
24. Vgcfgrestore –l vg1
25. Vgcfgrestore –f /etc/lvm/archive/vg1_00000-248298729.vg vg1
26. Lvchange –an /dev/vg1/lv1
27. Lvchange –ay /dev/vg1/lv1
28. Mount lvm
29. Mount | grep lvm
30. Ll /lvm
31. Df –h
32. Lvresiave –l +100m /dev/vg1/lv1
33. Lvchange –an /dev/vg1/lv1
34. Umount /lvm
35. Lvchnge –an /dev/vg1/lv
36. Lvchange –ay /dev/vg/lv1
37. Mount /lvm
38. Df –h
39. Vgcfgrestore –l vg1

Lecture: Recover data from encrypted file systems


1. Pvcreate dev/xvdc
2. Vgcreate vg_1 /dev/xvd
3. Lvcreate –l 1G –n lv_1 vg_2
4. Vim /root/secreate.key
5. “This is pasowrd”
6. Cryptsetup
7. Cryptsetup luksformat /dev/mpper/vg_1-lv_1 /root/secreate.key
8. Cryptsetup luksheaderbackup /dev/mapper/vg_1-lv_1 –header-backup-file /root/vg1lv1.header
9. Ll
10. Vim /etc/crypttab
11. “luks1 /dev/mapper/vg_1-lv_1/root/secret.key
12. Cryptsetup luksopen /dev/mapper/vg_1-lv_1 luks1 –key-file /root/sec.key
13. Ll /dev/mapper
14. Mkfs.xfs /dev/mapper/luks1
15. Mkdir /luk1
16. Mount –t xfs /dev/mapper/luks1 /luks1
17. Cd /luks1
18. For I in {1..6}; do dd if =/dev/urandom of=file_$i bs=10m cont=10;done
19. Cd
20. Cryptestup luksdump /dev/mpper/vg_1-lv_1
21. Crypsetup luksaddkey /dev/mapper/vg_1-lv_1 –key-file /root/secreate.key
22. Cryptestup luksdump /dev/mpper/vg_1-lv_1
23. Cryptestup luksdump /dev/mpper/vg_1-lv_1
24. Cryptsetup lvksremovekey /dev/mapper/vg_1-lv_1 –key-file /root/secret.key
25. Umont /luks1
26. Cryptestup luksclose/dev/mpper/vg_1-lv_1
27. Cryptsetup lvksopen /dev/mapper/vg_1-lv_1 –key-file /root/secret.key
28. Cryptestup luksclose/dev/mpper/luks1
29. Cryptsetup lvksopen /dev/mapper/vg_1-lv_1 luks1 –key-file /root/secret.key
30. ll
31. Cryptsetup lvkshederrestore /dev/mapper/vg_1-lv_1 --header-backup-file /root/vg1lv1.header
32. Cryptsetup lvksopen /dev/mapper/vg_1-lv_1 luks1–key-file /root/secret.key
33. Mount –t xfs /dev/mapper/luks1 /luks1/
Lecture: Identify and fix iSCSI issues

34. Yum install –y target targetcli


35. Systemctl enble target && systemctl start target
36. Targetcli
37. Backstore /block create lun0 /dev/xvdb
38. Iscsi /create
39. Iscsi/iqn.2003-01.org.linux-iscsi.ip-10-0-110.x86 :sn.8d22e
40. Luns /create
41. Luns /create /backstores/block/lun0
42. Ls
43. Client side
44. Yum search iscsi
45. Yum install iscis
46. Cat /etc/issi/initistorname.iscsi
47. Server side
48. Tpg1>acls / create /backsore/block/lun0
49. Targetcli
50. /iscsi/iqn.2003-01.org.linux-iscsi.ip-10-0-01./tpg1/port
Resolve package management issues
Lecture: Resolve package management dependency issues
1. Rpm –Uvh http://rpmfnd.net (faild depenice)
2. Rpm –Uvh https://rpmfind.net
3. Yum whatprovies’*/libfanm.so*’
4. Yum install –y gamin
5. Yum deplist lighthttpd
6. Yum deplist httpd
7. Yum downgrade httpd htpd-tools
8. Yum install –y yum-plugin-versionlock
9. Yum versionlock add httpd httpd-tools
10. Yum versionlock status
Lecture: Recover a corrupted RPM database
1. Cd /var/lib/rpm
2. Hexedit package
3. Lsof | grep /var/lib/rpm
4. Rm –rf /var/lib/rpm/__db*
5. /usr/lib/rpm/rpmdb_verif packages
6. Ll
7. /usr/lib/rpm/rpmdb_dmp package | /usr/lib/rpm/rpmdb_load packages.new
8. /usr/lib/rpm/rpmdb_verify pckage.new
9. Hexedit packages.new
10. Mv packages packages.old
11. Mv packages.new packages
12. Rpm –qa > /dev/null
13. Rpm –vv --rebuilddb
Lecture: Identify and restore changed files
1. Yum install –y httpd
2. Cd /etc/httpd/conf/
3. LL
4. Rpm –qf httpd.conf
5. Yum provides httpd.conf
6. Yum provies */httpd.confg
7. Cd /usr/lib/system/system
8. Vim http.service
9. #this is change
10. Chmod 000 /etc/httpd/confg/httpd.conf
11. Chown cloud_user:/etc/httpd/config/httpd.cong
12. Yum install – y yum-plugins-verify
13. Yum verifty httpd
14. Rpm –V httpd
15. Rpm –setperms httpd
16. Rpm –setugids httpd
17. Rpm –V httpd
18. Yum reinstall httpd

Troubleshoot and fix network connectivity issues


Lecture: Use standard tools to verify network connectivity
1. Yum install –y screen
2. Screen
3. Ssh cloud_user@10.0.1.1
4. Sudo su –
5. Yum install –y httpd (10.0.1.10 server)
a. Systemctl status firewalld
b. Systmctl stop fiewalld
c. Ss –lntp | grep 80
6. Yum install -y telnet (client 10.0.1.11)
7. telnet 10.0.1.10:80
8. yum install –y nmap-ncat
9. nc –vz 10.0.1.10 80
10. nc –vz 10.0.1.10 443
11. server
12. ss –lntpdd
13. yum install –y nmap-ncat
14. nc –l 443
15. client
16. telnet 10.0.1.10 443
17. server
a. systemcl stop httpd
18. client
a. telnet 10.0.10 80
19. server
a. nc –l 80
20. client
21. telnet 10.0.1.10 80
22. server
a. nc –l 80 –e /bin/bash
23. client
24. nc 10.0.1.10 80
25. utime
Lecture: Identify and fix network connectivity issues

26. cat /etc/udev/rules.d/70-persistent-net.rules


27. cat /etc/sysconfig /network-scripts/ifcfg-eth0
28. ip a s dev eth0
29. ip r s
30. nmcli
31. nmcli c show
32. ncmli c show system\ eth | grep ipv6
33. ncmli c show system\ eth | grep ipv4
34. yum install –y bash-completion
35. /etc/profile
36. Nmcli
37. Nmcli connection up
38. Nmcli connection up system\ eth0
39. Nmcli c show sysem \ etho0 grep dns
40. Cat /etc/resolv.conf
41. Yum install –y bind-lib
42. Dig google.com
43. Cat /etc/servies/ | grep domain
44. Yum install –y telent
45. telnet 10.0.0.2 53
46. cat /etc/resolv.conf
47. firewall-cmd –list-all
Lecture: Identify library dependencies for third-party software
1. tcpdump –I eth0
2. which tcpdump
3. ldd /sbin/tcpdump
4. ldconig -p | gep libpcap
5. ll /lib64/libpcap.so.1
6. yum reinstall libpcap
7. tcpdump –I eth0
Lecture: Identify if an application suffers from memory leaks
1. fee -m
2. ps aux –sort –rss | head
3. ll
4. yum info valgrind(valgrind(memory info,leak)
5. yum install valgrind
6. valgrind ./test_app
7. valgrind –logfile=valgrind.txt –tool=memchek ./test_app
8. valgrind –logfile=valgrind.txt –tool=memchek --leak-check=full
9.
Lecture: Use standard tools to debug an application
1. Ll
2. Yum insall –y strace ltrace
3. ./test_app
4. “cant open file”
5. Strce ./test_app
6. Touch /etc/example.conf
7. ./test_app
8. Strace –o strace.txt ./test_app
9. Strace –o strace2.txt ls
10. Cat strace.txt
11. Yum install –y httpd
12. Systemctl start httd
13. Ps aux | grep httpd
14. Strace –p 130
15. Ltrace ./test_app
16. Yum install –y bind-utils
17. Ltrace dig google.com
18. !p
19. Ltrace –p 1630
Lecture: Identify and fix issues related to SELinux
1. Selinux log location :/var/log/audit/audit.log
2. Setenforce 0
3. Setenforce 1
4. Yum install –y settrouble shoot settroubleshoot server
5. Service audited restart
6. Ls –Z /usr/sbn/httpd
7. Ls –Z /var/log/httpd
8. Ls –Z /VAR/WWW/HTML
9. LS –Z /usr/lib.sstemd/system/httpd.service
10. Systemctl start httpd
11. Semanage port –l | grep httpd (show ports)
12. !ls
13. Seinfo –u
14. Yum provs */seinfo
15. Seinfo –u(context lables)
16. Seinfo -t
17. Seinfo –r
18. Getsebools –a | grep httpd
19. Semen getsebool
20. Setsenforce 0
21. Curl localhost
22. Setenforce 1
23. Curl localhost
24. Auearch –m avc –ts recent(avc erros)
25. Journalctl –a –t setroubleshoot –since=21:04:12
26. Sealert =a /var/log/audit/auit.log
27. Getsebool httpd_read_user_content
28. Setsebool httpd_read_user_content 1
29. Curl localhost
30. Ls –z /etc/httpd/conf/httpd.conf
31. Restorecon –RV /etc/httpd/conf(restore indivial or directory to default contt)
32.
33.

Вам также может понравиться