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

A

sar -b

25
Q

system activity reporter
network

A

sar -n DEV

26
Q

system activity reporter
load avg

A

sar -q

27
Q

system activity reporter
log storage

A

/var/log/sa/

28
Q

system activity reporter
query log with start and end time

A

sar -s 14:50:00 -e 15:10:00 -f /var/log/sa/sa15

29
Q

sysstat
config files

A

cat /etc/cron.d/sysstat
cat /etc/sysconfig/sysstat

30
Q

Report Central Processing Unit (CPU) statistics and input/output statistics for devices and partitions

A

iostat

31
Q

iostat for cpu human readable

A

iostat -ch

32
Q

iostat for disk human readable

A

iostat -dh

33
Q

iostat for disk in mega byte

A

iostat -m

34
Q

iostat for cpu human readable every five seconds five times

A

iostat 5 3 -ch

35
Q

Report statistics for Linux tasks

A

pidstat

36
Q

Report statistics for Linux tasks every five seconds three times for the current process

A

pidstat -p $$ 5 3

37
Q

Report statistics for Linux tasks every five seconds three times for gedit

A

pidstat -p $(pgrep gedit) 5 3

38
Q

Report processors related statistics
for all processors

A

mpstat -P ALL

39
Q

Report processors related statistics
for processor 1 every five seconds three times

A

mpstat -P 1 5 3

40
Q

tar
archive and compress the ceph/ directory as gzip

A

tar -cvzf ceph.tar.gz ceph

41
Q

tar
archive and compress the ceph/ directory as bzip2

A

tar -cvjf ceph.tar.bz2 ceph

42
Q

tar
unpack the gz archive into tmp/

A

tar -C ~/tmp -xzf data_flow.tar.gz

43
Q

tar
list content of archive

A

tar -tvf ceph.tar

44
Q

tar
incremental backup

A

tar -cvf my0.tar -g my.snar ceph/
tar -cvf my1.tar -g my.snar ceph/

45
Q

tar
incremental restore

A

tar -xvf my0.tar -g /dev/null
tar -xvf my1.tar -g /dev/null

46
Q

Report virtual memory statistics
summarize disk statistics

A

vmstat -D

47
Q

Report virtual memory statistics
disk statistics

A

vmstat -d

48
Q

Report virtual memory statistics
event counter statistics

A

vmstat -s

49
Q

terminate a process
allow the process to clean up behind itself

A

kill -15 | -term | -sigterm PID

50
Q

change and print terminal line settings
print all current settings in human-readable form

A

stty -a

51
Q

look up process based on name
find ‘edit’ like processes
list PID and process name

A

pgrep edit -l

52
Q

look up process based on name
find ‘edit’ like processes
list PID and full command line

A

pgrep edit -a

53
Q

look up process based on name
find ‘edit’ like processes
use full process name to match

A

pgrep edit -f

54
Q

report a snapshot of the ssh processes
extra full
based on the name

A

ps -F -p $(pgrep ssh -f)

55
Q

kill processes based on name

A

pkill proc_name

56
Q

proc details of current process

A

cd /proc/$$

57
Q

list all available runlevels

A

systemctl list-units –type=target

58
Q

set the multi-user.target

A

systemctl set-default multi-user.target
reboot