RHCSA: Red Hat Certified System Administrator Flashcards
system activity reporter
cpu
sar -u
sysstat
installation
INSTALL
yum -y install sysstat
systemctl start sysstat
systemctl enable sysstat
shutdown in 10 min with msg
shutdown -h 10 “msg”
shutdown -h 10: when no login possible
5 min before power off
prompt every time for pw
sudo visudo
Defaults timestamp_timeout=0
grub: enter recovery mode on boot
ESC grub
e to edit
line ‘linux16 …’ goto end
append systemd.unit=rescue.target
CTRL+x
tar
archive the ceph/ directory with default settings
tar -cvf ceph.tar ceph
grub: set passwd
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!
grub2: enable recovery mode
CENTOS7 RECOVERY MODE
sudo vi /etc/default/grub
GRUB_DISABLE_RECOVERY=”false”
grub2-mkconfig -o /boot/grub2/grub.cfg
Report virtual memory statistics
every 5 sec three times in MB
vmstat 5 3 -S M
terminate a process
brute force and can leave orphaned processes
kill -9 | -kill | -sigkill PID
lost passwd
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
processes bound to port
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
shell variable
current process
$$
run a program with modified scheduling priority
nice
write / wall
write
wall
mesg y|n
run level
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
nmcli
nmcli conn show
nmcli conn up
cpio
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
network scripts
/etc/sysconfig/network-scripts
grubby
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
grub: re-install
BIOS BASED MACHINE
grub2-install /dev/sda
EFI BASED MACHINE
yum reinstall grub2-efi shim
system activity reporter
memory
sar -r