Files
docs/Linux/RedHat系文档.md
2026-01-14 11:27:47 +08:00

88 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 软件安装
### 安装pip
```sh
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --user
```
## 安装ansible
```sh
# 为当前用户正常安装
python3 -m pip install --user ansible
# 为当前用户最小安装
python3 -m pip install --user ansible-core
# 升级ansible
python3 -m pip install --upgrade --user ansible
# 隔离环境安装ansible
pip install --user pipx
pipx install --include-deps ansible
pipx upgrade --include-injected ansible
```
# 激活订阅管理
## 命令行取消激活
```sh
# 取消注册
subscription-manager unregister
# 清理文件
subscription-manager clean
```
## 命令行激活订阅
```sh
注册订阅
subscription-manager register --username adhsite@qq.com --password n5HIvS9C3mGb#Esz
```
# firewalld防火墙基本用法
```sh
# 启动:
systemctl start firewalld
#查看状态:
systemctl status firewalld
#停止:
systemctl disable firewalld
# 禁用:
systemctl stop firewalld
# 放通80端口(--permanent永久生效没有此参数重启后失效)
firewall-cmd --zone=public --add-port=80/tcp --permanent
# 关闭80端口
firewall-cmd --zone=public --remove-port=80/tcp --permanent
# 更新防火墙规则:
firewall-cmd --reload
# 查看所有打开的端口:
firewall-cmd --zone=public --list-ports
# 查看版本:
firewall-cmd --version
# 查看帮助:
firewall-cmd --help
# 显示状态:
firewall-cmd --state
# 查看区域信息:
firewall-cmd --get-active-zones
# 查看指定接口所属区域:
firewall-cmd --get-zone-of-interface=eth0
# 拒绝所有包:
firewall-cmd --panic-on
# 取消拒绝状态:
firewall-cmd --panic-off
# 查看是否拒绝:
firewall-cmd --query-panic
# 查看80端口
firewall-cmd --zone=public --query-port=80/tcp
```