Answer the question
In order to leave comments, you need to log in
Why does the Screen process exit when the SSH session ends?
I ask you not to throw slippers) I
bought a VDS server, for the sake of interest, I used only shared hosting before.
I need to execute a script on the server, let's say that counts up to 1.000.000 in the background. That is, I ran the script, disconnected from ssh, turned off the computer, turned it back on, connected to ssh, opened screen -r script, there is the result of the script.
I use MobaXterm on Windows 10, connect via SSH, run the script:
$ screen -S script
Everything is fine, everything works, I press CTRL+A+D
, open a new session, check active sessions:
$ screen -ls
I see my script, beauty!
But, if I close the SSH session in any way (exiting the program, closing the tab with the terminal, exit) the screen session is also interrupted.
As I thought, if you do something with the help of a screen, then you can close the ssh session, go to drink tea, then connect back via ssh, go to screen -R script and the progress of the script will be displayed there ..
How does this even work, tell me?
It seems to me that the problem is in MobaXterm through which I work.
I want to try tomorrow on ubuntu, maybe it will work there ..
Answer the question
In order to leave comments, you need to log in
I have never had such problems with screen. But I started differently.
I log in via ssh, I launch screen in it, for example, I start compiling something. Then press CTRL+A+D.
I close the console / I go from another computer, I write screen -r, I see how compilation continues there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question