`

linux远程端口查看

    博客分类:
  • Unix
阅读更多

telnet常被用来检测是个远端端口是否通畅。

[root@oldboy ~]# telnet baidu.com 80
Trying 123.125.114.144...
Connected to baidu.com (123.125.114.144). #==>出现Connected表示连通了,说明百度的80端口开放的
Escape character is '^]'. #==>ctrl+]退出此地。
^]
telnet> quit
Connection closed.

如果写脚本通过telnet检查端口可以用下面的方法:

[root@oldboy ~]# echo -e "\n"|telnet baidu.com 80|grep Connected
Connection closed by foreign host.
Connected to baidu.com (123.125.114.144).

 

文章来源:http://blog.chinaunix.net/uid-26000296-id-4086980.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics