无法从 mac os x catalina ssh 进入 virtualbox centos

无法从 mac os x catalina ssh 进入 virtualbox centos

我在 Mac OS X Catalina 主机上安装了 virtualbox。我在虚拟机上运行了 Centos 9 客户操作系统。对于 centos,我在网络选项中使用了 NAT,并将 2222 映射到 22。我无法从 mac os ssh 到 centos。我还注意到主机和客户机在 ifconfig 中具有相同的 ip。但这似乎不是我试图复制的演示的问题(udemy 上的 Puppet 课程)

已经尝试过:在客户操作系统上启动 sshd

sudo systemctl start sshd

防火墙里添加了ssh

sudo firewall-cmd --zone=public --permanent --add-service=ssh
sudo firewall-cmd --reload

已将 PermitRootLogin 添加到/etc/ssh/ssh_config

已重新启动:sudo systemctl restart ssh

在 Mac OS x 中启用远程登录

ssh 命令在详细模式下如下所示:

ssh -vvv [email protected] -p 2222
OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug2: resolve_canonicalize: hostname 127.0.0.1 is address
debug2: ssh_connect_direct
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 2222.
debug1: Connection established.
debug1: identity file /Users/mansnitz/.ssh/id_rsa type 0
debug1: identity file /Users/mansnitz/.ssh/id_rsa-cert type -1
debug1: identity file /Users/mansnitz/.ssh/id_dsa type -1
debug1: identity file /Users/mansnitz/.ssh/id_dsa-cert type -1
debug1: identity file /Users/mansnitz/.ssh/id_ecdsa type -1
debug1: identity file /Users/mansnitz/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/mansnitz/.ssh/id_ed25519 type 3
debug1: identity file /Users/mansnitz/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/mansnitz/.ssh/id_xmss type -1
debug1: identity file /Users/mansnitz/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
kex_exchange_identification: read: Connection reset by peer

相关内容