在VirtualBox下无法find端口22的stream量

我试图学习使用tcpdump。 我以为我会窃听我的SSHlogin。 这个设置有点不同寻常,我有OS X Lion运行VirtualBox,而Ubuntu运行在VM中。 我有ssh启用,可以正常login从OS X:

> ssh -p 22 10.0.1.2 -l telliott Welcome to Ubuntu 11.10 (GNU/Linux 3.0.0-17-generic i686) * Documentation: https://help.ubuntu.com/ 0 packages can be updated. 0 updates are security updates. Last login: Sat Mar 31 19:54:36 2012 from toms-mac-mini.local telliott@U32:~$ logout Connection to 10.0.1.2 closed. > 

没有混淆Ubuntu上的SSH端口。 从OS X中,笔画给我所期望的:

 > ./stroke 10.0.1.2 22 22 Port Scanning host: 10.0.1.2 Open TCP Port: 22 ssh 

所以从OS X开始:

 > sudo tcpdump -i en1 -v port 22 Password: tcpdump: listening on en1, link-type EN10MB (Ethernet), capture size 65535 bytes 

然后我使用ssh从OS Xlogin到Ubuntu,但是我没有看到tcpdump。 这里是从Ubuntu的ifconfig:

 telliott@U32:~$ ifconfig eth1 Link encap:Ethernet HWaddr 08:00:27:d7:ba:0e inet addr:10.0.1.2 Bcast:10.0.1.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fed7:ba0e/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:799 errors:0 dropped:0 overruns:0 frame:0 TX packets:465 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:96863 (96.8 KB) TX bytes:68638 (68.6 KB) 

我希望看到的包在哪里? 谢谢你的帮助。

更新:在OS X上

 > ifconfig lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384 options=3<RXCSUM,TXCSUM> inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280 stf0: flags=0<> mtu 1280 en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 options=27<RXCSUM,TXCSUM,VLAN_MTU,TSO4> ether 60:fb:42:f4:cd:9e media: autoselect status: inactive en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500 ether 00:26:b0:fa:75:7f inet6 fe80::226:b0ff:fefa:757f%en1 prefixlen 64 scopeid 0x5 inet 10.0.1.3 netmask 0xffffff00 broadcast 10.0.1.255 media: autoselect status: active fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078 lladdr 60:fb:42:ff:fe:f4:cd:9e media: autoselect <full-duplex> status: inactive 

更新2:

现在意识到这是一个愚蠢的问题,因为(一)Ubuntu上的22端口tcpdump工作正常,(二)我从来没有真正打开OS X端口22. ssh通过一些神奇的“桥接”模式我还不明白的VM。 我试图让解决scheme在下面的工作,我敢肯定会的。

尝试将其中一个虚拟机接口设置为仅限主机,然后使用tcpdump在vboxnet0上进行侦听

 % sudo tcpdump -AXvnn -s0 -ivboxnet0 port 22 tcpdump: WARNING: vboxnet0: That device doesn't support promiscuous mode (BIOCPROMISC: Operation not supported on socket) tcpdump: listening on vboxnet0, link-type EN10MB (Ethernet), capture size 65535 bytes 05:33:38.767959 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), length 60) 192.168.56.3.22 > 192.168.56.1.56137: Flags [S.], cksum 0x186b (correct), seq 3689124050, ack 844205722, win 14480, options [mss 1460,sackOK,TS val 4294808631 ecr 446189010,nop,wscale 5], length 0 

适用于我,如果您的networking处于脱机状态,则可以通过SSH连接到您的虚拟机。