Red Hat Cheat Sheet
by nextnely via cheatography.com/71363/cs/18089/
Services Cron (cont) SELinux (cont)
systemctl list-unit- Lists enabled/disabled /etc/cron.deny Disabled Mandatory access control if
files -at service service unit files. turned off.
An empty deny file means nobody is denied.
systemctl list-units - Lists enabled/disabled An empty allow file means nobody is allowed. sestatus Shows SELinux status.
at service running services. If both are missing nobody is allowed. set setenforce Temporarily changes
systemctl list-units -t Shows active running Root always has access. <mode> SELinux mode.
service --state services.
vi SELinux config file.
running RPM
/selinux/config
-t Shows enabled service rpm -qa Queries all installed packages.
unit files. Networking
rpm -qa | sort
-a Shows both enabled
rpm -qi Shows information about the nmtui graphical network editor
and disabled service unit
[package] package.
files.
Logs
rpm -qa Group="System Environment/Shells"
systemctl mask Prevents service from
[service name] starting. rpm --qa -last Shows packages install sorted less -N View rsyslog configuration
by date /etc/rsyslog.conf file with line numbering
turned on.
Cron rpm -ql yum Queries for list of file paths.
cat Lists messages log.
/var/spool/cron/[user] User cron rpm -qc yum
/var/log/message
jobs. rpm -qf [path Query file.
s
/etc/cron.d System to file]
grep -v Lists everything that does
cron jobs. rpm -qdf Shows all documentation for
'systemd:' not include systemd.
[minute 0-59] [hour] [day of the Cron job [path to file] specified command/file. /var/log/message
month] [month of the year] [day time rpm -q --provide s
of the week] [path of script] format.
rpm -q --requires [file] tail -f Follows log file.
crontab-generator.org Crontab /var/log/message
rpm -q -- Shows changes to package.
generator. s
changelog
0 1* Runs job [file] /var/log/secure Private authentication
everyday at messages (logins)
1 a.m. SELinux /etc/cron.daily Logrotate cron job.
0 1 * [user] Format for
Enforcing Security policy is enforced. /etc/logrotate.con Logrotate configuration file.
system
mode f
wide cron
Permissive Security policy is observed and logger Writes message to
jobs.
mode warnings are printed but policy is "message" messages log file.
/etc/at.allow Allow
not enforced.
access to
yum
the AT
services. yum --showduplicates -list Shows versions of
/etc/cron.allow Allow [pacakge name] a package.
access to yum list installed Lists all packages
cron installed.
services.
/etc/at.deny
By nextnely Published 19th December, 2018. Sponsored by Readability-Score.com
cheatography.com/nextnely/ Last updated 19th December, 2018. Measure your website readability!
Page 1 of 3. https://readability-score.com
Red Hat Cheat Sheet
by nextnely via cheatography.com/71363/cs/18089/
yum (cont) yum (cont) Time
Bold Update available in yum versionlock Removes version lock timedatectl Lists local time for
repository. delete [output from from package. current timezone.
yum versionlock]
Bold and underline Current kernel timedatectl list- Filters timezones via
yum update -- Only updates security timezones | grep grep.
Red Package doesn't exist in
security packages. America
repository.
yum update-minimal Install strictly security timedatectl set- Sets timezone.
Yellow Newer package then in
--security updates. Doesn't timezone [timezone]
repository.
include bug fixes.
timedatectl set-time Manually sets time.
yum list updates Lists updates for
packages installed. yum install yum- View package change 24:00:00
plugin changelog logs. timedatectl set-time Manually sets date.
yum list available
yum changelog Gets all change logs 2018-12-30
yum info [package Shows package info.
updates for packages with timedatectl set-ntp true Enables NTP.
name]
updates.
systemctl restart Restarts NTP
yum deplist Shows dependencies for
yum changelog View change log for systemd-timedated service.
[package name] package.
[package name] specific package.
yum install ntp Installs NTP client.
yum search Searches for package
yum list installed Lists currently installed
[package name] name. /etc/ntp.conf NTP config file.
kernel-* kernel.
yum reinstall Reinstalled package. ntpdate -q <server Checks NTP server
ls -l /boot Kernel directory.
[package name] address> address.
uname -r Shows running kernel.
yum reinstall --skip-broken [package name] ntpdate <server Sets NTP server.
yum list available Lists available kernel. address>
yum remove Removes package.
kernel
[package name] systemctl enable Enables NTP
yum -y update kernel Updates kernel. ntpdate synchronization.
yum autoremove Removes packages
yum remove kernel
[package name] including dependencies.
grub2-set-default Changes kernel. Journal
yum package- Shows unused packages.
cleanup [kernel number]
journalctl Lists all journal entries.
yum install yum-utils ls Lists kernel module
journalctl Specifies journal.
/lib/modules/$(uname directory.
yum Checks for updates. /sbin/crond
-r)/kernel
check-update journalctl -f Tails journal.
lsmod Lists modules.
yum list obsoletes mkdir Directory for persistent
yum install yum-plugin-versionlock /var/log/journal journals.
yum versionlock Prevents package from
[package name] updating.
yum versionlock Lists version locked
packages.
By nextnely Published 19th December, 2018. Sponsored by Readability-Score.com
cheatography.com/nextnely/ Last updated 19th December, 2018. Measure your website readability!
Page 2 of 3. https://readability-score.com
Red Hat Cheat Sheet
by nextnely via cheatography.com/71363/cs/18089/
File Access Control File Access Control (cont)
ls -l [file Lists The user-owner is the 664 Default rw-rw-r--
name] group third column from the file
owners. left. THe group-owner is permissi
the fourth column. ons.
(umask
Read (r) 4
002)
Write 2
(w) umask 022 Changes umask.
Execute 1 umask 002 rw-rw-r-- Directories- rwx-
(x) r-xr-x, Files- rwxr--r--
-rw-rw- --userowner-groupowner-other vi ~/bashrc User add new umask to
r-- umask end of file.
startup
chmod Symbolic permission format.
file
u=rwx,g
vi System if [ "$UID" -ge 1000]
=rx,o=
<file> /etc/profile.d wide ;then
/unmash.sh unmask.
chmod Adds permissions format.
getfacl lists -t
u+rwx
<file> ACLs on
<file>
file.
chmod Remove permissions format.
setfacl -m Sets setfacl -m
o-x
user: ACLs on user:root:rwx
<file>
<user>:<pe file. /home/file.txt
chmod Removes execute from all positions.
rmissions>
a-x
aclfile
<file>
setfacl -m group:<group>:<permission> <file>
-R Recursively adds permissions.
setfacl -x -x remove specific
umask View umask.
group:root ACL, -k removes all
umask - View umask in symbolic notation. <file/dir> default ACLs, -b
S removes all ACLs
775 Default rwxrwxrwx
directory
permissi
ons.
755 rwx-r-xr-x
By nextnely Published 19th December, 2018. Sponsored by Readability-Score.com
cheatography.com/nextnely/ Last updated 19th December, 2018. Measure your website readability!
Page 3 of 3. https://readability-score.com