cd
cd /etc/ssh
sudo nano sshd_config
Search for keepalive (Use Ctrl+W to search) Add the below
ClientAliveInterval 30
TCPKeepAlive yes
ClientAliveCountMax 99999
Restart the service
service ssh restart
Will ask for login if not 'root' user Enter the credentials and done, below is the output you get:::
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'ssh.service'.
Authenticating as: xxx
Password:
==== AUTHENTICATION COMPLETE ===
To keep the python script running even after logging off Source: http://askubuntu.com/questions/8653/how-to-keep-processes-running-after-ending-ssh-session ssh into the remote machine start tmux
$ tmux
Start the process you want inside the started tmux session. Leave/detach the tmux session by typing Ctrl+B and then D You can now safely log off from the remote machine, your process will keep running inside tmux. When you come back again and want to check the status of your process you can use:
$ tmux attach
If you want to have multiple sessions running side-by-side, you should name each session using Ctrl-B and $. Rename the session and press "Enter". You can get a list of the currently running sessions using:
$ tmux list-sessions
To attach to a specific session
$ tmux attach -t <session-name/no>
Can run two separate servers in a single tmux session, running Frontend server and Model API server both on one Digital Ocean machine.