远程:mstsc
计算器:calc
画图板:mspaint
记事本:notepad
注册表:regedit
linux 进入图形页面 startx
linux小命令
tar zxvf /bbs.tar.zip -C /zzz/bbs 解压文件到指定目录
vi编辑时可以通过 /xxx 定位位置
cp -r FastDFS/conf/* /etc/fdfs/
centos7:
ip查看:ip addr
防火墙状态查看:service firewalld status disables表示禁止开机启动 enable表示开机自启 inactive表示防火墙关闭状态 activated表示开启状态
开启防火墙:service firewalld start
关闭防火墙:service firewalld stop
重启防火墙:service firewalld restart
禁止防火墙开机自启:systemctl disable firewalld.service
设置防火墙开机自启:systemctl enable firewalld
卸载firewall:yum remove firewalld
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤。
1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
安装iptables防火墙及操作:
安装iptables防火墙:yum install iptables-services
编辑防火墙配置文件:vi /etc/sysconfig/iptables
添加端口配置:-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
重启防火墙:systemctl restart iptables.service
设置防火墙开机自启:systemctl enable iptables.service
CentOS7使用firewalld打开关闭防火墙与端口
1、firewalld的基本使用
启动: systemctl start firewalld
查看状态: systemctl status firewalld
停止: systemctl disable firewalld
禁用: systemctl stop firewalld
2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。
启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctl stop firewalld.service
重启一个服务:systemctl restart firewalld.service
显示一个服务的状态:systemctl status firewalld.service
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.service
查看服务是否开机启动:systemctl is-enabled firewalld.service
查看已启动的服务列表:systemctl list-unit-files|grep enabled
查看启动失败的服务列表:systemctl --failed
3.配置firewalld-cmd
查看版本: firewall-cmd --version
查看帮助: firewall-cmd --help
显示状态: firewall-cmd --state
查看所有打开的端口: firewall-cmd --zone=public --list-ports
更新防火墙规则: firewall-cmd --reload
查看区域信息: firewall-cmd --get-active-zones
查看指定接口所属区域: firewall-cmd --get-zone-of-interface=eth0
拒绝所有包:firewall-cmd --panic-on
取消拒绝状态: firewall-cmd --panic-off
查看是否拒绝: firewall-cmd --query-panic
那怎么开启一个端口呢
添加
firewall-cmd --zone=public --add-port=80/tcp --permanent (--permanent永久生效,没有此参数重启后失效)
重新载入
firewall-cmd --reload
查看
firewall-cmd --zone= public --query-port=80/tcp
删除
firewall-cmd --zone= public --remove-port=80/tcp --permanen
4:安装上虚拟机后没有ip 怎么修改?
我们输入ip查询命名 ip addr 也可以输入 ifconfig查看ip,但此命令会出现3个条目,centos的ip地址是ens33条目中的inet值
发现 ens33 没有 inet 这个属性,那么就没法通过IP地址连接虚拟机。
接着来查看ens33网卡的配置: vi /etc/sysconfig/network-scripts/ifcfg-ens33 注意vi后面加空格
vi是Linux内置的文本编辑器命令 打开文件的意思
从配置清单中可以发现 CentOS 7 默认是不启动网卡的(ONBOOT=no)。
把这一项改为YES(ONBOOT=yes),
然后按 Esc 退出 再出入命令 :wq 再按Enter即可 (备注 :wq 是保存然后退出的意思 后面会专门讲下vi)
然后重启网络服务: sudo service network restart
然后我们再输入 ip addr 命令
这里 inet属性显示了 虚拟机里的IP 192.168.1.107 (你们的可能和我不一样)
centos7 ip add 修改 centos7修改ip命令
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章