On Google Cloud Compute Engine GNU screen is exiting with no message. It works if I "sudo screen" but that is not what I need. The binary is suid root and has correct permissions, and I have also tried compiling my own copy of the latest screen straight from FSF. I have tried the copy of screen shipped with both Ubuntu and Debian images.

I have not been able to find any information on why this would happen (with no message) so I am assuming it is something Google Cloud related more than screen related? Screen is supposed to work on Google Cloud - they recommend using it. Not sure what's up, any help appreciated.

lrwxrwxrwx 1 root root 12 Jul 10 08:46 /usr/bin/screen -> screen-4.6.2
-rwsr-xr-x 1 root root 1613208 Jul 10 08:46 /usr/bin/screen-4.6.2

I tested it and tmux works so that is one way to achieve it but I am more accustomed to screen's key bindings.


It might be that screen cannot write to the socket directory for your user – by default, /var/run/screen/S-$USER. This seems especially likely to me as you say that it works for your root user.

(Yes, normally you ought to be shown an error message to that effect, but I think there's always a chance something is simply hiding that.)

Thus I recommend looking at the permissions of /var/run/screen (what I see on working systems is root:utmp 01775) and the S-* directories in it (perms should be 01700).

You could also try setting the SCREENDIR environment variable to something in your home directory as per this article.

  • /var/run/screen looks like it is 1777 and setting the SCREENDIR did not help, still exits with no message. – keith Jul 18 '18 at 16:40
  • Okay, it turns out the permissions have be just right with relation to the binary, see here. Try and run sudo /etc/init.d/screen-cleanup start – Sebastian Schleussner Jul 19 '18 at 18:10
  • Still nothing. Since there is no error message I am not hopeful anything like this would help. make install should've set the permissions anyway, right? – keith Jul 22 '18 at 0:35
  • A pity. It was admittedly a stab in the dark, because I've been bitten too often by seemingly implausible causes not to check for them. Yes, make install ought to take care of all such things, but running explicit commands makes sure nothing has gone wrong during or after that step. It IS weird that screen (if I understand you correctly) does not output anything at all. The closest I can come to your observation is by writing a file ~/testrc containing screen 0 true and running SYSSCREENRC=- screen -c ~/testrc, which gives me the immediate output [screen is terminating]. – Sebastian Schleussner Jul 22 '18 at 12:18
  • Following up on that idea – have you checked if your ~/.screenrc contains anything that may have screen quit directly? (/etc/screenrc is obviously okay, otherwise root would be affected, too.) – Sebastian Schleussner Jul 22 '18 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.