近期开展Cent7的学习,每次登陆时发现网络都是自行断开和ssh也未尝开机就启动连接,所以想设置开机自动连接。因为我是虚拟机开启Cent7,因为我配置比较低,每次虚拟机点开画面跳转不到下一个,非常麻烦。废话不多,直接上操作。

 

1、设置网络自动连接,将network设置自动获取地址。

(点击网络符号,选择wire setting,把自动连接打开成On,每次不需要登录图形界面内设置网络)

Cent7的开机启动ssh服务和网络wire netwok自动连接服务

2、开启ssh服务,关闭防火墙,否者从本地访问不到虚机内主机信息。(因为我查看历史指令,所以没有输入结果。不过每个指令稍作解释,让读者看懂。)

[[email protected] ~]# rpm -qa | grep ssh   【#先看看有没有软件包里面有资源,如果没有yum install openssh-server】
openssh-7.4p1-16.el7.x86_64
openssh-server-7.4p1-16.el7.x86_64
openssh-clients-7.4p1-16.el7.x86_64
libssh2-1.4.3-10.el7_2.1.x86_64   
[[email protected] ~]# service sshd restart  【重启sshd服务】
[[email protected] ~]# service iptables stop    【停止防火墙服务】
[[email protected] ~]# systemctl stop firewalld   【开机设置关闭防火墙】
[[email protected] ~]# systemctl disable firewalld  【设置关闭防火墙为关闭模式】

[[email protected] ~]#  firewall-cmd --state  【查看防火墙状态】

[[email protected] ~]#chkconfig sshd on 【加入开机启动,不过cent7里面已经不支持。】
[[email protected] ~]#systemctl enable sshd.service 【加入开机启动,cent7支持。】
[[email protected] ~]# systemctl list-unit-files  【查看开机启动项,static静态,enabled开启,disabled不开启】

Cent7的开机启动ssh服务和网络wire netwok自动连接服务

 

总结:Cent6的设置和Cent7差不多,不过Cent7要求机器配置高一些,我电脑16年生产I5 6400 4G 1T 开启后,都是卡顿卡顿,不是为了研究python编码自发信息的话,不会玩Cent7 ,内容拓展很多指令模式,有兴趣朋友可以敲一敲,继续挖坑装Python3.7.4了。

相关文章:

  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2021-05-24
  • 2022-12-23
  • 2021-07-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案