SCIENTIFIC-LINUX-USERS Archives

December 2009

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Brett Viren <[log in to unmask]>
Reply To:
Brett Viren <[log in to unmask]>
Date:
Mon, 7 Dec 2009 13:05:56 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (44 lines)
William Shu <[log in to unmask]> writes:

> [root@csc101A wss]# emacs &
> [1] 4833
> [root@csc101A wss]# Xlib: connection to ":0.0" refused by server
> Xlib: No protocol specified
>
> emacs: Cannot connect to X server :0.0.
> Check the DISPLAY environment variable or use `-d'.
> Also use the `xhost' program to verify that it is set to permit
> connections from your machine.

Don't use "xhost".  It leads to insecure behavior and in most cases buys
you nothing useful that you can't do better in other ways.  Here are
several:

First, maybe it is enough for you to simply run emacs in the terminal:

  emacs -nw

Otherwise, you can SSH to root and X11 should be forwarded correctly
(maybe you need -Y or a .ssh/config entry to make X11 forwarding the
default).

If you don't have SSH properly forwarding X11 and/or don't want to use
SSH in this case and your root session is on the same machine as that
running your X11 session you can do this (assuming bash):

  export DISPLAY=:0.0
  export XAUTHORITY=~USERNAME/.Xauthority
  emacs &

Or, if installed you can do:

  gksu emacs

or if installed and correctly configured:

  gksudo emacs


Luck,
-Brett.

ATOM RSS1 RSS2