Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

SSH accepts connections from within local network, but closes connection immediately when port forwarded through router

So I have a min 2011 iMac running Yosemite, I have remote login turned on under sharing in system preferences and if I try to SSH to my machine from another machine (or my phone) on the same wifi network, everything works fine. However, if I try to do the same thing from the internet (connecting to username@public_IP etc. and forwarding port 22 through my router to the iMac in question) the iMac closes the connection immediately. I've used Packet Peeper to see that the forwarded port is working correctly and the iMac is receiving the SSH packets.


In console I see :


Feb 7 20:15:52 My-iMac com.apple.xpc.launchd[1] (com.openssh.sshd.53F53F04-74AB-40F0-9A86-462EA1B1F814): Service instances do not support events yet.

Feb 7 20:15:52 My-iMac.local sshd[529]: Could not write ident string to UNKNOWN

Feb 7 20:15:52 My-iMac com.apple.xpc.launchd[1] (com.openssh.sshd.53F53F04-74AB-40F0-9A86-462EA1B1F814[529]): Service exited with abnormal code: 255


I don't know what else to try. Any advice?


Thanks,

Matt

Posted on Feb 7, 2015 5:18 PM

Reply
3 replies

Feb 13, 2015 2:53 PM in response to hobbsmw

I'm seeing this on one of my Macs, too. The only difference with it is it's the most recent one I've stood up. Since it hasn't gone through any iterations of updates, it's possible that there's something different in 10.10 / 10.10.2 that doesn't get applied to machines upgraded from something earlier, or that maybe got 10.10.1 before 10.10.2? I was hoping this would have something to do with the modifications I'm making to sshd_config, but the issue persisted after i reverted all changes, and I can't swear it wasn't there before I started fiddling around.too" and hope someone else might chime in!


So I'll leave this as a "me,

SSH accepts connections from within local network, but closes connection immediately when port forwarded through router

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.