文章目录
系统安装
安装说明:
。建议下载 *.minimal.iso即可
- 建议英文安装
- 时区选择中国上海
- 硬盘分区默认auto就可以(auto模式,空间都给了跟目录)
- 网卡建议设置好,一定要设置成on
- 这个文章是8.2版本写的,最新的8.3、 8.4 、8.5都适用的
常用操作
WEB管理平台Cockpit
centos8一个改变就是提供了一个web界面管理服务器,这个web服务名称叫Cockpit。 开启命令
systemctl start cockpit.socket
systemctl enable cockpit.socket
可以在浏览器中运行 http://ip:9090
常用命令安装
– netstat 命令安装
dnf install net-tools
时间同步
如果没有安装 请运行 dnf install chrony
vi /etc/chrony.conf
更改时区
timedatectl set-timezone Asia/Shanghai
注释掉
pool 2.centos.pool.ntp.org iburst
加入新的的时间服务器
server 182.92.12.11 iburst
server ntp.aliyun.com iburst
重启服务
systemctl restart chronyd.service
此时时间已经与网络时间同步
设置开机自启
systemctl enable chronyd.service
手工同步一下
chronyc sources -v
离线Rpm包获取
- 离线包下载,比如mysqld
dnf install mysql-server --downloadonly
- 离线包目录 /var/cache/dnf里面的 /var/cache/dnf/BaseOS-??/packages 或 /var/cache/dnf/AppStream-??/packages
- 离线安装RPM先运行
rpm --import /etc/pki/rpm-gpg/RPM*
否则提示key错误等
安全设置
Selinue配置(建议关闭)
临时关闭
# 临时关闭
setenforce 0
永久关闭方案
- 编辑 /etc/sysconfig/selinux
- SELINUX=enforcing 改为 SELINUX=disabled
防火墙配置
# 开启开机启动/关闭
systemctl enable firewalld.service
systemctl disable firewalld.service
#打开/关闭/重启命令
systemctl start firewalld.service
systemctl stop firewalld.service
systemctl restart firewalld.service
#查询状态
systemctl status firewalld.service