On Mac OS, SSH sessions to remote computers are timing out too quickly! The solution is to set a timeout interval in seconds.
Steps
# create configuration file for SSH
$ touch ~/.ssh/config
# edit the file
$ vim ~/.ssh/config
# add following content and save
ServerAliveInterval 120