即使所有来宾都关闭,Virtualbox 也会响应 vboxnet0 上的 SSH

Virtualbox responding to SSH on vboxnet0 even when all guests are off

我有一个 MacOS 主机和 virtualbox 运行 一个 Kali Linux 客户机。我想设置从主机到来宾的 SSH。那没有用(错误的密码错误)。然后我意识到即使客人不在,我也会遇到同样的错误。

ifconfig 在主机上的输出:

```

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    options=3<RXCSUM,TXCSUM>
    inet6 ::1 prefixlen 128 
    inet 127.0.0.1 netmask 0xff000000 
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    nd6 options=1<PERFORMNUD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 00:05:69:3c:69:5f 
    inet6 fe80::205:69ff:fe3c:695f%en0 prefixlen 64 scopeid 0x4 
    inet 172.26.88.44 netmask 0xfffff000 broadcast 172.26.95.255
    nd6 options=1<PERFORMNUD>
    media: autoselect
    status: active
en1: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
    options=60<TSO4,TSO6>
    ether 72:00:00:44:ee:70 
    media: autoselect <full-duplex>
    status: inactive
en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
    options=60<TSO4,TSO6>
    ether 72:00:00:44:ee:71 
    media: autoselect <full-duplex>
    status: inactive
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=63<RXCSUM,TXCSUM,TSO4,TSO6>
    ether ba:e8:56:93:42:00 
    Configuration:
        id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
        maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
        root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
        ipfilter disabled flags 0x2
    member: en1 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 5 priority 0 path cost 0
    member: en2 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 6 priority 0 path cost 0
    nd6 options=1<PERFORMNUD>
    media: <unknown type>
    status: inactive
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
    ether 0a:e8:56:39:e8:cc 
    media: autoselect
    status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
    ether ee:8d:0b:ea:a5:df 
    inet6 fe80::ec8d:bff:feea:a5df%awdl0 prefixlen 64 scopeid 0x9 
    nd6 options=1<PERFORMNUD>
    media: autoselect
    status: active
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
    inet6 fe80::214f:e34a:37df:baa0%utun0 prefixlen 64 scopeid 0xa 
    nd6 options=1<PERFORMNUD>
vboxnet0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 0a:00:27:00:00:00 
    inet 192.168.56.1 netmask 0xffffff00 broadcast 192.168.56.255

```

我连接到 192.168.56.1 时看到的内容,即使所有 VM 都已关闭:

```

ssh  -v root@192.168.56.1
OpenSSH_7.3p1, OpenSSL 1.0.2h  3 May 2016
debug1: Reading configuration data /Users/mark/.ssh/config
debug1: /Users/mark/.ssh/config line 27: Deprecated option "useroaming"
debug1: Reading configuration data /usr/local/etc/ssh/ssh_config
debug1: Connecting to 192.168.56.1 [192.168.56.1] port 22.
debug1: Connection established.
debug1: identity file /Users/mark/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/mark/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/mark/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/mark/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/mark/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/mark/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/mark/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/mark/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.9
debug1: match: OpenSSH_6.9 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.56.1:22 as 'root'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:+vfMFaFLTbtzNNGNAl3QSmkfFXcuEdzLDAyoUFuuC6M
debug1: Host '192.168.56.1' is known and matches the ECDSA host key.
debug1: Found key in /Users/mark/.ssh/known_hosts:45
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: Skipping ssh-dss key /Users/mark/.ssh/rms_sgs - not in PubkeyAcceptedKeyTypes
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/mark/.ssh/id_rsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Trying private key: /Users/mark/.ssh/id_dsa
debug1: Trying private key: /Users/mark/.ssh/id_ecdsa
debug1: Trying private key: /Users/mark/.ssh/id_ed25519
debug1: Next authentication method: keyboard-interactive
Password:

```

无论我尝试什么密码,都没有用。为什么我什至能够连接?我正在连接什么?

当您 运行 ifconfig 时,您会看到属于 您的主机 的接口和地址列表。所以,192.168.56.1 你的主机 在 192.168.56.0/24 网络上的地址。

尝试通过 ssh 连接到该地址与尝试通过 ssh 连接到 127.0.0.1.

是一样的