Lang thang,  Mẹo vặt

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

Table of Content

[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

Leave a Reply

Your email address will not be published.