Права доступа к X-серверу

Have you ever been troubled with X magic cookie authenification, trying to start X-basing tool as root, when X display belongs to you, as ordinary user? I have, and decide to write stupid shell script to get around this problem. Note, that root can read your .Xauthority file. So, if you want to su to another user, you'll need more elaborate solution.

Of course before you start to need this, you need to enable xauth style authenification. If you are on that stage, read Quick quide by Donal K. Fellows.

There is several solutions

If you often need to login to remote machines and start X programs from there, you might want to use foreign_xterm script, which transfers correct authenification info to remote machine and runs xterm or specified command from there via rsh. It passes arguments to rsh and invoked command, so things like

foreign_xterm -l somebody somehost -e mc
would work. If called after name foreign_xapp it doesn't spawn xterm - just transfer authorization token and start desired command setting right value for DISPLAY variable.

Note, that if you use ssh, you don't need such tricks - it does them for you. But, if you are using some other daemons such as Network Audio or floppyd you might need it anyway