Cannot ssh to virtualbox opensuse under NAT mode

Hi. I installed openSUSE Tumbleweed on virtualbox 7.0 and choose networking connection mode to be NAT.

In order to ssh-log-in the guest system, I’ve set port-forwarding in virtualbox, from localhost:2224 to guest:22.

But I cannot connect to it with ssh -p 2224 root@localhost.

$ ssh -vv -p 2224 root@localhost
OpenSSH_9.2p1, OpenSSL 1.1.1t  7 Feb 2023
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "localhost" port 2224
debug1: Connecting to localhost [::1] port 2224.
debug1: connect to address ::1 port 2224: Connection refused
debug1: Connecting to localhost [127.0.0.1] port 2224.
debug1: Connection established.
debug1: identity file /c/Users/baiwf/.ssh/id_rsa type 0
debug1: identity file /c/Users/baiwf/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/baiwf/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/baiwf/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/baiwf/.ssh/id_ecdsa_sk type -1
debug1: identity file /c/Users/baiwf/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /c/Users/baiwf/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/baiwf/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/baiwf/.ssh/id_ed25519_sk type -1
debug1: identity file /c/Users/baiwf/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /c/Users/baiwf/.ssh/id_xmss type -1
debug1: identity file /c/Users/baiwf/.ssh/id_xmss-cert type -1
debug1: identity file /c/Users/baiwf/.ssh/id_dsa type -1
debug1: identity file /c/Users/baiwf/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.2
kex_exchange_identification: read: Software caused connection abort
banner exchange: Connection to 127.0.0.1 port 2224: Software caused connection abort

The guest OS tcpdump shows:

21:53:34.215785 IP 10.0.2.2.13501 > 10.0.2.15.ssh: Flags [S], seq 3421568001, win 65535, options [mss 1460], length 0
21:53:34.215914 IP 10.0.2.15.ssh > 10.0.2.2.13501: Flags [R.], seq 0, ack 3421568002, win 0, length 0

However I also install fedora on virtualbox and choose NAT mode too, I can ssh to fedora normally. I don’t know what’s wrong with opensuse.

Is sshd service running in openSUSE? Is port 22 open in firewall?

1 Like

OMG, I forgot this. :joy: :joy:

Thanks for reminding.