SSH Timeout Issue in Linux/MAC [Solution]

Problem: When using the terminal on a Linux or MAC system and leave it idle for some time, the terminal will get hung due to a timeout issue.

Solution You can solve this problem by adding a config file to your ~/.ssh directory. Use the following steps for the configuration.

  1. Create a Config file in you ~/.ssh directory

     vi ~/.ssh/config
    
  2. Add the following configuration to the file and save it

     Host *
       ServerAliveInterval 120
    
  3. Change the file permission to 600

     chmod 600 ~/.ssh/config
1 Like