Wednesday, July 28, 2021

RHCSA exam prep notes

 1. How to reset root password on RHEL8 server?
-> Reboot your system
-> On your boot (timer) menu, press arrow key
-> Press e to edit
-> Go to the link starts with linux
-> Go to end of the line by pressing end on your keyboard
-> type - rd.break enforcing=0
-> press ctrl+x to save and exit
-> You will be at the prompt menu # Emergency mode
-> Mount sysroot # mount -o remount,rw /sysroot/
# chroot /sysroot
# passwd root

autorelabel
-> Exit exit at the prompt
-> Login to your system and run
# restorecon /etc/shadow

2. Assign static IP address
either use nmcli command line tool or
use manually
# cd /etc/sysconfig/network-scripts
# vi ifcfg-eth0 (interface name)
 BOOTPROTO="static"
 ONBOOT="yes"
 IPADDR=192.168.100.100
 NETMASK=/24
 GATEWAY=192.168.100.1
 DNS1=192.68.100.1 - DNS server ip

# systemctl restart network
# systemctl restart NetworkManager

# cat /etc/resolv.conf

# netstat -rn

# ping gateway
# ping google.com # if access to outside @internet will allowed.

# ssh hostname (IP)

3. Disable firewall, enable SElinux
# systemctl stop firewalld
# systemctl disable firewalld

# getenforce
# setenforce 0
# vi /etc/selinux/config
SELINUX=enforcing

4. Set up repo
# vi exam.repo
[examrepo1]
baseurl=http://path
gpgcheck=0

[examrepo2]
baseurl=http:url
gpgcheck=0

# yum clean all
#  yum repolist
# yum search httpd
# yum install httpd

5. Assign hostname to your system
# hostnamectl -h
# hostnamectl set-hostname myhost.eg.com



No comments:

Post a Comment

Git branch show detached HEAD

  Git branch show detached HEAD 1. List your branch $ git branch * (HEAD detached at f219e03)   00 2. Run re-set hard $ git reset --hard 3. ...