at 命令
at 命令白名单文件
/etc/at.allow
at 命令黑名单文件
/etc/at.deny
cron 命令
cron 命令白名单文件
/etc/cron.allow
cron 命令黑名单文件
/etc/cron.deny
/etc/at.allow
/etc/at.deny
/etc/cron.allow
/etc/cron.deny
/dev/vg/lv_var /var xfs nodev,nosuid,noexec 0 0
/dev/vg/lv_var_log /var/log xfs nodev,nosuid,noexec,x-systemd.requires-mounts-for=/var 0 0
(
Add:
1) nodev parameter here means this directory can not be interpreted by devices or blocks
2) nosuid parameter here means no setuid files can be created in this directory
3) noexec parameter here means no files can be executed in this directory
4) x-systemd.requires-mounts-for=/var here parameter means /var/log directory can not be mounted until /var directory has been mounted
)
For RHEL 6, RHEL 7, RHEL 8, RHEL 9
RAM size | Recommended swap size | Recommended swap size if allowing for hibernation |
From 0 to 2GB | 2 times the RAM size | 3 times the RAM size |
From 2GB to 8GB | The same size of the RAM | 2 times the RAM size |
From 8GB to 64GB | At least 4GB | 1.5 times the RAM size |
From 64GB | At least 4GB | Hibernation is not recommended |
Note: A 100GB swap is recommended if system with over 140 logical processes or over 3TB RAM
https://access.redhat.com/solutions/15244
# vi ~/.bashrc
添加以下内容:
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
(步骤略)
# vi /etc/bashrc
添加以下内容:
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
(步骤略)
RHEL 8 的 NetworkManager 软件会自动刷新 /etc/resolv.conf 文件里的内容,将其和 NetworkManager 软件自身设置的一致
/etc/resolv.conf 文件被刷新后 /var/log/messages 文件里会有类似记录
Oct 19 16:20:52 hostname NET[22999]: /etc/sysconfig/network-scripts/ifdown-post : updated /etc/resolv.conf
Oct 19 16:20:57 hostname NET[23222]: /etc/sysconfig/network-scripts/ifup-post : updated /etc/resolv.conf
# vim /etc/sysconfig/network-scripts/ifcfg-ens192
删除以下类似内容:
DNS1=1.1.1.1
(补充:这里以删除 /etc/sysconfig/network-scripts/ifcfg-ens192 网卡文件中 DNS 设置 DNS1=1.1.1.1 为例)
# vim /etc/sysconfig/network-scripts/ifcfg-ens192
在设置了以下内容以后:
......
BOOTPROTO=dhcp
......
添加以下内容:
......
PEERDNS=no
......
(补充:这里以删除 /etc/sysconfig/network-scripts/ifcfg-ens192 网卡文件中 DNS 设置 DNS1=1.1.1.1 为例)
# vim /etc/NetworkManager/NetworkManager.conf
在以下内容下面:
......
[main]
......
添加以下内容:
......
dns=none
......
# chattr +i /etc/resolv.conf
https://access.redhat.com/solutions/7412