17.) Review Flashcards
What do you do if a computer won’t boot to login
Edit grub with "e". Add systemd.unit=emergency.target. press ctrl+x # mount -o remount,rw / # vim /etc/fstab # systemctl daemon-reload # systemctl reboot
switch to multi-user target
# systemctl get-default # systemctl isolate multi-user.target
Schedule a recurring job on an hourly bassis between 7-9pm on all days except Saturday and Sunday
$ crontab -e
0 19-21 * * Mon-Fri /home/me/run.sh
$ crontab -l
Create a 2GB partition on /dev/vdb
# parted /dev/vdb mklabel msdos # parted /dev/vdb mkpart primary 1GiB 3GiB # parted /dev/vdb set 1 lvm on
Create a logical volume called vol_home using a 2GiB partition
# pvcreate /dev/vdb1 # vgcreate extra_storage /dev/vdb1 # lvcreate -L 1GiB -n vol_home extra_storage # mkdir /home mkfs -t xfs /dev/extra_storage/vol_home
persistant mount newly created storage
# echo "UUID=88 /home xfs defaults 0 0" /etc/fstab # mount -a
mount network share persistently
echo “10.x.x.87:/share /work nfs rw,sync 0 0”»_space; /etc/fstab
create 512MiB swap
# parted /dev/vdc mklabel msdos # parted /dev/vdc primary linux-swap 1MiB 513MiB # mkswap /dev/vdc1 # echo "UUID=888 swap swap defaults 0 0 " >>ftsab # swapon -a
create users Rabbit1,2,3,4and add them to a group Haus
# groupadd Haus # for i in 1 2 3 4; do useradd -G Haus Rabbit$i; done
configure /run/volatile to store files. Cleanup every 30 seconds. Permissions 0700
# echo "d /run/volatile 0700 root root 30s" >> /etc/tmpfiles.d/volatile.conf # systemd-tmpfiles --create /etc/tmpfiles.d/volatile.conf
Configure /home directories to automatically mount
# yum install autofs # echo "/- /etc/auto.moocow" >> /etc/auto.master.d/moo.autofs # echo "/home/rabbit -rw x.x.x.x:/homedirs/rabbit # systemctl restart autofs
Retrieve a user’s home direcctory path
getent passwd rabbit
Configure SELinux to enable nfs home directories
setsebool -P use_nfs_homedirs true
Adjust firewall settings so that SSH connectings are rejected from x.x.x.x
# firewall-cmd --add-source=x.x.x.x/32 --zone=block --permanent # firewall-cmd --reload
Troubleshoot httpd.service being blocked on port 8080
# systemctl status httpd # sealert -a /var/log/audit/audit.log # semanage port -a -t http_port_t -p tcp 30080 # systemctl restart httpd # firewall-cmd --add-port=30080/tcp --permanent # firewall-cmd --reload