内容一:Linux 软件库配置文件
/etc/ld.so.conf
/etc/ld.so.conf
# gourpadd whocansu
(补充:这里以创建组 whocansu 为例)
# usermod -a -G whocansu zhumingyu
或者:
# usermod -aG whocansu zhumingyu
(补充:这里以将用户 zhumingyu 添加到 whocansu 组为例)
# vim /etc/pam.d/su
在此行下面:
......
# Uncomment the following line to require a user to be in the "wheel" group.
......
将以下内容
......
# auth required pam_wheel.so use_uid
......
修改为:
......
auth required pam_wheel.so use_uid group=whocansu
......
(补充:这里以只允许组 whocansu 可以使用 su 命令为例)
(
注意:
1) 此时如果用户有 sudo su 权限的话,那么依旧可以通过 sudo su 命令切换到 root
2) RockyLinux & RHEL 的 /etc/pam.d/su 文件里的每行都有严格的顺序,如果顺序错误,则所有用户都将不能再使用 su 命令,包括 sudo su 命令
)
# localectl set-locale LANG=en_US.UTF-8
(补充:这里以将 locale 设置为 en_US.UTF-8 为例)
# vi /etc/locale.conf
将全部内容修改如下:
LANG=en_US.UTF-8
(补充:这里以将 locale 设置为 en_US.UTF-8 为例)
# vi ~/.bash_profile
添加以下内容:
......
LANG=en_US.UTF-8
(补充:这里以给当前用户将 locale 设置为 en_US.UTF-8 为例)
# vi ~/.bashrc
添加以下内容:
......
LANG=en_US.UTF-8
(补充:这里以给当前用户将 locale 设置为 en_US.UTF-8 为例)
# locale -a
# gourpadd whocansu
(补充:这里以创建组 whocansu 为例)
# usermod -a -G whocansu zhumingyu
或者:
# usermod -aG whocansu zhumingyu
(补充:这里以将用户 zhumingyu 添加到 whocansu 组为例)
# vim /etc/pam.d/su
添加以下内容:
#%PAM-1.0
auth required pam_wheel.so use_uid group=whocansu
......
(补充:这里以只允许组 whocansu 可以使用 su 命令为例)
(注意:此时如果用户有 sudo su 权限的话,那么依旧可以通过 sudo su 命令切换到 root)
# vi /etc/security/limites.conf
Add these lines:
......
rmt - nofile 1024
rmt - nproc 1024
(Add: Setting the rmt user can open 8192 files and 8192 processes in this Linux as an example here)
# /bin/systemctl show 'rmt-server-mirror.service' | sort
......
LimitNOFILE=524288
......
(Add: The amount of opening the file by program rmt-server-mirror.service is limited at 8096 as an example here)