Score:0

Eliminate SSH timeouts between macOS and Ubuntu VM

iq flag

I'm using ssh and Microsoft VS Code on my Mac (up to date Ventura) to connect to my Ubuntu VM (up to date 22.04). However, I keep getting inactivity timeouts (I believe this is from the macOS side):

client_loop: send disconnect: Broken pipe

My Ubuntu sshd_config contains:

TCPKeepAlive yes
ClientAliveInterval 30
ClientAliveCountMax 5

And my macOS ~/.ssh/config contains:

TCPKeepAlive no
ServerAliveInterval 30
ServerAliveCountMax 5

But that doesn't seem to help.

There are a million posts about setting the values above, and I believe I've tried all reasonable permutations to no avail.

How can I keep the connections up permanently?

Score:0
it flag

There are a few things you can try to fix the inactivity timeouts you are experiencing:

First, try setting the TCPKeepAlive option to yes on both the client and the server. This option allows the operating system to send keepalive messages to ensure that the connection is still active.

You can also try increasing the ClientAliveInterval and ServerAliveInterval values on the client and server. These values determine how often keepalive messages are sent. Increasing these values may help to prevent inactivity timeouts.

If the above suggestions do not work, you can try adding the following option to your ~/.ssh/config file on the client:

ServerAliveInterval 60

This will cause the client to send a keepalive message to the server every 60 seconds.

If you are still experiencing inactivity timeouts, it is possible that there is a network issue causing the connections to be dropped. In this case, you may need to contact your network administrator for further assistance. I hope these suggestions help to resolve the issue you are experiencing. Let me know if you have any further questions.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.