- 配置IP.网关.DNS连接互联网
vim /etc/NetworkManager/system-connections/ens33.nmconnection ###网络配置文件
[connection]
id=ens33
uuid=3c17691d-cccc-xxxx-zzzz-xzxzxczxcczx
type=ethernet
autoconnect-priority=-999
interface-name=ens33
timestamp=1732001143
[ethernet]
[ipv4]
address1=192.168.27.19/24,192.168.27.254 ### IP/网关
dns=192.168.27.1;114.114.114.114;223.5.5.5;8.8.8.8 ###dns配置,多dns;分隔
method=manual
[ipv6]
addr-gen-mode=eui64
method=auto
[proxy]
完成后重新加载和重启网卡
nmcli c reload & nmcli c up ens33
- 设置root登录
vim /etc/ssh/sshd_configcat /etc/ssh/sshd_config ### ssh配置文件未变
添加内容
PermitRootLogin yes
完成后重启sshd服务
systemctl restart sshd
- 修改国内源
cd /etc/yum.repos.d/ && cp centos.repo centos.repo.bak ### 路径未变,保存源repo文件后,修改centos.repo
### 阿里源示例
vim centos.repo
[baseos]
name=CentOS Stream $releasever - BaseOS
#metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-$stream&arch=$basearch&protocol=https,http
baseurl=https://mirrors.aliyun.com/centos-stream/9-stream/BaseOS/$basearch/os/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1
##########
##########
[appstream]
name=CentOS Stream $releasever - AppStream
# metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http
baseurl=https://mirrors.aliyun.com/centos-stream/9-stream/AppStream/$basearch/os/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=1
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1
完成后清理缓存并加载新源
dnf clean all && dnf makecache