RHCSA Flashcards

1
Q

How to enable port forwarding

A
vi /etc/sysctl.conf
	# add line
	net.ipv4.ip_forward=1
	# save file
	sysctl -p
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Disk compression

A

VDO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Layered storage

A

Stratis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

First thing in any script

A

!/bin/bash

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Shell script user prompt for input

A

read VARIABLENAME

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

default exit codes for successful and unsuccessful

A

exit 0 = unsuccessful exit 1 = successful

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Numerical calculations within a bash script

A

$((1+2))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to call a variable in a bash script

A

$VARIABLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to create a local repo

A

create mount point (mkdir /repo)
add to /etc/fstab: /rhel8.iso /repo iso9660 defaults 0 0
mount -a

/etc/yum.repos.d
	[appstream]
	name=appstream
	enabled=1
	baseurl=file:///repo/AppStream
	gpgcheck=0
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

2 things to never forget when using firewall-cmd

A

always run with and without permanent

always restart firewall-cmd after any changes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to rename a file in linux

A

mv

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

set time zone

A

timedatectl set-timezone

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How to modify boot and kernel options

A

/etc/default/grub (most commonly worked with, timeout time, etc, feeds changes to grub2-mkconfig)
/boot/grub2/grub.cfg (final product of grub2-mkconfig)
***Executing change to bootloader: grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-set-default will change which kernal boots 0 is the first
GRUB_TIMEOUT_STYLE=hidden

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Packages required for Stratis

A

stratisd, stratis-cli

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Packages required for VDO

A

vdo, kmod-kvdo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

If having issues with stratis, how to wipe disk

A

wipefs -a /disk

17
Q

fstab configuration for stratis

A

UUID /mountpoint xfs x-systemd.requires=stratisd.service

ALWAYS USE UUID
lsblk -o=UUID /dev/stratis/mypool/myfs

18
Q

fstab option required for vdo

A

x-systemd.requires=vdo.service

19
Q

Where and how to set up nfs export on nfs server

A

/etc/exports

/dir 10.1.1.1(rw)

exportfs -av

20
Q

NFS packages

A

autofs, nfs-utils, nfs-server

21
Q

NFS firewall services

A

nfs, mountd, rpc-bind

22
Q

How to check available mount points for remote device

A

showmount -e 10.1.1.1

23
Q

NFS fstab setup

A

option = _netdev

file system type = nfs

24
Q

Samba share options

A

_netdev, username=user, password=password

yum install samba, yum install samba-client

25
Q

NFS SEboolean

A

setsebool -P nfs_export_all_rw on

JUST USE SETSEBOOL -P NFS TAB TAB

26
Q

podman packages

A

podman and container-tools

27
Q

User persistent container - dont forget

A

loginctl enable-linger USER (run from root)

28
Q

location to run, and command for generating systemd podman USER file

A

/.config/systemd/user
podman generate systemctl –files web_dev (–new for new every time)

systemctl –user daemon-reload

NOTE - ONLY WORKS FROM SSH OR CONSOLE, NOT SUDO OR SU

29
Q

location to run, and command for generating systemd podman USER file

A

/etc/systemd/system

podman generate systemctl –files web_dev (–new for new every time)

30
Q

Persistent mount storage on container

A
  • v ~/web_data:/var/www/html:Z

- v and Z

31
Q

Execute command within container

A

podman exec mycontainer cat /etc/whatever

32
Q

Check container log

A

podman logs containername

VERY IMPORTANT IF CONTAINER FAILS TO LAUNCH

33
Q

Specify environment variables when creating container

A

-e

EX:

podman run -d –name mysql -e MYSQL_ROOT_PASSWORD=password

34
Q

How to execute a command with results of find

A

find / -type f -perm 0777 -print -exec chmod 644 {} \;

MOST IMPORTANT THINGS TO REMEMBER:
{} = passes output of find
\; ends the execute

GREAT EXAMPLES IN THE MAN PAGE

35
Q

How to extend xfs filesystem

A

xfs_growfs

36
Q

How to extend ext4 filesystem

A

resize2fs

37
Q

Settings for usermod userdel and chage

A

/etc/login.defs