Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is it normal, that when I am logged in as root, and the used su user, I can't access that users screen sessions?

In this case, screen complains about it not having permissions on /dev/pts/x.

I assume that it can't control the terminal which was opened as root in the way it needs: am I right?

share|improve this question
    
Have you tried using 'su - user' ? –  tripledes Aug 6 '12 at 20:26
    
@tripledes Tried it just now, did not work –  varesa Aug 6 '12 at 21:14

1 Answer 1

up vote 7 down vote accepted

In general, you can change the ownership of /dev/pts/x to the user that you su to, as root, before you actually su. That way, the user that you su to will have access to attach the screen to your origin terminal.

# chown someuser /dev/pts/x
# su - someuser
$ screen -dr somescreen

If this is something you want to make more smooth, you could look into how ownership is set on terminal devices, so that you could, say, make them group read/writable, and have a small group where users have access. This can have severe security implications, so do take care if you're exploring that path!

share|improve this answer
    
Ok. That's what I did. I created an "alternative su", which executes chown :mygroup $(tty)and the su $1 I added the users to the group –  varesa Aug 7 '12 at 12:39
1  
I worry about the security implications of changing the ownership of the device file, so my workaround is to simply run script /dev/null right before I run screen. –  Mox Aug 7 '12 at 21:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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