先挂载光盘
[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 状态