Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7966835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:32:26+00:00 2026-06-04T06:32:26+00:00

Is it possible to keep SSH session alive while computer sleep? When I put

  • 0

Is it possible to keep SSH session alive while computer sleep? When I put my Mac (Lion) to sleep for a short period of time and then wake it up session still alive, but if I leave it overnight session connection is closed.

I’ve tried set:

ClientAliveInterval 3600
ClientAliveCountMax 10

same result

Why session “survive” for a short period of time? How can I control this timeout?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:32:28+00:00Added an answer on June 4, 2026 at 6:32 am

    I found the answer it depends on tcp keepalive settings:

    For the list of available TCP settings (FreeBSD 4.8 an up and 5.4):

    sysctl -A | grep net.inet.tcp
    
    • net.inet.tcp.keepidle – Amount of time, in milliseconds, that the (TCP) connection must be idle before keepalive probes (if enabled) are sent.

    • net.inet.tcp.keepintvl – The interval, in milliseconds, between keepalive probes sent to remote machines. After TCPTV_KEEPCNT (default 8) probes are sent, with no response, the (TCP)connection is dropped.

    • net.inet.tcp.always_keepalive – Assume that SO_KEEPALIVE is set on all TCP connections, the kernel will periodically send a packet to the remote host to verify the connection is still up.

    Therefore formula to calculate maximum TCP inactive connection time is following:

    net.inet.tcp.keepidle + (net.inet.tcp.keepintvl x 8)
    

    the result is in milliseconds. Therefore, by setting

    net.inet.tcp.keepidle = 10000
    net.inet.tcp.keepintvl = 5000
    net.inet.tcp.always_keepalive = 1 (must be 1 always)
    

    the system will disconnect a call when TCP connection is dead for: 10000 + (5000 x 8) = 50000 msec (50 sec). To make system remember these settings at startup, you should add them to /etc/sysctl.conf file

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If it is possible to keep an Air for Android application alive during sleep,
Is it possible to keep things DRY and put this into one validation line?
Is is possible to keep a single OAuth session available across multiple users? My
Is it possible to keep checking a MySQL database and then update text? I'm
Is it possible to keep a socket connection alive in background, to be able
Is it possible to keep the color on a link with a class while
Is it possible to keep the exact width of a <span> while changing the
I am interested to ask... Is it possible to keep session between TWO war(s)
On a server running a SSH service, is it possible to keep its key
I wanted to know if it was possible to keep the Session variable thought

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.