Hello,

This is actually a pretty common problem; after using "su" you can't run
programs which want to write directly to your terminal. You can try this
yourself:

[EMAIL PROTECTED] TTY=`tty`
[EMAIL PROTECTED] echo $TTY
/dev/pts/6
[EMAIL PROTECTED] echo hello world > $TTY
hello world
[EMAIL PROTECTED] sudo su -c "echo root succeeds > $TTY" root
root succeeds
[EMAIL PROTECTED] sudo su -c "echo otheruser fails > $TTY" otheruser
/bin/bash: /dev/pts/4: Permission denied

You can "fix" this by changing the permissions on $TTY so that any user can
write to it. This is not particularly secure so I am not encouraging you to do
it, but the command one would use would be "chmod o+rw $TTY" Thus:

[EMAIL PROTECTED] sudo su -c "echo root has permission > $TTY" otheruser
/bin/bash: /dev/pts/4: Permission denied
[EMAIL PROTECTED] chmod o+rw $TTY
[EMAIL PROTECTED] sudo su -c "echo root has permission > $TTY" otheruser
otheruser fails

Good luck,

-- Erik

On Thu, Nov 20, 2008 at 07:59:28PM +0100, Folkert van Heusden wrote:
> Hi,
> 
> Situation: as root-user I start a quake server in screen under an
> other user. Now when I become that user and do screen -r, I get an
> error:
> 
> mauer:/# /bin/su - quake -c /usr/local/games/Quake/bin/start_qw2
> 
> and the /usr/local/games/Quake/bin/start_qw2 script contains:
> ----------------------------------------------------------------------
> #! /bin/sh
> 
> cd /usr/local/games/Quake/bin
> 
> /usr/bin/screen -d -m -S 'QuakeWorld' ./mvdsv
> ----------------------------------------------------------------------
> 
> Now when I do the following:
> mauer:/# su - quake
> [EMAIL PROTECTED]:~$ screen -r QuakeWorld
> Cannot open your terminal '/dev/pts/28' - please check.
> [EMAIL PROTECTED]:~$ ls -l /dev/pts/28
> crw--w---- 1 folkert tty 136, 28 2008-11-20 19:58 /dev/pts/28
> 
> what can it be?
> 
> 
> Folkert van Heusden
> 
> -- 
> MultiTail ?r en flexibel redskap f?r att f?lja logfilar, utf?r av
> commandoer, filtrera, ge f?rg, sammanfoga, o.s.v. f?lja.
> http://www.vanheusden.com/multitail/
> ----------------------------------------------------------------------
> Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com
> 
> 
> _______________________________________________
> screen-users mailing list
> screen-users@gnu.org
> http://lists.gnu.org/mailman/listinfo/screen-users


_______________________________________________
screen-users mailing list
screen-users@gnu.org
http://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to