From owner-freebsd-questions@FreeBSD.ORG Thu Feb 23 22:27:17 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1124C16A420 for ; Thu, 23 Feb 2006 22:27:17 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4975943D48 for ; Thu, 23 Feb 2006 22:27:15 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from flame.pc (aris.bedc.ondsl.gr [62.103.39.226]) (authenticated bits=128) by igloo.linux.gr (8.13.5/8.13.5/Debian-3) with ESMTP id k1NMR4mO011146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 24 Feb 2006 00:27:05 +0200 Received: from flame.pc (flame [127.0.0.1]) by flame.pc (8.13.4/8.13.4) with ESMTP id k1NMQdOH035615; Fri, 24 Feb 2006 00:26:39 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by flame.pc (8.13.4/8.13.4/Submit) id k1NMQdEX035614; Fri, 24 Feb 2006 00:26:39 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Fri, 24 Feb 2006 00:26:39 +0200 From: Giorgos Keramidas To: Rob Message-ID: <20060223222639.GA35607@flame.pc> References: <20060223082331.74053568.rob@roblytle.org> <20060223172628.GA21362@flame.pc> <20060223102347.11de9bf7.rob@roblytle.org> <20060223212947.GA35132@flame.pc> <20060223141315.045c061e.rob@roblytle.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060223141315.045c061e.rob@roblytle.org> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (score=-3.371, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.83, BAYES_00 -2.60, DNS_FROM_RFC_ABUSE 0.20) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr Cc: freebsd-questions@freebsd.org Subject: Re: problem regarding setting DISPLAY env variable and hostname X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Feb 2006 22:27:17 -0000 On 2006-02-23 14:13, Rob wrote: > > > > Then you have two options: > > > > 1. Start the X11 server in ``listen mode'', which will enable > > connections to port 6000: > > > > $ startx -listen_tcp > > I tried that and then at the xterm I again gave the commands > > xhost +localhost > su'd > setenv DISPLAY localhost:0.0 > > And I was able to run X programs as root, so that worked. > > > > > 2. Use the ~/.Xauthority file of the user who started the X11 > > session. This can only be done by root or a sufficiently > > privileged user, and it works like this: > > > > $ su - > > Password: **** > > > > After you have gained superuser privileges, you can `merge' the > > proper credentials that will allow you to connect to the running > > X11 session (even though it wasn't `root' that started it), by > > using xauth(1): > > > > csh# setenv DISPLAY localhost:0 > > csh# xauth merge ~user/.Xauthority > > > > Now you should be allowed to run X11 programs just fine. > > I did that and it worked! I stopped and started Xorg and the changes seem to be permanent. > Now I don't have to use the "xhost +localhost" and "setenv DISPLAY localhost:0.0" any more. Great :-) Thanks for taking the time to post a followup, to verify that this was indeed a fix for twhat you were seeing.