When I use screen on my computer and detach, I am taken back to the command prompt and everything is fine. However, if I SSH into my computer remotely and use screen, when I try to detach I get the error Utmp slot not found -> not removed.

It then hangs and I cannot even ctrl-c, ctrl-d and have to close the Cygwin window. Why is this occuring and how can I fix it?

Note to recreate error by SSH-ing out of your computer then back in:

$ screen
(C-a d)
$ ssh -R12345:localhost:22 username@someServer
$ ssh -p12345 username@
$ screen -r
(C-a d)

It looks the culprit is the file /var/run/utmp, which in my case is just an empty file, and the only one in the /var/run/ directory.

For me I just removed it, via rm /var/run/utmp,

Or you can rename it, e.g. mv /var/run/utmp /var/run/utmp~

  • Note that you have to restart screen after removing or renaming the file. – Johann Aug 14 '14 at 18:12
  • Also note that this file reappeared when I ran the cygwin setup again. – Johann Aug 14 '14 at 18:54

The answer by ryenus did not work for me. I tried renaming it, removing it, even tried touching /var/run/utmp and chmod'ing it to 0777. However I did find an answer on another forums that did work.

Simply edit your .screenrc file and add this line:

deflogin off

  • Sounds reasonable, upvoted :-) – ryenus Apr 9 at 5:26

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.