计算机网络基础识别
网络主要涉及几个重要概念:
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