判断端口通不通的几种方法
2016-01-14 11:28
176 查看
1、使用telnet判断
telnet是windows标准服务,可以直接用;如果是linux机器,需要安装telnet.用法: telnet ip port1)先用telnet连接不存在的端口
ssh是linux的标准配置并且最常用,可以用来判断端口吗? 用法: ssh -v -p port username@ip-v 调试模式(会打印日志).-p 指定端口username可以随意1)连接不存在端口
wget是linux下的下载工具,需要先安装.用法: wget ip:port1)连接不存在的端口
telnet是windows标准服务,可以直接用;如果是linux机器,需要安装telnet.用法: telnet ip port1)先用telnet连接不存在的端口
[root@localhost ~]# telnet 10.0.250.3 80 Trying 10.0.250.3... telnet: connect to address 10.0.250.3: Connection refused #直接提示连接被拒绝2)再连接存在的端口
[root@localhost ~]# telnet localhost 22 Trying ::1... Connected to localhost. #看到Connected就连接成功了 Escape character is '^]'. SSH-2.0-OpenSSH_5.3 a Protocol mismatch. Connection closed by foreign host.2、使用ssh判断
ssh是linux的标准配置并且最常用,可以用来判断端口吗? 用法: ssh -v -p port username@ip-v 调试模式(会打印日志).-p 指定端口username可以随意1)连接不存在端口
[root@localhost ~]# ssh 10.0.250.3 -p 80 ssh: connect to host 10.0.250.3 port 80: Connection refused [root@localhost ~]# ssh 10.0.250.3 -p 80 -v OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to 10.0.250.3 [10.0.250.3] port 80. debug1: connect to address 10.0.250.3 port 80: Connection refused ssh: connect to host 10.0.250.3 port 80: Connection refused2)连接存在的端口
[root@localhost ~]# ssh 10.0.250.3 -p 8080 a ^] ^C [root@localhost ~]# ssh 10.0.250.3 -p 8080 -v OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to 10.0.250.3 [10.0.250.3] port 8080. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug1: identity file /root/.ssh/identity type -1 debug1: identity file /root/.ssh/identity-cert type -1 debug1: identity file /root/.ssh/id_rsa type -1 debug1: identity file /root/.ssh/id_rsa-cert type -1 debug1: identity file /root/.ssh/id_dsa type -1 debug1: identity file /root/.ssh/id_dsa-cert type -1 a ^C不用-v选项也可以咯3、使用wget判断
wget是linux下的下载工具,需要先安装.用法: wget ip:port1)连接不存在的端口
[root@localhost ~]# wget 10.0.250.3:80 --2016-01-14 11:03:28-- http://10.0.250.3/ Connecting to 10.0.250.3:80... failed: Connection refused.2)连接存在的端口
[root@localhost ~]# wget 10.0.250.3:8080 --2016-01-14 11:04:59-- http://10.0.250.3:8080/ Connecting to 10.0.250.3:8080... connected. HTTP request sent, awaiting response...4、使用端口扫描工具
[root@localhost ~]# nmap 10.0.250.3 -p 80 Starting Nmap 5.51 ( http://nmap.org ) at 2016-01-14 11:19 CST Nmap scan report for 10.0.250.3 Host is up (0.00032s latency). PORT STATE SERVICE 80/tcp closed http MAC Address: B8:2A:72:CF:FD:D2 (Unknown) Nmap done: 1 IP address (1 host up) scanned in 0.12 seconds [root@localhost ~]# nmap 10.0.250.3 -p 8080 Starting Nmap 5.51 ( http://nmap.org ) at 2016-01-14 11:19 CST Nmap scan report for 10.0.250.3 Host is up (0.00036s latency). PORT STATE SERVICE 8080/tcp open http-proxy MAC Address: B8:2A:72:CF:FD:D2 (Unknown) Nmap done: 1 IP address (1 host up) scanned in 0.11 seconds
[root@localhost ~]# nmap 10.0.250.3 Starting Nmap 5.51 ( http://nmap.org ) at 2016-01-14 11:16 CST Nmap scan report for 10.0.250.3 Host is up (0.00024s latency). Not shown: 996 closed ports PORT STATE SERVICE 22/tcp open ssh 111/tcp open rpcbind 8080/tcp open http-proxy 8090/tcp open unknown MAC Address: B8:2A:72:CF:FD:D2 (Unknown) Nmap done: 1 IP address (1 host up) scanned in 1.21 seconds
相关文章推荐
- oracle笔记整理10——性能调优之临时表与物化视图
- 在解决maven的ArtifactTransferException: Failure to transfer报错问题上的一些总结
- Win7下 maven3.1.1的安装步骤+maven配置本地仓库
- awr报告的生成及常见问题
- QRadioButton实现详解
- Android--序列化的使用
- C3P0在多线程下的maxPoolSize配置
- Android学习笔记--JNI的使用方法
- MS SQL 两种分页
- 什么是restful
- [转]HTTP中cache-control的应用及说明
- TQ2440u-boot1.6.6中添加菜单选择
- LVS原理详解及部署之四:keepalived介绍
- 内核升级方法
- [POJ 3616]Milking Time[DP]
- STM32按键总结(低电平有效及上升沿有效))
- MongoVUE 的使用
- dom4j读写xml
- LVS原理详解及部署之五:LVS+keepalived实现负载均衡&高可用
- Redis学习记录之命令SortedSet(十三)