[步骤] Linux 全局加密 SSL 的设置 (CentOS 8 & RHEL 8 版)

步骤一:查看当前 SSL 全局加密 SSL 的状况

# update-crypto-policies --show
DEFAULT

(补充:这里的 DEFAULT 表示可以使用 2048 位及以上位数的 SSL)

步骤二:切换当前 SSL 全局加密 SSL

# update-crypto-policies --set FUTURE


补充:
1) 这里以将全局加密 SSL 切换到 FUTURE 状态为例
2) 此时只能使用 4096 位及以上位数的 SSL

[内容] Linux 官方软件库链接列表 (CentOS 版)

内容一:CentOS 7 基础库列表
1.1 CentOS 7 基础库官方链接列表
1.1.1 CentOS-7 – Base

http://mirror.centos.org/centos/7/os/x86_64/

1.1.2 CentOS-7 – Updates

http://mirror.centos.org/centos/7/updates/x86_64/

1.1.3 CentOS-7 – Extras

http://mirror.centos.org/centos/7/extras/x86_64/

1.1.4 CentOS-7 – Plus

http://mirror.centos.org/centos/7/centosplus/x86_64/

1.2 CentOS 7 基础库官方推荐列表
1.2.1 CentOS-7 – Base

http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=$infra

1.2.2 CentOS-7 – Updates

http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates&infra=$infra

1.2.3 CentOS-7 – Extras

http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=$infra

1.2.4 CentOS-7 – Plus

http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=centosplus&infra=$infra

内容二:CentOS 8 基础库列表
2.1 CentOS 8 基础库官方链接列表
2.1.1 CentOS Linux 8 – BaseOS

http://mirror.centos.org/centos/8/BaseOS/x86_64/os/

2.1.2 CentOS-8 – Updates

http://mirror.centos.org/centos/8/AppStream/x86_64/os/

2.2 CentOS 8 基础库官方推荐列表
2.2.1 CentOS Linux 8 – BaseOS

http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=BaseOS&infra=$infra

2.2.2 CentOS Linux 8 – AppStream

http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=$infra

[工具] Shell 批量设置官方软件源 (openSUSE Leap 15.2 版)

介绍:

作者:朱明宇
名称:批量设置官方软件源(openSUSE 版)
作用:批量设置官方软件源(openSUSE 版)

使用方法:
1. 服务器清单 $add_repo_servers_list.txt 每一个服务器名占用一行,并和此脚本放在同一目录下
2. 在此脚本的分割线内写入相应的内容
3. 给此脚本添加执行权限
4. 执行此脚本

脚本分割线里的变量:
add_repo_servers_list.txt #指定存放要设置官方软件源的文件

注意:
1. 此脚本执行前必须要先保证执行此脚本的用户能无密码 ssh 远程这些远程服务器
2. 服务器的系统需要是 openSUSE 15.2 版本
3. 服务器系统要配置好可用的软件源(最好是软件数量最多的官方版本)
4. 这些远程服务器要能够连接外网

脚本:

#!/bin/bash

####################### Separator ########################

add_repo_servers_list.txt

####################### Separator ########################

cat add_repo_servers_list.txt
read -p "will add opensuse_leap_15.2 repo please input y " a
echo $a

if [ "$a" != "y" ];then
        echo "you don't agree so exit now"
        exit
fi

for i in `awk '{print $1}' add_repo_servers_list.txt`
do
        ssh $i '
        sudo -u root su - root -c "zypper mr -da"
        sudo -u root su - root -c "zypper ar -fcg http://download.opensuse.org/distribution/leap/15.2/repo/oss/ OpenSUSE_Leap_152_x64_update-oss"
        sudo -u root su - root -c "zypper ar -fcg http://download.opensuse.org/distribution/leap/15.2/repo/non-oss/ OpenSUSE_Leap_152_x64_update-non-oss"
        sudo -u root su - root -c "zypper ar -fcg http://download.opensuse.org/update/leap/15.2/oss/ OpenSUSE_Leap_152_x64_oss"
        sudo -u root su - root -c "zypper ar -fcg http://download.opensuse.org/update/leap/15.2/non-oss/ OpenSUSE_Leap_152_x64_non-oss"
        sudo -u root su - root -c "zypper ref"
done

[命令] CentOS 8 & RHEL 8 命令 (管理软件包)

案例一: 安装某个软件包
1.1 交互式安装某个软件包

# dnf install nginx

(补充:这里以安装名为 Nginx 软件包为例)

1.2 非交互式安装某个软件包

# dnf -y install nginx

(补充:这里以安装名为 Nginx 软件包为例)

案例二:删除某一个软件包
2.1 交互式安装某个软件包

# dnf remove nginx

(补充:这里以删除名为 Nginx 软件包为例)

2.2 非交互式安装某个软件包

# dnf -y remove nginx

(补充:这里以删除名为 Nginx 软件包为例)

案例三:升级所有软件包和内核
3.1 非交互式升级所有软件包和内核

# dnf update

3.2 交互式升级所有软件包和内核

# dnf -y update

3.3 交互式升级除了某一个软件包或内核外的所有内容

# dnf update --exclude=kernel*

(补充:这里以升级除了以 kernel 开头以外的所有软件包和内核为例)

案例四:查找提供某个命令的软件包

# dnf provides yum

(补充:这里以查找提供 yum 命令的软件包为例)

案例五:查看所有已安装的软件包

# dnf list all

案例六:查看某一个软件包的具体信息

# dnf list all | grep nginx

(补充:这里以查看名为 Nginx 软件包为例)

案例七:查看 dnf 的历史命令

# dnf history

案例八:查看 dnf 安装包的记录

# dnf history info