• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
山石岩
天行健,君子以自强不息; 地势坤,君子以厚德载物!
博客园    首页    新随笔    联系   管理    订阅  订阅

CentOS7 配置环境

1.安装CentOS 配置环境

(1)虚拟机中安装CentOS,进入系统使用yum命令不止正常执行……

  

   原因:

   需要设置网卡激活

   解决方法:

    vi /etc/sysconfig/network-scripts/ifcfg-ens33

   修改:ONBOOT=yes

 

  重启计算机: reboot

(2)安装openssh-server,全部手敲命令行太累,偷个懒 ,装完openssh 可用ssh命令在windows上连接centOS

    yum -install -y openssh-server

   安装完了需要修改配置文件:

   vi /etc/ssh/sshd_config

修改内容:

Port 22
ListenAddress 0.0.0.0
ListenAddress ::
PermitRootLogin yes
PasswordAuthentication yes

 

 

 

(3)设置防火墙权限

  关闭firewall 安装iptables 修改配置文件

#关闭firewall
systemctl stop firewalld #关闭firewall
systemctl disable firewalld#禁用firewall
systemctl enable firewalld #启用firewall
systemctl status firewalld #查看firewall 状态

yum install iptables

systemctl stop iptables # 关闭iptables
systemctl start iptables # 启动iptables
systemctl restart iptables # 重启 iptables
systemctl enable iptables# 启用
systemctl disable iptables#禁用
systemctl status iptables#查看状态

 

sudo systemctl stop firewalld.service
sudo systemctl disable firewalld.service
sudo yum install iptables-services
sudo systemctl enable iptables
sudo systemctl enable ip6tables
sudo systemctl start iptables
sudo systemctl start ip6tables

 

vi /etc/sysconfig/iptables

 

 这时候只是把系统环境配置好了,能进行远程访问了,使用苦逼的命令行太难受了。。。。。

 

posted @ 2019-01-14 18:17  猥琐的疯子  阅读(481)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3