I want to use OS X remotely access to a Ubuntu computer via SSH. I have already installed openssh server (sshd) in Ubuntu and ssh client in OS X. I can ping ip address from OS X I can ssh user@ip address from Ubuntu to himself. I use: sudo utf allow 22 to allow the port 22 access

Even did all these stuff, I still got: ssh: connect to host ip address port 22: Operation timed out.

Can anyone help me deal with this issue. I have to connect to my campus workstation remotely for work. Thanks

  • it sounds very much like a networking fault. Can you add in the response from ssh -vv user@ip from your osx workstation? Aug 29, 2015 at 16:44

1 Answer 1


You say you're connecting to work from a computer in home, right?

The place with the Ubuntu PC has to be with a static IP.

Then make sure that your ISP isn't blocking port 22. (you may change it to, let's say, 2222)

If you are using router where your Ubuntu PC is, then check if the port is forwarded to the PC and you're using the public IP and not the LAN one (usually they start with 192.168. or 10.0.).

  • I am using OSX at home and want to access the Ubuntu in office. I allowed the port 22 in ufw. I am using a wifi router at home but the Ubuntu computer at office is using a LAN and has a static IP address
    – YasinLi
    Aug 29, 2015 at 16:54
  • So you have to access the router menu in your office and then forward the port from the Ubuntu PC IP that the router gave it (may be found with the command ifconfig)
    – aastefanov
    Aug 29, 2015 at 17:21
  • Sorry I really do not quite understand. Both my iMac at home and Ubuntu at office are connected via a LAN (not a router).
    – YasinLi
    Aug 29, 2015 at 17:55
  • LAN means local area network and that means there is some kind of router/switch, this may mean even another PC.
    – aastefanov
    Aug 29, 2015 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.