
Using screen Command to Keep SSH Sessions Running There can be various ways to leave ssh sessions running after disconnection as described below: 1. Techniques to Keep SSH Session Running After Disconnection Parent of such processes intentionally dies making child execute in background. They are usually long-running processes which are once initiated and then detached from any controlling terminal so that they can run in background till they do not get completed, or end up throwing an error. These are some intentionally orphaned processes, such processes which are intentionally left running on the system are termed as daemon or intentionally orphaned processes. Such processes have init as their immediate parent which waits on these processes until they die or end up. Orphan processes are those which initially had a parent which created the process but after some time, the parent process unintentionally died or crashed, making init to be the parent of that process. These processes have their owner as any of the valid user of the system, including root. They are started during the session as foreground processes and end up in certain time span or when the session gets logged out. Normal processes are those which have life span of a session. Understand Processes on Linux Normal Process On Linux systems, we can have many ways to make these jobs running on the remote server or any machine even after user logout and session termination. Only the jobs that have been configured to ignore this signal are the ones that survive the session termination.


When we log out of the session or the session times out after being idle for quite some time, the SIGHUP signal is send to the pseudo-terminal and all the jobs that have been run on that terminal, even the jobs that have their parent jobs being initiated on the pseudo-terminal are also sent the SIGHUP signal and are forced to terminate.ĭon’t Miss: 5 Useful Practices to Keep SSH Server Secure and Protected 5 Ways to Keep SSH Sessions Running After Disconnection In more technical terms, when we ssh on to other user on some other system and run commands on that machine, it actually creates a pseudo-terminal and attaches it to the login shell of the user logged in. SSH or Secure Shell in simple terms is a way by which a person can remotely access another user on other system but only in command line i.e.
