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