From owner-freebsd-questions@FreeBSD.ORG Fri May 15 07:42:09 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29151106578D for ; Fri, 15 May 2009 07:42:09 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3738FC20 for ; Fri, 15 May 2009 07:42:08 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.3/8.14.3) with ESMTP id n4F7g13R010748; Fri, 15 May 2009 08:42:03 +0100 (BST) (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.8.2 smtp.infracaninophile.co.uk n4F7g13R010748 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infracaninophile.co.uk; s=200708; t=1242373323; bh=c5bEem6S6Jc+wqWLikqa5ymkntZIK2S/bB4yOBObDE8=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Cc:Content-Type:Date:From:In-Reply-To: Message-ID:Mime-Version:References:To; z=Message-ID:=20<4A0D1CC2.8000107@infracaninophile.co.uk>|Date:=20F ri,=2015=20May=202009=2008:41:54=20+0100|From:=20Matthew=20Seaman= 20|Organization:=20Infracaninophi le|User-Agent:=20Thunderbird=202.0.0.21=20(X11/20090420)|MIME-Vers ion:=201.0|To:=20Pieter=20Donche=20|CC:=20 "mail.list=20freebsd-questions"=20| Subject:=20Re:=20root=20user,=20graphical=20programs|References:=2 0|In-Reply -To:=20|X- Enigmail-Version:=200.95.6|Content-Type:=20multipart/signed=3B=20m icalg=3Dpgp-sha256=3B=0D=0A=20protocol=3D"application/pgp-signatur e"=3B=0D=0A=20boundary=3D"------------enig4E12BA1D295ED2DBB43668C3 "; b=FSkhrv/BhrK1CTRRKM8BPc17khfHiKQqzCuRb0IB7ekLCvZauFO3xqKbvujYINddv Ozq9XPZo9FSN/A2Tet0VBATRy892PPMwQ+u4lU7sEq+KVzZbVK2Axffw/pSxdo5aNw N2bUGfhpy3fnTBzlpMuioYHsT5TEdz7h4sMDM3hg= X-Authentication-Warning: happy-idiot-talk.infracaninophile.co.uk: Host localhost [IPv6:::1] claimed to be happy-idiot-talk.infracaninophile.co.uk Message-ID: <4A0D1CC2.8000107@infracaninophile.co.uk> Date: Fri, 15 May 2009 08:41:54 +0100 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.21 (X11/20090420) MIME-Version: 1.0 To: Pieter Donche References: In-Reply-To: X-Enigmail-Version: 0.95.6 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig4E12BA1D295ED2DBB43668C3" X-Virus-Scanned: clamav-milter 0.95.1 at happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on happy-idiot-talk.infracaninophile.co.uk Cc: "mail.list freebsd-questions" Subject: Re: root user, graphical programs 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: Fri, 15 May 2009 07:42:09 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig4E12BA1D295ED2DBB43668C3 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Pieter Donche wrote: > FreeBSD 7, KDE 3.5 > To install Matlab (in linux compat mode), one must execute the > matlab install program as root. The installer is graphical. > When from a KDE terminal window, I switch to root (# su -) > and try a graphical program, e.g. # xpdf, I get Can't open display. > The FreeBSD handbook (10.5.1) says in that case type setenv HOME ~USER > (USER the username where the su command was given). This doesn't help > I still get Can't open display. >=20 > What's wrong and how to solve it? That's the standard X Windows security stopping other users opening windo= ws on your screen. In this case, something like: % xhost +LOCAL: % su # {...whatever you need to do to install your app...} # exit % xhost -LOCAL: However be aware of the risks: xhost +LOCAL: means that any other user of the same machine can access your display and potentially capture any input including (for instance) the root password. Hmmm... Actually, a more secure means of doing the same thing, that only grants access to your display by the local root user would be: % xauth extract - $DISPLAY > ~/authtoken % su - # echo $HOME (This should return /root -- this is important so that the correct .Xauth= ority file gets updated.) # xauth merge /home/your-uid/authtoken # rm /home/your-uid/authtoken # setenv DISPLAY :0.0 # {...whatever you need to do to install your app...} Now any X programs run by root will open on your display. To revoke this= permission you can simply remove /root/.Xauthority or for finer grained control you can use =20 # xauth remove $DISPLAY Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enig4E12BA1D295ED2DBB43668C3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREIAAYFAkoNHMkACgkQ8Mjk52CukIyJnwCdF68h4+nb6WRuOF+sCbeLLZWd oz8AnAo+qHh0kNAfnfw1RwArrGyIDbhn =aemP -----END PGP SIGNATURE----- --------------enig4E12BA1D295ED2DBB43668C3--