SSH connection timeout

I am launching Ubuntu server on VmWare. My username is tadi@server1. On cmd I can get access the server on the same machine which uses windows OS. However, On the client side
when I try to connect using a different linux machine (laptop), "connection time out " error occurs.

  • Port 22 is listening
  • ssh is enabled
  • firewall allowed port 22

What is the case and how to solve it

2 Likes

This looks like a network issue, not SSH.

Since you can connect from the Windows host but not from another machine, your VM is most likely using NAT networking in VMware.

In NAT mode, only the host can access the VM. Other devices on the network won’t be able to connect, which results in a connection timed out error.

How to fix this: Change the VM network adapter to Bridged:

VM Settings Network Adapter

Select Bridged (connected directly to physical network)

Then check the VM IP:

ip a

Make sure it’s on the same subnet as your laptop, then connect again:

ssh user@<vm-ip>

In NAT mode, external machines cannot access the VM directly unless port forwarding is configured.

Run ip a in the Ubuntu Terminal

2 Likes

Edit: What he said, much less rambling than my explanation lol

If you need to stay on NAT for some reason, the other option is to set up port forwarding in VMware so that traffic hitting the Windows host on a specific port gets forwarded to the VM’s port 22.

3 Likes

Hey MarcelStevano, You are right I was on NAT. And when I changed it to Bridge connection, the IP address also changed. And on my another machine which is installed with Linux OS, notified me with “remote host identification has changed” and using ssh-keygen -f /home… I removed it and finaly got a remote access. Can you explain what just happened please?

1 Like

Hey Hydn, how are you my friend? How to forward port? I want to learn this.

1 Like

It depends on what router you have on your network.

For example if pfSense: pfSense Firewall 2.8: Install & Config – Settings Walkthrough. Or, maybe ISP router, etc.

Here you go:

1 Like