[Linux Screen] Cannot make directory ‘/var/run/screen’: Permission denied

Table of Contents

[Linux Screen] Cannot make directory '/var/run/screen': Permission denied

Error info

Sometime, usually after a crash or sudden shutdown, screen refuses to start. Commands like

screen
screen -ls
screen -r
screen -d

result in the following output

Cannot make directory '/var/run/screen': Permission denied

image

Fix Cannot make directory '/var/run/screen': Permission denied

The directory /var/run/screen/ is the socket directory for screen.

Fortunately, screen reads a environment variable SCREENDIR to get an alternative socket directory.

So to work around it, you can create a directory, such as ~/.screen:

mkdir ~/.screen && chmod 700 ~/.screen

and export the SCREENDIR to point to that directory:

export SCREENDIR=$HOME/.screen

You can also put this line into you ~/.bashrc so that it will also take effect afterwards.

Result

image

References

https://superuser.com/questions/1195962/cannot-make-directory-var-run-screen-permission-denied


Warning: Undefined variable $comments_number in /shared/webdir2/dothanhlong.org/wp-content/themes/business-hub/comments.php on line 35

Warning: Undefined variable $comments_number in /shared/webdir2/dothanhlong.org/wp-content/themes/business-hub/comments.php on line 39
0 thoughts on “[Linux Screen] Cannot make directory ‘/var/run/screen’: Permission denied”

Leave a Reply

Your email address will not be published. Required fields are marked *