Score:0

Cannot ssh into virtualbox centos from mac os x catalina

es flag

I have virtualbox installed on a Mac OS X Catalina host. I have got the Centos 9 guest os running on virtual box. For centos, i have used NAT in networking options, and mapped 2222 to 22. I cannot ssh from the mac os to the centos. Also i note that both host and guest have same ip in ifconfig. But this seems to be not a problem for the demo i am trying to replicate (Puppet course on udemy)

Already tried: Started sshd on the guest os

sudo systemctl start sshd

Added ssh to firewall

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

Added PermitRootLogin yes to /etc/ssh/ssh_config

Restarted: sudo systemctl restart ssh

Enabled remote login in the Mac OS x

ssh command goes like this in verbose mode:

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
vautee avatar
kr flag
I'm quite sure your CentOS 9 VM doesn't have 127.0.0.1 as an IP address. Please try to use the IP of the VM with SSH.
manu muraleedharan avatar
es flag
@vautee the ifconfig shows that IP. Pls see screenshot: https://imgur.com/qFqvOZw
vautee avatar
kr flag
There should (read: needs to be) also be an IP address bound to the enp0s3 interface. Without that, you cannot continue.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.