Solution: Be Sure To Watch The Introduction Video For Details Regarding Testing Your Progress
Solution: Be Sure To Watch The Introduction Video For Details Regarding Testing Your Progress
Solution: Be Sure To Watch The Introduction Video For Details Regarding Testing Your Progress
Be sure to watch the introduction video for details regarding testing your progress.
Environment
ip-10-0-1-5.ec2.internal | 10.0.1.5
HostA:
ip-10-0-1-10.ec2.internal | 10.0.1.10
HostB:
ip-10-0-1-11.ec2.internal | 10.0.1.11
HostC:
ip-10-0-1-12.ec2.internal | 10.0.1.12
HostD:
ip-10-0-1-13.ec2.internal | 10.0.1.13
Changes requested in the tasks should persist through a restart of the system.
Solution
Start by logging in to the lab servers using the credentials provided on the hands-on lab
page:
ssh cloud_user@PUBLIC_IP_ADDRESS
Become the root user:
sudo su -
I recommend logging in to all four of the lab servers in separate tabs or windows to help
ensure we are running the right commands on the right hosts.
Also, keep in mind that there is a grading script that can be run on each host at any time
to help check your work. Be sure to replace the hostname with the name of the host you
are running the script on. Example:
score_HostA.sh
1. Install strace:
strace example_app
3. Resolve the "No such file or directory" error by creating the necessary file:
touch /etc/example.conf
1. Install valgrind:
valgrind ./memleak_test_app
3. valgrind tells us there is indeed a memory leak. Remove the ability to execute
the application:
chmod -x memleak_test_app
modprobe -r nf_conntrack
3. Load it w/ parameter:
4. Make it persist:
On HostA, upgrade Apache (httpd) to the latest version and apply version control to
limit future upgrades.
1. Attempt to upgrade:
2. Edit /etc/yum.conf:
vim /etc/yum.conf
exclude=httpd
:wq
3. Upgrade Apache:
4. Install versionlock:
5. Use versionlock:
yum versionlock httpd
On HostA, resolve any issues starting the Apache (httpd) service, or issues viewing the
content. The existing web content and configuration should not be modified.
1. Start Apache:
curl localhost
sealert -a /var/log/audit/audit.log
7. Find the error and utilize the suggested fix, enabling the boolean to allow httpd
to read user content:
setsebool -P httpd_read_user_content 1
8. Let's go ahead and enable the httpd service to start on system boot:
On HostA, the LDAP/Kerberos user testuser01 should be able to log in and obtain a
Kerberos ticket using the password welcome1.
cat /etc/sysconfig/authconfig
2. Launch authconfig-tui:
authconfig-tui
ssh testuser01@localhost
kinit
klist
exit
On HostA, there is a Performance Co-Pilot archive file. What was the 1 min kernel load
at 17:19:46?
Enter the value as a number into /root/load.txt. For example, if the load was 7.700,
the command would be:
6. We are finished with the tasks for HostA. Let's run the grading script to ensure
all of the steps were completed successfully:
score_HostA
Reboot HostA:
shutdown -r now
ssh cloud_user@PUBLIC_IP_ADDRESS
sudo su -
Run the grading script again to ensure all tasks are able to persist through a
reboot:
score_HostA
cat /etc/fstab
fsck.ext4 -y /dev/mapper/vg_2-lv_2
mount /storage
ll /storage
Task 9: Recover data from a broken LVM configuration
On HostB, troubleshoot and resolve the LVM issues preventing the data on /lvm_mount
from being accessed.
The integrity of the files on the filesystem must be preserved.
cat /etc/fstab
mount /lvm_mount/
vgcfgrestore -l vg_1
4. Use the config file from before the volume group was resized:
ll /lvm_mount
On HostB, troubleshoot and resolve the issues preventing the data located at /luks from
being accessed. The integrity of the files on the filesystem must be preserved.
cat /etc/fstab
cat /etc/crypttab
3. View slots:
cat /etc/crypttab
6. Manually unlock:
ll /luks
On HostB, start the Performance Co-Pilot service and configure it to start automatically
upon reboot.
2. View the status of the service to determine what is causing the issue:
vi /etc/systemd/system/pmcd.service.d/dependency.conf
6. We are finished with the tasks for HostB. Let's run the grading script to ensure
all of the steps were completed successfully:
score_HostB
Reboot HostB:
shutdown -r now
ssh cloud_user@PUBLIC_IP_ADDRESS
sudo su -
Run the grading script again to ensure all tasks are able to persist through a
reboot:
score_HostB
uptime
pcp atop
4. Use pcp atop to determine what is causing the high CPU load:
pcp atop
5. View more information about the process, using the PID of the problematic
process identified in the previous step:
chmod -x /usr/bin/polling.sh
kill -9 <PID>;
dig google.com
4. Reinstall bind-libs:
dig google.com
On HostC, troubleshoot and resolve the issue preventing cloud_user from listing the
local Samba shares. Do not modify the existing Samba configuration file
/etc/samba/smb.conf.
Username: cloud_user
Password: welcome1
tail /var/log/samba/log/smbd
rpm -V samba
mv /etc/pam.d/samba /tmp/
5. Reinstall samba:
HostC is an iSCSI target. Troubleshoot issues preventing HostD from accessing the
target. HostD should successfully be able negotiate the iSCSI connection and attach to
the block device.
On HostC
firewall-cmd --reload
On HostD
vim /etc/iscsi/initiatorname.iscsi
vim /etc/iscsi/iscsid.conf
node.session.auth.authmethod = CHAP
iscsiadm -m node
6. Verify:
lsblk
Configure HostC as a remote log server for HostD. The connection should be over the
standard TCP port.
On HostC
vim /etc/rsyslog.conf
$ModLoad imtcp
$InputTCPServerRun 514
firewall-cmd --reload
On HostD:
1. Edit rsyslog.conf:
vim /etc/rsyslog.conf
*.* @@remote-host:514
*.* @@10.0.1.12:514
4. Run the grading script to ensure Task 15 and Task 16 are correctly configured:
score_HostD
HostD has a corrupt RPM database. Troubleshoot and resolve this issue.
cd /var/lib/rpm
/usr/lib/rpm/rpmdb_verify Packages
/usr/lib/rpm/rpmdb_verify Packages.new
mv Packages Packages.bad
mv Packages.new Packages
rpm --rebuilddb
8. Clean yum:
Step 1
Troubleshoot any networking issues preventing HostD from accessing the Apache
content on HostA at http://ip-10-0-1-10/index.html
On HostD
curl http://ip-10-0-1-10/index.html
curl 10.0.1.10
On HostA
firewall-cmd --reload
On HostD
curl 10.0.1.10
curl http://ip-10-0-1-10/index.html
cat /etc/resolv.conf
4. Edit nsswitch.conf:
vim /etc/nsswitch.conf
curl http://ip-10-0-1-10/index.html
Step 2
There is a packet capture file located at /root/packet.cap. Examine this file and
discern the password used by testuser01. Enter this password as a single line into the
file /root/passwd.txt.
1. Install tcpdump:
/testuser01
cat sosreport-ip-10-0-1-11-2019-03-22-wxoxhnk/var/log/messages
| grep LDAP
3. Copy the LDAP server name and save it in the file /root/test:
staprun cloud_tap
shutdown -r now
ssh cloud_user@PUBLIC_IP_ADDRESS
sudo su -
Run the grading script to ensure all steps were completed correctly:
score_HostD.sh
Conclusion
Congratulations, you've completed this hands-on lab!