Xauthority

Generally when you try opening any X application, say xclock or xterm, as a root user on a remote system, It gives an error saying “Can’t open display”. To get rid of this message what you can do is,

– First ssh with -X into remote system
$ ssh -vX foo@example.com

– Export a variable
$ export XAUTHORITY="~/foo/.Xauthority"

– Start X app (I am assuming user “foo” has a superuser privileges on remote system)
$ sudo xterm

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s