CentOS7样板机详细安装细节

先挂载光盘

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens32   # 网卡路径

[root@localhost ~]# ip a   # 查看ip地址

[root@localhost ~]# mkdir -p /media/cdrom   # 递归创建目录

[root@localhost ~]# mount /dev/sr0 /media/cdrom   # 挂载光盘到cdrom这个目录

[root@localhost ~]# sed -i 's/enabled=0/enabled=1/g' /etc/yum.repos.d/CentOS-Media.repo # 修改参数把0改成1 enabled=1

[root@localhost ~]#  yum -y clean all  # 清除yum缓存

[root@localhost ~]#  yum makecache    # 重载yum缓存

[root@localhost ~]# yum -y install net-tools vim gcc gcc-c++ make automake autoconf readline  lrzsz      # 安装常用的和编译语言

[root@localhost ~]# systemctl stop firewalld   # 关闭防火墙

Failed to stop fiewalld.service: Unit fiewalld.service not loaded.

[root@localhost ~]# systemctl disable firewalld   # 关闭防火墙的开机自启

Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. 

Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.  

[root@localhost ~]# systemctl stop NetworkManager   # 关掉selinux

[root@localhost ~]# systemctl disable NetworkManager  # 关掉开机自启动

[root@localhost ~]# chmod +x /etc/rc.d/rc.local  # 给开机自启动脚本加执行权限

[root@localhost ~]# setenforce 0     # 临时关闭selinux

[root@localhost ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config   # 进去修把SELINUX=enforcing改成disabled

[root@localhost ~]# vim /etc/ssh/sshd_config # 进去修改两行文件 set nu 查看行

79 GSSAPIAuthentication no

115 UseDNS no

[root@localhost ~]# systemctl restart sshd    # 重启服务
[root@localhost ~]# init 0 # 不用清理缓存直接关机  

systemctl   万能的

stop   暂停

start   开启

restart 重启

status 查看状态

disable   关闭开机自启

enable    开启开机自启

status    状态

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

王惠祺

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

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

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

打赏作者

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

抵扣说明:

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

余额充值