CentOS 7最小化安裝配置

2021-07-25 00:06:48 字數 1104 閱讀 3406

檢視網路狀態,因為ifconfig沒有安裝,所以使用如下命令

ip addr
進入目錄

cd /etc/sysconfig/network-scripts
編輯網絡卡檔案

vi ifcfg-eno16777736
修改或增加如下內容

bootproto=static

#dhcp改為static(修改)

onboot=yes #開機啟用本配置,一般在最後一行(修改)

ipaddr=192.168

.10.5

#靜態ip(增加)

gateway=192.168

.10.1

#預設閘道器(增加)

netmask=255.255

.255

.0#子網掩碼(增加)

dns1=192.168

.10.1

#dns配置,虛擬機器安裝的話,dns就閘道器就行,多個dns**的話再增加(增加)

重啟網絡卡生效

service network restart
修改ssh配置

vi /etc/ssh/sshd_config
開啟如下配置項(去掉前面的#)

port

22protocol 2

permitrootlogin yes

# 備份

mv /etc/yum.repos

.d/centos-base.repo /etc/yum.repos

.d/centos-base.repo

.backup

# 使用阿里雲的映象源倉庫

# 更新倉庫

yum makecache

yum update

yum upgrade

CentOS7最小化安裝配置

1.靜態ip配置 root localhost vim etc sysconfig network scripts ifcfg ens33 bootproto static defroute yes ipaddr 192.168.80.132 netmask 255.255.255.0 gatewa...

CentOS7 最小化安裝完配置

防火牆 yum install y net tools systemctl stop firewalld systemctl disable firewalld.service yum install y iptables services systemctl restart iptables.se...

Centos 7最小化安裝後配置

關閉selinux vi etc sysconfig selinux selinux disabled wq配置網絡卡 最小化安裝後ifconfig無法使用 該配置的前提是採用 nat模式 檢查網絡卡 ip addr 或者 更新yum yum y update聯網後安裝ifconfig yum y ...