0
I'm trying to set up my iMac so I can ssh into it remotely (from outside my home network.) I also have a Linux server which, when using the same port forwarding in my router, I can do with zero problems.
From behind my router, I can ssh from my Linux box to my iMac with no trouble, both using internal IP (192.168.1.5) and the hostname (iKho), so the Remote Login (ssh) service is obviously working on my iMac.
If I go into my router and forward port 22 to my Linux machine, I can access it immediately after making the change - I ssh using my freedns hostname from my iPhone (strictly using my cell connection, not on wifi) and it just works.
As soon as I go back into the router, edit the SSH port forward to talk to my iMac (so I'm literally just changing the internal IP address), it refuses to work. Using the same iPhone connection, it errors out with "Unable to connect to server, please try again later."
Technically, I know I could leave it set to my Linux machine, and then ssh from there into my Mac. But for a demonstration I want to give in one of my classes, I need to be able to ssh directly into the Mac first.
I'm out of ideas - I don't see how it works locally both ways, but then only works to my Linux machine remotely. Is there some kind of limitation of MacOS's ssh server?
Thanks for any help,
-Bryan
Your description doesn't yet rule out the possibility that the problem might be resolved by sshing to your mac from a different machine. Can you either (a) connect the machine (or a machine with equivalent O/S and ssh) from which you unsuccessfully remotely ssh to your mac box to your home network? or (b) try sshing from some other machine which is running identical linux+ssh as you have successfully used at home? – Chris F Carroll – 2017-11-04T23:18:25.197
Although a simpler first step is
ssh -v
. The debug output from ssh is quite comprehensive : it will tell you what it has tried and what failed. – Chris F Carroll – 2017-11-04T23:21:43.6533rdly: Look at the mac's log of incoming ssh attempts: https://superuser.com/questions/838352/log-file-for-ssh-attempts
– Chris F Carroll – 2017-11-04T23:23:29.177