Shared State

Jeff McGee's Blog of Messages Worth Passing

Running Screen in a Sudo Session

Posted on Sat 07 July 2012 in Tips

If you use sudo su to become a different user, and then try to create a screen session for the new user, it gives this error message:

Cannot open your terminal '/dev/pts/1' - please check.

The problem is that your original user still owns the pseudo terminal. The best solution I've seen is a hack, but it works:

sudo su - notjeff
script /dev/null
screen
my photo

Jeff McGee — builder, problem solver, teacher, and general nerd.

Github:
@JeffAMcGee
Twitter:
@JeffAMcGee
Email:
jeffamcgee AT gmail