计算机网络基础识别

本文提供了网络配置的基础知识,包括Linux和Windows系统中端口的查看、开启与关闭方法;进程的查看方式;以及服务的操作命令等内容。

网络主要涉及几个重要概念:

1,端口

Linux 查看端口:

      cat /etc/services

      netstat

Windows查看端口:

      netstat -ano

 

Linux打开/关闭端口:

    

linux系统下,81端口一般情况下是关闭的。

开启81端口: iptables -I INPUT -i eth0 -p tcp --dport 81 -j ACCEPT iptables -I OUTPUT -o eth0 -p tcp --sport 81 -j ACCEPT
关闭81端口: iptables -I INPUT -i eth0 -p tcp --dport 81 -j DROP iptables -I OUTPUT -o eth0 -p tcp --sport 81 -j DROP

 

Windows打开/关闭端口:

   

关闭端口

netsh firewall set portopening TCP 端口号 DISABLE

 

netsh firewall add portopening protocol = TCP port = 139 name = "关闭139" mode = DISABLE

netsh firewall add portopening protocol = TCP port = 445 name = "关闭445" mode = DISABLE

netsh firewall add portopening protocol = UDP port = 137 name = "关闭137" mode = DISABLE

netsh firewall add portopening protocol = UDP port = 138 name = "关闭138" mode = DISABLE 

开启端口

netsh firewall add portopening protocol = TCP port = 139 name = "关闭139" mode = Enabled

netsh firewall add portopening protocol = TCP port = 445 name = "关闭445" mode =  Enabled

netsh firewall add portopening protocol = UDP port = 137 name = "关闭137" mode =  Enabled

netsh firewall add portopening protocol = UDP port = 138 name = "关闭138" mode =  Enabled

 

Linux查看进程:

  ps -aux

windows查看进程:

  tasklist

  wimc

Linux服务操作:

  service name status,start,stop,restart

windows下服务操作:

  sc

  net

 

 Linux查看当前系统登录的用户

  w

  who

  finger

  last

剔除登录用户:

  pkill -t pts/n n(为上面查到的数字)

 

 

 

 scp root@173.16.21.61:/root/a/* .

 

rz

sz

 

 

 

Linux下16进制查看:

1,od -t x1 file

     2,xxd 

3,vim  :%!xxd

4,hexdump

 

ipcs -m -s -q

ipcrm <shmid>

cat /proc/sys/kernel/shmmax shmmin  shmall

 

 nslookup查看域名

http://www.renhaibo.com/archives/29.html

 

 

转载于:https://www.cnblogs.com/lfsblack/p/3274652.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值