Can't ssh into my Mac remotely, but can ssh into my Linux box with no trouble

Bryan Sproles

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
iamc

Did you try completely disabling MacOS firewall?

This may be a MacOS firewall issue, with it setting 192.168.* as an unrestricted local area network and not allowing "external" access. Linux typically allows ssh access from anywhere, once you enable it.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I remotely control a linux box from my Mac?

From Dev

Can't access my ssh linux server when outside network

From Dev

Messed up my .bash_profile remotely, can't ssh back in

From Dev

Can't ssh into my server from home linux but can ssh into same server from windows

From Dev

I can't ssh into my Ubuntu VM

From Dev

Can't access SSH remotely after applying 0777 permissions to .ssh

From Dev

FileZilla on Mac OS X can't open .ssh directory to get my keyfile

From Dev

Can't SSH from my IP, but can from other IPs

From Dev

How can I remotely SSH into my PC which is behind a router-modem?

From Dev

Can't open a ssh tunnel from my linux shell (EC2 exposing an RDS db)

From Dev

How can I find and break connections to my Linux via ssh?

From Dev

How can I track who SSH'es into my linux machine?

From Dev

Can't access my xampp server remotely

From Dev

Can't access my xampp server remotely

From Dev

Snap packages can't use my SSH key

From Dev

Dockerfile can't find my private ssh key

From Dev

Snap packages can't use my SSH key

From Dev

I can't SSH into my remote computer likely due to the router

From Dev

Can't access my device via SSH over internet

From Dev

Can't Login to my Server via SSH, and the password is correct

From Dev

I can't connect to my database via SSH

From Dev

can't log in with my password during ssh connection

From Dev

Can one install linux on a Mac via ssh?

From Dev

Is it possible to “SSH” into my virtual machine remotely?

From Dev

Is it possible to “SSH” into my virtual machine remotely?

From Dev

Can my SSH session be detected by sysadmin?

From Dev

Can I ignore errors in my ssh config?

From Dev

Can the destination of my ssh tunnel be detected?

From Dev

Can I have multiple ssh keys in my .ssh folder?

Related Related

  1. 1

    How can I remotely control a linux box from my Mac?

  2. 2

    Can't access my ssh linux server when outside network

  3. 3

    Messed up my .bash_profile remotely, can't ssh back in

  4. 4

    Can't ssh into my server from home linux but can ssh into same server from windows

  5. 5

    I can't ssh into my Ubuntu VM

  6. 6

    Can't access SSH remotely after applying 0777 permissions to .ssh

  7. 7

    FileZilla on Mac OS X can't open .ssh directory to get my keyfile

  8. 8

    Can't SSH from my IP, but can from other IPs

  9. 9

    How can I remotely SSH into my PC which is behind a router-modem?

  10. 10

    Can't open a ssh tunnel from my linux shell (EC2 exposing an RDS db)

  11. 11

    How can I find and break connections to my Linux via ssh?

  12. 12

    How can I track who SSH'es into my linux machine?

  13. 13

    Can't access my xampp server remotely

  14. 14

    Can't access my xampp server remotely

  15. 15

    Snap packages can't use my SSH key

  16. 16

    Dockerfile can't find my private ssh key

  17. 17

    Snap packages can't use my SSH key

  18. 18

    I can't SSH into my remote computer likely due to the router

  19. 19

    Can't access my device via SSH over internet

  20. 20

    Can't Login to my Server via SSH, and the password is correct

  21. 21

    I can't connect to my database via SSH

  22. 22

    can't log in with my password during ssh connection

  23. 23

    Can one install linux on a Mac via ssh?

  24. 24

    Is it possible to “SSH” into my virtual machine remotely?

  25. 25

    Is it possible to “SSH” into my virtual machine remotely?

  26. 26

    Can my SSH session be detected by sysadmin?

  27. 27

    Can I ignore errors in my ssh config?

  28. 28

    Can the destination of my ssh tunnel be detected?

  29. 29

    Can I have multiple ssh keys in my .ssh folder?

HotTag

Archive