Playing with xauth

You have ssh’d to a server and have tunneled X back, but you have to do work in an X application as a service account and you have to use sudo to get to that account.

$ echo $DISPLAY | sed "s,localhost,`hostname`/unix," | xargs xauth list MIT-MAGIC-COOKIE-1 _hex_string_
$ sudo su - service_account
$ xauth add _the_output_from_the_first_command_string_

Comments are closed.