2

I'm running Mojave 10.14.6 on a new MacBrook Pro and whenever my mac is completely off and then comes back on, it seems to take at least 5 minutes to be able to connect or access anything over ssh. The first time it happened, I thought the credentials had been changed, but I'm glad I waited because after multiple attempts with the same credentials, it worked. This has happened a few more times, if my laptop dies or it runs an update and restarts. It's especially frustrating when I'm ready to start working for the day and when it finally does reconnect, all of the files I was in before get closed out.

If I ping the ip, it responds, but if I try and ssh from the terminal, the "connection is refused" -- it doesn't even give me the option to enter a password. If I try and go through my usual interface (Coda) to connect to the server/database, it gives me a similar error, something like "connection failed". I don't believe it's a Coda problem as I've used it on other macs just fine and it also threw and error in the terminal.

Has anyone else had this problem, or does anyone know what could be causing this?

Edit: Added updated info

enter image description here

I believe the previous photo I posted was incorrect, I think the result of the command must have been right after I was re-connected. The above photo is the correct one.

Here are the results that @FrancisfromResponseBase asked for, though I'm not sure when exactly the connection re-opened, so while I was hurridly running through the commands, it may have re-connected before I realized. I'll try to double check the next time it happens to better pinpoint it and to make sure I'm getting the right results for the before commands I run:

Not working/Before:

enter image description here enter image description here enter image description here enter image description here enter image description here

Working/After:

enter image description here enter image description here enter image description here enter image description here enter image description here

7
  • 1
    What does ssh -v somehost show?
    – lhf
    Commented Sep 4, 2019 at 13:29
  • @lhf I don't know at the moment, it's working now. I can try restarting my computer again and try that.
    – Sensoray
    Commented Sep 4, 2019 at 13:33
  • @lhf with that command, it seems that it's trying to connect with the name of my computer rather than root. Is there a way to use that command with the username root?
    – Sensoray
    Commented Sep 4, 2019 at 13:51
  • 1
    @jaume Sure, I updated with the info. The whited out areas are the name of my computer, which is my name.
    – Sensoray
    Commented Sep 4, 2019 at 15:02
  • 1
    Thanks, but your screenshot doesn't fit your description of the problem: you write if I try and ssh from the terminal, the "connection is refused - it doesn't even give me the option to enter a password but that's not the case in your screenshot, the last line is an SSH prompt requesting a password. Could you provide a screenshot of ssh -v when it fails with a "connection is refused" error message?
    – jaume
    Commented Sep 5, 2019 at 9:43

1 Answer 1

1

My friend, I suggest that we examine the routing table in a 'before / after' manner: before the problem occurs; after the problem has occurred.

Could you kindly post the output of the following before and after the behavior occurs:

sudo netstat -nr 

I assume from looking at the ssh debug you posted that you are ssh'ing to the ip address, and not a hostname. Is this correct? If not, then we should look at the domain name resolution.

sudo scutil --dns

as well as

sudo cat /etc/resolv.conf

would help in this case.

Lastly, let's rule out any egress filtering on the firewall. It is a lot of information, but better that we have the full perspective, from rules to NAT to timeouts and states:

sudo pfctl -vvv -sa

F.

2
  • I took screenshots of it after it occurs, I'm trying to replicate it this morning to get the before shots and ofc it's actually behaving now. I'll update and respond when it acts wonky again. It's been doing it almost every day, so I'll keep testing for it.
    – Sensoray
    Commented Sep 5, 2019 at 12:22
  • I updated my post with the results, it finally occurred again!
    – Sensoray
    Commented Oct 7, 2019 at 14:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .