RHLSA-EX200 Flashcards

(127 cards)

1
Q

Guide in RedHat environments?

A

vimtutor

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

Creat diagnostic report

A

sos report

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

Directory for access to hardware

A

/dev

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

Directory with system config files

A

/etc

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

Directory for installed software

A

/usr

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

Directory for
- System-specific persistant variable data
- Dynamically changing files (databases etc)

A

/var

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

Directory for non-persistant runtime data

A

/run

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

Create a Hard Link

A

ln <original> <link></link></original>

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

Create a Soft Link

A

ln -s <original> <link></link></original>

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

Create an alias called my_alias to cat /etc/passwd

A

alias my_alias=”cat /etc/passwd”

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

View user ID and assosiated group IDs

A

id <Username></Username>

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

View all groups

A

cat /etc/group

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

Make a user a Sudo’er

A

usermod -aG wheel <username></username>

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

Create a user

A

useradd <username></username>

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

Change a user’s password

A

passwd <username></username>

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

Modify existing user

A

usermod <options> <username></username></options>

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

Delete user

A

userdel <username></username>

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

Create a group

A

groupadd <new></new>

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

Delete a group

A

groupdel <group></group>

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

Force users to change password at next login

A

chage -d 0 <username></username>

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

Give group permission to write

A

chmod g+w <directory></directory>

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

Give permission for all to write

A

chmod a+w <directory></directory>

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

Give recursive rights for all to write in directory

A

chmod -R a+w <directory></directory>

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

Give recursive rights for all to write to directories but NOT files

A

chmod -R g+X <directory></directory>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Change owner
chown
26
Change owning group
chgrp
27
Change owner and group together
chown
28
Set GID - allow files created in a directory to match the group owner of the directory
chmod g+s {directory}
29
Set sticky bit - Users with write access can only remove files they own
chmod o+t {directory} or chmor
30
How do you see the current umask setting
umask
31
How do you update the umask setting
umask {number}
32
Command to view SELinux enforce mode
getenforce
33
Command to set SELinux enforce mode (non persistent)
setenforce {number} (1=permissive, 2=Enforcing)
34
How to persistently change SELinux enforcing mode
vim /etc/selinux/config SELINUX={mode}
35
View SELinux context labels
ls -Z
36
Change SELinux context of files in a directory to match the parent directory
restorecon {file/directory}
37
View all SELinux booleans available
getsebool -a (grep to filter)
38
View SELinux boolean info
semanage boolean -l
39
View SELinux boolean policies for specific packages
dnf install selinux-policy-doc man {package}_selinux
40
Change SELinux boolean value
setsebool -P {se bool} on (-P = persistent)
41
Where are SELinux logs stores
/var/log/audit/audit.log
42
Show SELinux errors in log
sealert -a /var/log/audit.log
43
Show all pskill signals
pskill -l
44
Kill a process with kill signal 9
pskill -9 {process ID / %job number}
45
List CPUs and their usage
lscpu (an average of >1 is bad)
46
Display resource load averages
top
47
2 methods to view manuals on creating tmp files
man -k tmpfiles man tmpfiles.k
48
How do you configure a new tmp directory /home/tmp_share. It must be owned by root, universally accessible and deleted everything after 30s
vim /etc/tmpfiles.d/tmp_share.conf d /home/tmp_share 0777 root root 30s systemd-tmpfiles --create /etc/tmpfiles.d/tmp_share.conf
49
How do you search for a package with a keyword
dnf search {keyword}
50
How do you see installed package
dnf list installed
51
What directory are yum repos stored in
/etc/yum.repos.d
52
How you you enable a dnf repo
dnf config-manage --enable {repo name}
53
How do you install a local package repository
dnf/yum install {repo addess/path}
54
How do you list block devices (physical storage)
lsblk
55
How do you create a partition on /dev/vdb
parted /dev/{drive} mklabel > msdod (or other) mkpart > type > file system > start > end print (to check) Set {number} > Flag {lvm} > Status {on} Quit udevadm settle (update kernal)
56
How do you format the logical volume "vol" in volume group "group" to xfs
mkfs -t xfs /dev/group/vol
57
mount a /dev/vdc1 to /share
mount /dev/vdc1 /share
58
How do you check mounted drives
df -h
59
How do you persistantly mount /dev/vdb1 to /home/mount
lsblk -f #for file system type Vim /etc/fstab; /dev/vdb1 /home/mount {files system type} defaults 0 0 OR lsblk -o /dev/vdb1 #for UUID UUID={UUID} /home.mount {file system type} defaults 0 0 mount -a (to check for errors)
60
How do you remove a partition
unmount {mount point} parted > print (to get partition number) > rm > {number}
61
How do you create a 2Gb swap partition on vdb
printed /dev/vdb mkpart > type (primary) > file system type (linux-swap) > start (1Mb) > End (2Gb) print (to check) mkswap /dev/vdb1 swapon -s (to check)
62
How do you deactivate a /dev/vdb2 swap
swapoff /dev/vdb2
63
How do you make the swap drive dev/vdb2 persistant
vim /etc/fstab /dev/vdb2 swap swap defaults 0 0 swapon -a swapon -s (to check)
64
How do you make the swap /dev/vdb3 priority 3
vim /etc/fstab /dev/vdb3 swap swap defaults,pri=3 0 0
65
Create a 2Gb partition, Physical Volume, Volume group and 1Gb logical Volume from /dev/vdb
parted /dev/vdb mklabel > msdos mkpart > type? (primary etc) > file system type (xfs etx} > 1Mb > 2Gb print (to get new PV number) set {number} >flag (lvm) > on quit pvcreate /dev/vdb1 vgcreate my_vb /dev/vdb1 {more if req} lvcreate -n 1Gb -L my_lv my_vg
66
Get the UUID of logical volume my_lg
lsblk -o UUID my_lv
67
extend volume group my_vg to include partition /dev/vdb2
pvcreate /dev/vdb2 (if not already created) vgextend my_vg /dev/vdb2
68
Decrease the used space of /dev/vdb2 in Volume Group my_vg
pvmove /dev/vdb2 pvscan #to check vgreduce my_vg /vdb2
69
List available services
systemctl list-units --type service
70
How do you check the currently active target of machine
systemctl get-default
71
Set a new target on a machine
systemctl set-default multi-user.target #or other .target
72
List avaiailable machine targets
systemctl list-units --type target
73
How do you reset root password if it is not know
# to relable SELinux Interrupt the boot process # remove any "console=" rd.break mount -o remount,rw /sysroot chroot /sysroot passwd root #set new password touch /.autorelabel exit exit
74
How do you list jobs to find stuck jobs
systemctl list-job
75
How do you repair a "failed to mount" boot error
Interrupt the boot process systemd.unit=emergency.target mount -o remount,rw / vim /etc/fstab Remove/fix the problem line systemctl daemon-reload mount -a #to check reboot
76
What log file logs most syslog messages
/var/log/messages
77
What log file logs security and authentication events
/var/log/secure
78
What log file logs scheduled jobs events
/var/log/cron
79
How do you view and then set the timezone
#check timezone timedatectl list-timezones timedatectl set-timezone {timezone}
80
How do you configure chrony to use classroom.example.com as an NTP server
vim /etc/chrony.conf server classroom.example.com iburst timedatectl set-ntp true systemctl restart chronyd #check timedatectl
81
How do you view current time source
chronyc source -v
82
What file sets DNS nameservers
/etc/resolve.conf
83
Check listening ports
netstat -tunlp #or ss -tunlp
84
How can you configure the Network on the command line
nmcli
85
How do you enter the networking GUI from the CLI
nmtui
86
How can you find examples for Network Manager CLI
man nmcli-examples
87
What package can auto mount file systems
autofs
88
What directory stores automatic mounting config files
/etc/auto.master.d/
89
How can you automount remote.server:share to /remote
# Create a master file base mountpoint vim /etc/auto.master.d/custom_name.autofs # /- /etc/auto.custom_name vim /etc/auto.custom_name # /remote -rw remote.server:share/ systemctl restart autofs
90
How do you install the tools required to manage containers?
dnf install container-tools
91
How do you check all available firewall zones?
firewall-cmd list-all-zones
92
How can you check all firewall rules in the current default zone?
firewall-cmd list-all
93
How do you add a persistent firewall service?
firewall-cmd --permanent --add-service={service}
94
How do you refresh the firewall to load new rules
firewall-cmd --reload
95
How do you add a port to the current default firewall zone?
firewall-cmd --add-port={port}{udp/tcp} (2 dashes for add)
96
How do you check what ports are configured with SELinux
semanage port -l
97
How do you view images in a remote repo
podman search remote.repo.com --tls verify=false #if https error
98
How do you pull the latest version of remote_repo from remote.repo.com
podman pull remote.repo.com/remote_repo:latest
99
How do you run the repo remote.repo.com/remote_repo in the background, mapping port 8080 on the local host to port 8080 on the container.
podman run -d -p 8080:8080 remote.repo.com/remote_repo:latest
100
What flag passes environmental variables into containers when creating them
-e
101
How do you view all containers
podman ps -a
102
What file do you configure container repos in
/etc/containers/registries.conf
103
How do you view the environmental variables of container named "http"
podman inspect http
104
Run the container remote.repo.com/http:latest in the background, exposing port 80 local to port 80 on the container. Name it http1
podman run -d -p 80:80 --name http1 remote.repo.com/http:latest
105
How do you add persistence for container "mysql1". The local storage will be /var/dbfiles/
mkdir /var/dbfiles podman unshare chown -R 27:27 /var/dbfiles podman run -d mysql1 -v /var/bdfiles:/var/lib/mysql:Z
106
How do you you make container "http1" start automatically at boot?
mkdir -p ~/.config/systemd/user podman generate systemd --name http1 --files -new #will create .service file mv container-http1.service ~/.config/systemd/user/ podman stop http1 systemctl --user daemon-reload systemctl --user enable --now container-http1 loginctl enable-linger
107
Create a container image from container configuration files in the directory http-dev. Name it http-client:9.0
podman build -t http-client:9.0 http-dev/
108
How do you copy the inventory.sql script into the /tmp directory of db-app1 mysql container?
podman cp inventory.sql db-app01:/tmp/inventory.sql
109
How do you execute the "inventory.sql" script within container db-app01's /tmp directory into mysql, "inventory" db as the root user?
podman exec -it db-app01 sh -c "mysql -u root inventory < /tmp/inventory.sql"
110
How do you inspect container remote.repo.com/remote_repo
skopeo inspect docker://remote.repo.com/remote_repo
111
What flag allows an environmental variable to be passed into a container upon creation?
-e
112
How can you quickly view all dnf repos installed and available to use
dnf repolist
113
Create 2 files (file1.txt and file2.txt) in one command.
# remember, NO SPACES touch {file1,file2}.txt # remember (NO SPACES) OR touch file{1..2}.txt
114
How do you view the current target, list all targets and update to the multi-user target
systemctl get-default systemctl list-units --type=target --all systemctl set-default multi-user.target
115
How do you persistently mount swap space /dev/vdc1? Ensure it is active and then check it.
lsblk -0 UUID /dev/vdc1 (to get UUID) vim /etc/fstab UUID={UUID} swap swap defaults 0 0 swapon -a (to load swap shares from fstab) swapon -s (to check)
116
How do you temporarily mount remote.share.com:/share to /local-share and check the file system type?
mount remote.share.com:/share /local-share df -T /local-share
117
Adjust the firewall settings to block all connection requests that originate from 172.25.250.10
firewall-cmd --add-source=172.25.250.10/32 \ --zone=block --permanent firewall-cmd --reload
118
configure the podmgr user with redhat as the password and set up the appropriate tools for the podmgr user to manage the containers
Become root Dnf install contailer-tools useradd podmgr passwd podmgr Switch to podmgr mkdir -p ~/.config/containers
119
With the user podmgr, configure the registry.lab.example.com as the remote registry. Conf files are located in /tmp/review4/registries.conf
> as podmgr mkdir -p ~/.config/containers chown -R podmgr:podmgr ~/home/.config podman login registry.lab.example.com
120
Configure the /home/podmgr/storage/database subdirectory so that you can use it as persistent storage for a container.
mkdir -p /home/podmgr/storage/database chown 0777 /home/podmgr/storage/database
121
ssh to student@serverb using password authentication, not pka
ssh -o pubkeyauthentication=no -o passwordauthentication=yes student@serverb
122
3 commands to monitor system loads?
uptime top lscpu
123
Enable the package used for system tuning. View all tuning profiles. View the recommended tuning profile. Change the current profile to "virtual guest"
dnf install tuned tuned-adm list tuned-adm recommend tuned-adm enable --now virtual-guest
124
Start a new process with command "cat /dev/zero" with a "nice" value of 10
nice -n 10 cat /dev/zero
125
2 methods to renice process number 1?
top > r > {New Value} > {PID} OR renice -n {New Value} {PID}
126
Create a hard link to /home/user/
ln /home/user
127
Create a soft link to /home/user/
ln -s /home/user/