RHCSA: Red Hat Certified System Administrator Flashcards

1
Q

system activity reporter
cpu

A

sar -u

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

sysstat
installation

A

INSTALL
yum -y install sysstat
systemctl start sysstat
systemctl enable sysstat

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

shutdown in 10 min with msg

A

shutdown -h 10 “msg”

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

shutdown -h 10: when no login possible

A

5 min before power off

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

prompt every time for pw

A

sudo visudo
Defaults timestamp_timeout=0

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

grub: enter recovery mode on boot

A

ESC grub
e to edit
line ‘linux16 …’ goto end
append systemd.unit=rescue.target
CTRL+x

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

tar
archive the ceph/ directory with default settings

A

tar -cvf ceph.tar ceph

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

grub: set passwd

A

GRUB PASSWORD
[root@muc-nb-gludwig]~# cp /etc/grub.d/01_users .
vi 01_users
#!/bin/sh -e
cat << EOF
set superusers=”gunnar”
password gunnar L1nux
EOF
this user doesn’t relate to the users on the OS
grub2-mkconfig -o /boot/grub2/grub.cfg

grub2-mkpassword-pbkdf2
#!/bin/sh -e
cat << EOF
set superusers=”gunnar”
password_pbkdf2 gunnar new_hashed_password
EOF
grub2-mkconfig -o /boot/grub2/grub.cfg

ACHTUNG! us keyboard is set in grub!

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

grub2: enable recovery mode

A

CENTOS7 RECOVERY MODE
sudo vi /etc/default/grub
GRUB_DISABLE_RECOVERY=”false”
grub2-mkconfig -o /boot/grub2/grub.cfg

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

Report virtual memory statistics
every 5 sec three times in MB

A

vmstat 5 3 -S M

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

terminate a process
brute force and can leave orphaned processes

A

kill -9 | -kill | -sigkill PID

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

lost passwd

A

CENTOS 7 LOST PASSWORD
ESC grub
e to edit
line ‘linux16 …’ goto end
remove ‘rhgd quite’
add ‘rd.break enforcing=0’
CTRL+x
(it stopps after completing the ramdisk phase)
switch_root:/# mount -o remount,rw /sysroot; chroot /sysroot
sh-4.3$ passwd; exit
switch_root:/# mount -o remount,ro /sysroot; exit (boot process is then continued)
login as root
restorecon /etc/shadow
setenforce 1

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

processes bound to port

A
sudo yum install net-tools 
sudo netstat -tulpn | grep :80 
# sudo yum install lsof 
sudo lsof -i :80 
sudo lsof -i TCP:80 
# sudo yum install psmisc 
fuser 80/tcp
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

shell variable
current process

A

$$

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

run a program with modified scheduling priority

A

nice

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

write / wall

A

write
wall
mesg y|n

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

run level

A

who -r
runlevel
sudo systemctl get-default
systemctl isolate multi-user.target # stops everything what is not allowed to run in that level, but not set permanently
systemctl isolate rescue.target # single user mode

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

nmcli

A

nmcli conn show
nmcli conn up

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

cpio

A

find ceph -name ‘*.sh’ | cpio -o > ceph.cpio
find ceph -name ‘*.sh’ | cpio -o -H ustar > ceph1.cpio

mkdir ceph1
cd ceph1
cpio -id < ../ceph1.cpio

*NOTE* this tool is obsolete and if used it should use ustar:
cpio -o -H ustar

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

network scripts

A

/etc/sysconfig/network-scripts

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

grubby

A

grubby –default-kernel
grubby –set-default /boot/vmlinuz-4.18.0-240.1.1.el8_3.x86_64
grubby –info=ALL
grubby –info /boot/vmlinuz-4.18.0-240.1.1.el8_3.x86_64
grubby –remove-args=”rhgb quiet” –update-kernel /boot/vmlinuz-4.18.0-193.28.1.el8_2.x86_64

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

grub: re-install

A

BIOS BASED MACHINE
grub2-install /dev/sda
EFI BASED MACHINE
yum reinstall grub2-efi shim

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

system activity reporter
memory

A

sar -r

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

system activity reporter
disk

25
system activity reporter network
sar -n DEV
26
system activity reporter load avg
sar -q
27
system activity reporter log storage
/var/log/sa/
28
system activity reporter query log with start and end time
sar -s 14:50:00 -e 15:10:00 -f /var/log/sa/sa15
29
sysstat config files
cat /etc/cron.d/sysstat cat /etc/sysconfig/sysstat
30
Report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions
iostat
31
iostat for cpu human readable
iostat -ch
32
iostat for disk human readable
iostat -dh
33
iostat for disk in mega byte
iostat -m
34
iostat for cpu human readable every five seconds five times
iostat 5 3 -ch
35
Report statistics for Linux tasks
pidstat
36
Report statistics for Linux tasks every five seconds three times for the current process
pidstat -p $$ 5 3
37
Report statistics for Linux tasks every five seconds three times for gedit
pidstat -p $(pgrep gedit) 5 3
38
Report processors related statistics for all processors
mpstat -P ALL
39
Report processors related statistics for processor 1 every five seconds three times
mpstat -P 1 5 3
40
tar archive and compress the ceph/ directory as gzip
tar -cvzf ceph.tar.gz ceph
41
tar archive and compress the ceph/ directory as bzip2
tar -cvjf ceph.tar.bz2 ceph
42
tar unpack the gz archive into tmp/
tar -C ~/tmp -xzf data\_flow.tar.gz
43
tar list content of archive
tar -tvf ceph.tar
44
tar incremental backup
tar -cvf my0.tar -g my.snar ceph/ tar -cvf my1.tar -g my.snar ceph/
45
tar incremental restore
tar -xvf my0.tar -g /dev/null tar -xvf my1.tar -g /dev/null
46
Report virtual memory statistics summarize disk statistics
vmstat -D
47
Report virtual memory statistics disk statistics
vmstat -d
48
Report virtual memory statistics event counter statistics
vmstat -s
49
terminate a process allow the process to clean up behind itself
kill -15 | -term | -sigterm PID
50
change and print terminal line settings print all current settings in human-readable form
stty -a
51
look up process based on name find 'edit' like processes list PID and process name
pgrep edit -l
52
look up process based on name find 'edit' like processes list PID and full command line
pgrep edit -a
53
look up process based on name find 'edit' like processes use full process name to match
pgrep edit -f
54
report a snapshot of the ssh processes extra full based on the name
ps -F -p $(pgrep ssh -f)
55
kill processes based on name
pkill proc\_name
56
proc details of current process
cd /proc/$$
57
list all available runlevels
systemctl list-units --type=target
58
set the multi-user.target
systemctl set-default multi-user.target reboot