From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1P7SrW-0006Cd-6M for garchives@archives.gentoo.org; Sun, 17 Oct 2010 13:01:18 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 715A1E07B9; Sun, 17 Oct 2010 13:00:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 4E0EFE07B9 for ; Sun, 17 Oct 2010 13:00:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 0B6961B405F for ; Sun, 17 Oct 2010 13:00:38 +0000 (UTC) X-Virus-Scanned: by amavisd-new using ClamAV at gentoo.org X-Spam-Score: -2.891 X-Spam-Level: X-Spam-Status: No, score=-2.891 required=5.5 tests=[AWL=-0.292, BAYES_00=-2.599] Received: from smtp.gentoo.org ([127.0.0.1]) by localhost (smtp.gentoo.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2dm3ioiMgbsK for ; Sun, 17 Oct 2010 13:00:31 +0000 (UTC) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by smtp.gentoo.org (Postfix) with ESMTP id 2901A1B4069 for ; Sun, 17 Oct 2010 13:00:29 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1P7SqW-0003FD-G6 for gentoo-user@gentoo.org; Sun, 17 Oct 2010 15:00:16 +0200 Received: from athedsl-395228.home.otenet.gr ([79.131.95.218]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 17 Oct 2010 15:00:16 +0200 Received: from realnc by athedsl-395228.home.otenet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 17 Oct 2010 15:00:16 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-user@lists.gentoo.org From: Nikos Chantziaras Subject: [gentoo-user] Re: X programs as root Date: Sun, 17 Oct 2010 16:00:05 +0300 Organization: Lucas Barks Message-ID: References: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: athedsl-395228.home.otenet.gr User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20101014 Thunderbird/3.1.4 In-Reply-To: X-Archives-Salt: e4dbcfcd-ac07-4724-8be3-4cb5fa75ff56 X-Archives-Hash: e6e6456e63155e78579c85a0968c157b On 09/22/2010 09:48 PM, Andrey Vul wrote: > When I launch X programs via sudo, I get the following: > > $sudo gui-admin > No protocol specified > gui-admin: cannot connect to X server :0 > > ( Assume gui-admin is an X program ) > > But (gk|kde)su(do)? works. This is somewhat confusing. I just discovered something. Keeping HOME is not really recommended, because the programs that run as root will then use your user's configuration files and sometimes will set 'root' as their owner. As you can imagine, this is not a good thing. It seems what X programs really need is the .Xauthority file of the current X session. All you have to do is add this line to your ~/.bashrc: export XAUTHORITY="$HOME/.Xauthority" Then you don't have to configure sudoers to keep the HOME env var.