centos系统使用基本环境

centos系统使用的基本环境配置简述

1.配置网络文件

vim /etc/sysconfig/network-scripts/ifcfg-ens33
	#修改BOOTPROTO为static和ONBOOT为yes
	BOOTPROTO=static
	ONBOOT=yes
	#添加静态IP地址及相关信息
	IPADDR=192.168.71.11
	GATEWAY=192.168.71.2
	NETMASK=255.255.255.0
	DNS1=114.114.114.114
	DNS2=8.8.8.8
systemctl restart network

2.关闭防火墙并设置开机不自启动

systemctl stop firewalld
systemctl disabled firewalld
systemctl status firewalld

3.临时或永久关闭selinux

#临时关闭(重启失效)
getenforce #查看
setenforce 0 #临时关闭selinux
#永久关闭
vim /etc/selinux/config
	Enforcing=disabled
#重启系统
reboot

4.修改主机名并配置IP与主机名映射

vim /etc/hostname
	server1
reboot
vim /etc/hosts
	192.168.71.11 server1

5.设置系统光盘开机自动挂载

echo ”/dev/cdrom /mnt iso9660 defaults 0 0“ >> /etc/fstab
mount -a
df -h  #查看挂载信息

6.配置本地yum源

ls /etc/yum.repos.d/ #查看所有的repo源
rm -rf /etc/yum.repos.d/* #删除所有repo源
vim /etc/yum.repos.d/CentOS7.repo
	[CentOS7]
	name=CentOS7-Server
	baseurl=file:///mnt
	enabled=1
	gpgcheck=0
yum clean all #清空yum缓存
yum repolist #生成yum缓存

7.配置网络yum源

wget -O /etc/yum.repos.d/CentOS-Base.repo 
http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all 
yum repolist

8.配置企业linux扩展源(epel)

#epel:Extra Packages for Enterprise Linux,企业版Linux的额外软件包
yum install -y epel-release
yum clean all
yum repolist
la /etc/yum.repos.d
	CentOS7.repo  CentOS-Base.repo  epel.repo  epel-testing.repo

9.拍摄快照

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值