-
Notifications
You must be signed in to change notification settings - Fork 781
Avoid killing child processes by sshd after session ended #1642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is as designed and works just like a POSIX host where when the session is exited the child processes are killed. In saying that you can do something like nohup for Windows, the simplest way is to use WMI to call Win32_Process Create like #1032 (comment). This spawns a process that is not associated with the ssh job so when that is killed the child processes still continue to run. |
Thank you very much. |
Hi madcatdev, |
@jufeng2006 - Refer to #1032 (comment) |
@bagajjal, |
Use Invoke-WMIMethod instead if you have a really old version of PowerShell. You are better off upgrading to a newer version of PowerShell though. |
@jborean93 , |
"OpenSSH for Windows" version
OpenSSH_for_Windows_8.1p1, running as current user (not as SYSTEM)
Server OperatingSystem
Windows 7 SP1 (Microsoft Windows [Version 6.1.7601])
Client OperatingSystem
Same
What is failing
SSHD kills every process it had created after session is ended. For example, I want to launch notepad.exe window, which will be kept on Server side after SSH session is ended. So, these are my steps:
I tried to launch notepad.exe with "start" command, even with nohup from GNU-Coreutils, so notepad.exe
process parent didn't exist at moment when ssh session ends, but nothing works. It seems that sshd does
something like "Kill Process Tree" function in ProcessExplorer. How to avoid this and make children processes (notepad.exe in this case) persistent?
The text was updated successfully, but these errors were encountered: