Gregory Avedissian wrote:
I can't set you straight, and I don't know the security implications, but this works:
ssh -X user@remote-host su-to-root -X -c <command>
You might be asked for the root password, the user password or neither, depending on your setup.
Hmm...hadn't heard of su-to-root before; thanks. Googling suggests it's a shell script, though it doesn't seem to be available on my Ubuntu karmic or the repositories. I did find something called sux which is an X-preserving wrapper around su. Alas, since I've disabled the root password, I can't use that. I'm a little surprised sudo doesn't have a way of doing this without security risks, since the maintainers are obviously aware of the issue and there's enough information in the environment to deduce the correct .Xauthority. Perhaps in the next release. Thanks for the reply, Ted