zoukankan      html  css  js  c++  java
  • linux

     iptables防火墙 Centos6自带的,Centos7没有
     service iptables status  查看防火墙状态  
     service iptables stop  停止防火墙  
     service iptables start  启动防火墙  
     service iptables restart  重启防火墙  
     chkconfig iptables off   永久关闭防火墙  
     chkconfig iptables on  永久关闭后重启  
     firewall防火墙
     systemctl status firewalld  查看firewall服务状态

     出现Active: active (running)切高亮显示则表示是启动状态

     出现 Active: inactive (dead)灰色表示停止,看单词也行。

     firewall-cmd --state  查看firewall的状态  firwall-cmd:是Linux提供的操作firewall的一个工具;
     service firewalld start  开启firewalld.service服务  
     service firewalld restart  重启firewalld.service服务  
     service firewalld stop  关闭firewalld.service服务  
     firewall-cmd --list-all  查看防火墙规则  
     firewall-cmd --query-port=8080/tcp  查询端口是否开放  
     firewall-cmd --permanent --add-port=8080/tcp  开放8080端口  --permanent:表示设置为持久;--add-port:标识添加的端口;
     firewall-cmd --permanent --remove-port=8080/tcp  移除8080端口  
     firewall-cmd --reload  重启防火墙(修改配置后要重启防火墙)  
     hostnamectl:系统主机
     hostnamectl  显示主机名等信息  
     hostnamectl set-hostname 主机名  修改主机名(CentOS 7)  
     ifconfig
     ifconfig  查看网络  ens32是ip地址
     修改IP

     修改网络配置文件,文件地址:/etc/sysconfig/network-scripts/ifcfg-eth0

    ------------------------------------------------
    主要修改以下配置:
    TYPE=Ethernet //网络类型
    BOOTPROTO=static //静态IP
    DEVICE=ens00 //网卡名
    IPADDR=192.168.1.100 //设置的IP
    NETMASK=255.255.255.0 //子网掩码
    GATEWAY=192.168.1.1 //网关
    DNS1=192.168.1.1 //DNS
    DNS2=8.8.8.8 //备用DNS
    ONBOOT=yes //系统启动时启动此设置
    -------------------------------------------------

     service network restart  修改保存以后使用命令重启网卡  
     配置映射
    修改文件: vi /etc/hosts
      在文件最后添加映射地址,示例如下:
       192.168.1.101  node1
       192.168.1.102  node2
       192.168.1.103  node3
      配置好以后保存退出,输入命令:ping node1 ,可见实际 ping 的是 192.168.1.101。
     查看进程
     ps -ef  查看所有正在运行的进程  
     结束进程
     kill pid  杀死该pid的进程  
     kill -9 pid  强制杀死该进程  
     查看链接
     ping IP  查看与此IP地址的连接情况  
     netstat -an  查看当前系统端口  
     netstat -an | grep 8080  查看指定端口  
     快速清屏
     ctrl+l  清屏,往上翻可以查看历史操作  
     远程主机
     ssh IP  远程主机,需要输入用户名和密码  
  • 相关阅读:
    大牛总结的Linux提权Exp合集
    CTF中图片隐藏文件分离方法总结
    解压报错gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now的解决方法
    CTF中常见Web源码泄露总结
    解决“当前扩展缓存策略没有进行注册”的错误
    【红色警报】XXE 高危漏洞将大面积影响微信支付安全,可能导致系统沦陷,请升级你的系统!
    Senparc.Weixin SDK v5.0 升级公告
    使用 VSTS 进行 CI 的过程中,无法识别 .NET Core 2.x 的情况处理
    .net core DI 注册 Lazy<> 类型
    【备忘】ASP.NET MVC 5 升级到 ASP.NET Core MVC 的部分变化
  • 原文地址:https://www.cnblogs.com/gygtech/p/14839311.html
Copyright © 2011-2022 走看看