How to Keep Processes Running after SSH Logout in Linux

It happens many time that we try to access an app or content, but it ask for re-login or a popup which states your session is timed out. The session generally times out when content is kept idle and no transaction is performed. Many times “session_time” variable is set, which keeps active connection for time being. But what happens when session times out, a “SIGNUP” signal is sent to processes running in background as well as for processes that are children of the main process which are forced to terminate regardless of completion or partial completion of task. So how can we keep are the process running even after SSH Logout? In this article, I will explain how to keep the process running even after SSH is disconnected from a Linux terminal (Ubuntu 18.04 and CentOS 7).

Source: How to Keep Processes Running after SSH Logout in Linux (LinOxide)

If your mount.cifs has stopped working, try adding -o vers=3.0

If you have been using “mount.cifs …” or “sudo mount.cifs …” to mount a share located on a Windows machine in Linux, and it stops working after any kind of update or change to your network, try adding -o vers=3.0, or if you are already using some -o options, add vers=3.0 to the list (separated from any existing -o options by a comma). You could also try 2.0 rather than 3.0, but by default it tries to use 1.0 as the SMB protocol version, and Microsoft has removed support for that in some versions of Windows. So if you get a Windows upgrade that removes the 1.0 protocol, your existing mount-cifs invocation line may stop working, but it appears that sometimes other changes in the network can trigger this as well. The vers= option is explained on the mount.cifs man page as follows:

SMB protocol version. Allowed values are:

  • 1.0 – The classic CIFS/SMBv1 protocol. This is the default.
  • 2.0 – The SMBv2.002 protocol. This was initially introduced in Windows Vista Service Pack 1, and Windows Server 2008. Note that the initial release version of Windows Vista spoke a slightly different dialect
    (2.000) that is not supported.
  • 2.1 – The SMBv2.1 protocol that was introduced in Microsoft Windows 7 and Windows Server 2008R2.
  • 3.0 – The SMBv3.0 protocol that was introduced in Microsoft Windows 8 and Windows Server 2012.

Note too that while this option governs the protocol version used, not all features of each version are available.

So, a typical invocation to mount a Windows share accessible by all users of the machine might now look something like this:

sudo mount.cifs //WindowsIPaddress/WindowsShareName /path/to/mountpoint/ -o user=WindowsUserName,password=WindowsUserPassword,vers=3.0,uid=1000,gid=1000

(The bolded part above is all one line.)