CentOS7新特性

区别1 网络管理

1.1 网卡名称

CentOS的网卡名称:

centos6的网卡名称eth0

centos7的网卡名称ens33

1.2 网络服务

CentOS7保留了service可以管理network

1601197593152

CentOS7保留了两个chkconfig的服务:

1601197546756

1.3 设置static的ip地址

vim /etc/sysconfig/network-scripts/ifcfg-ens33
ONBOOT="yes"
BOOTPROTO="static"
ADDR=192.168.255.99(IP地址)
GATEWAY=192.168.255.2(网关)
DNS1=192.168.255.2(域名解析)

然后重启网络服务:

service network restart

区别2 服务管理

2.1 服务指令

CentOS7采用新的指令systemctl进行服务管理。

systemctl start|stop|restart|status 服务名

service保留了两个两个网络的服务

2.2 服务名

防火墙:

CentOS6:iptables

CentOS7:firewalld

CentOS6网络防火墙操作:

关闭防火墙服务
service iptables stop
开启防火墙服务
service iptables start
重启防火墙服务
service iptables restart
查看防火墙状态
service iptables status

关闭防火墙开机自启
chkconfig iptables off
开启防火墙开机自启
chkconfig iptables on
查看防火墙自启状态
chkconfig --list |grep iptables

CentOS7关闭网络防火墙:

关闭防火墙服务
systemctl stop firewalld
开启防火墙服务
systemctl start firewalld
重启防火墙服务
systemctl restart firewalld
查看防火墙状态
systemctl status firewalld

查看防火墙自启状态
systemctl list-unit-files | grep firewalld
关闭防火墙开机自启
systemctl disable firewalld
开启防火墙开机自启
systemctl enable firewalld

区别3 主机名设置

CentOS6:

1601201606547

vim /etc/sysconfig/network

1601201245694

CentOS7:

1601201650283

vim /etc/sysconfig/hostname

1601201405607

修改hosts映射指令不变

vim /etc/hosts

区别4 运行级别

CentOS6:7个运行级别

cat /etc/inittab
# Default runlevel. The runlevels used are:
#   0 - halt (Do NOT set initdefault to this)
#   1 - Single user mode
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
#   3 - Full multiuser mode
#   4 - unused
#   5 - X11
#   6 - reboot (Do NOT set initdefault to this)

CentOS7:2个运行级别

但是仍然能够通过init n 进行切换运行级别。

# multi-user.target: analogous to runlevel 3
# graphical.target: analogous to runlevel 5

区别5 修改root密码

CentOS6:

在系统启动时按enter进入:

1601204649598

1601204722538

1601204776614

1601204826144

1601204948349

CentOS7:

1.重启Linux,见到下图,通过键盘上下方向键选择第一个

1601205534153

2.按e,出现如图5-9所示的界面

1601205551657

3.定位到LANG=zh_CN.UTF-8,后面追加 init=/bin/sh

1601205576783

4.键盘ctrl+x进行引导启动,进入如下界面

1601205590921

5. 挂载根目录

6. 选择要修改密码的用户名,passwd root, 然后输入两次一致的密码,依次回车。

​ 注意: 输入密码不显示,一定要确认输入正确.

7. 更新系统信息 touch /.autorelabel

8.最后输入exec /sbin/init 命令重启系统即可

1601205655526

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

最佳第六六六人

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值