All Correct
How to check the dependencies of the service unit - Answer-systemctl list-
dependencies
How to switch to the new target at runtime - Answer-systemctl isolate
<embergency.target>
How to set the default target - Answer-systemctl get-default target
systemctl set-default <emergency.target
systemctl set-default multi-user.target
How to restart the network in redhat 8 - Answer-sudo nmcli networking off
sudo nmcli networking on
dont run remotly
How to change th hostname - Answer-hostnamectl set-hostname host.example
hostnamectl status
How to add a nameserver - Answer-go to /etc/resolve.conf
How to test the DNS name resolution - Answer-host classroom.example.com
How to send syslog message manually - Answer-logger -p local7.notice "LOG ENTRY
CREATED ON HOST"
Two processes on serverb are consuming a high percentage of CPU usage. Adjust
each process's nice level to 10 to allow more CPU time for other processes.
1-take out the biggest consumers
2-identify the currrent nice lvevel for each of the top two CPU consumers.
3-renice to 10 - Answer-1- ps aux --sort=pcpu
2-ps -o pid,pcpu,nice,comm $(pgrep sha1sum;pgrep md5sum)
3-renice -n 10 pid1 pid2
add a new repo with commandline - Answer-yum-config-manager --add-repo
"http://redhat.com" and dont forget to add the gpgcheck=0
1- where you need to create a file if you want to add into yum repo
2-create a file in your memory for repo (yum) - Answer-1-/etc/yum.repos.d
2- [rh-updates]
name=ABC
baseurl=http://abc.com
enabled=1
,gpgcheck=0
install module python36 - Answer-yum module list python36
yum list python36
yum module remove python36
On serverb configure a software repository to obtain updates. Name the repository as
errata and configure the repository in the /etc/yum.repos.d/errata.repo file. It should
access http://content.example.com/rhel8.0/x86_64/rhcsa-practice/errata. Do not check
GPG signatures. - Answer-[errata]
name=Red Hat Updates
baseurl=http://content.example.com/rhel8.0/x86_64/rhcsa-practice/errata
enabled=1
gpgcheck=0
/etcx/yum.repos.d/errata.repo
List available modules and streams. Look for the httpd module. Use the yum install
command to install the httpd module with the 2.4 stream and the common profile. -
Answer-1. yum module list
2. yum module install httpd:2.4/common
List all socket units, active and inactive on servera - Answer-systemctl list-units --
type=socket --all systemctl list-units --type=service systemctl list-units-files --
type=service
1- display the status of the chronyd
2- check the chrond ps
3-sshd service is enabled to start
4-active the sshd
5-list the enabled or disabled status of all service units - Answer-1- sytemctl status
chronyd
2- ps --p 680
3-systemctl is-enabled sshd
4-systemctl is-active sshd
5-sytemctl list-unit-files --type=service
1- check the servic e is enabled after boot
disable after the boot - Answer-systemctl is-enabled chronyd
systemctl disable chronyd
1- how to check which default target target is ...
2- swith to the multi-user target ( without rebooting)
3- boot automatically into the multi-user target
4- set the target to graphical target 5-list all the target - Answer-1- systemctl get-default
2- systemctl isolate multi-user.target
, 3-systemctl set-default multi-user.target
4- systemctl set-default graphical.target 5-systemctl list-units --type=target --all
Access the boot loader by rebooting workstation again. From within the boot loader
menu, boot into the rescue target. - Answer-interrupt > Linux > end > at end
"systemd.unit=rescue.target
Resetting the Root Password - Answer-1- interupt the boot with any key add at the linux
line rd.break and then control+X
2- mount -o remount,rw /sysroot
3- chroot /sysroot
4-passwd root
5-touch /.autorelabel
6-exit twice time
mount -o remount - Answer-
add ip configure in all steps - Answer-1- nmcli con show --active
* nmcli dev show
2-nmcli con show
3-nmcli con add con-name "Linux-addr" ifname ens3 --type ethernet ipv4.method
manual ipv4.address <IP> ipv4.gateway
4-nmcli con mod "static-addr" ipv4.dns
5-nmcli con show
6- nmcli con show --active
7-nmcli con mod "Wired conneciton 1" connection.autoconnect no
7-nmcli con up "static-addre- con-name" 7-nmcli con mod "Wired conneciton 1"
connection.autoconnect no
* nmcli con mod "static-ens3" ipv4.ignore-auto-dns yes
*nmcli con mod "lab" +ipv4.addresses 10.0.1.1/24
configure rsyslog to log all messages with the debug priotity or higher to the new file
name /var/log/message-debug - Answer-*.debug /var/log/messages-debug
write above mentioned in the file /etc/rsyslog.d/debug.conf
logger -p user.debug "Debug test"
systemctl restart rsyslog
tail /var/log/messages-debug --------------------------------------------------Exercise 13-2
Changing rsyslog.conf Rules
1. By default, the Apache service does not log through rsyslog but keeps its own
logging. You are going to change that. To start, type yum install -y httpd to
install the Apache service.
2. After installing the Apache service, open its configuration file /etc/http/conf/
httpd.conf and add the following line to it:
ErrorLog syslog:local1
3. Type systemctl restart httpd.