如何在linux下查看另一台主機的某個連接埠是否啟動命令

來源:互聯網
上載者:User

以LINUX REDHAT6.3為例:

本機插入 REDHAT6.3系統ISO鏡像CD1

1.配置yum本地安裝源:

以root使用者登入系統

mkdir /mnt/cdrom

mount -t iso9660 /dev/sr0 /mnt/cdrom

cd /etc/yum.repos.d

查看目錄是否有.repo尾碼檔案,沒有則建立一個.repo檔案,檔案名稱隨意。

vi local.repo
[LOCAL]

name=local

baseurl=file:///mnt/cdrom

enable=1

gpgcheck=0

yum clean all

2.安裝nmap,並測試172.24.40.5是否開放80連接埠

[root@openlab named]# yum install nmap Loaded plugins: rhnplugin Repository 'LOCAL' is missing name in configuration, using id This system is not registered with RHN. RHN support will be disabled. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package nmap.i686 2:5.21-3.el6 set to be updated --> Finished Dependency Resolution      Dependencies Resolved      ================================================================================  Package         Arch            Version                 Repository        Size ================================================================================ Installing:  nmap            i686            2:5.21-3.el6            LOCAL            2.2 M      Transaction Summary ================================================================================ Install       1 Package(s) Upgrade       0 Package(s)      Total download size: 2.2 M Installed size: 7.2 M Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction   Installing     : 2:nmap-5.21-3.el6.i686                                   1/1       Installed:   nmap.i686 2:5.21-3.el6                                                              Complete!
[root@openlab named]# nmap -p 80 172.24.40.5      Starting Nmap 5.21 ( http://nmap.org ) at 2013-01-09 17:00 CST mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using --system-dns or specify valid servers with --dns-servers Nmap scan report for 172.24.40.5 Host is up (0.00034s latency). PORT   STATE SERVICE 80/tcp open  http MAC Address: 00:0C:29:4E:7D:FE (VMware)      Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds

nmap -p 1-200 目標主機 IP

#1-200為連接埠範圍

本文出自 “一路向北” 部落格,請務必保留此出處http://showerlee.blog.51cto.com/2047005/1119506

查看本欄目更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.