Date: Sat, 6 Sep 2003 13:03:17 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: "Steven G. Kargl" <kargl@troutmask.apl.washington.edu> Cc: freebsd-questions@freebsd.org Subject: Re: PAM, X11, and su as a normal user? Message-ID: <20030906120317.GA78469@happy-idiot-talk.infracaninophile.co.uk> In-Reply-To: <200309052208.h85M8MbA060878@troutmask.apl.washington.edu> References: <20030905200737.GB45683@happy-idiot-talk.infracaninophile.co.uk> <200309052208.h85M8MbA060878@troutmask.apl.washington.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
--y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 05, 2003 at 03:08:22PM -0700, Steven G. Kargl wrote: > Matthew Seaman wrote: > > On Fri, Sep 05, 2003 at 12:18:40PM -0700, Steven G. Kargl wrote: > > > After a few hours of frustation, it's time to ask a question. > > >=20 > > > I have 2 accounts on my machine. I use startx to start > > > X11 as user kargl. If I then su to user sgk, I cannot > > > fire up X clients. For example, > > >=20 > > > troutmask:kargl[202] su sgk > > > Password: > > > troutmask:sgk[201] gnuplot > > > Terminal type set to 'x11' > > > gnuplot> plot sin(x) > > > gnuplot>=20 > > > gnuplot: unable to open display 'troutmask.apl.washington.edu:0' > > > gnuplot: X11 aborted. > > >=20 > > > I've tried using "xhost sgk@", but this doesn't work. > > > The only thing I can think of that may need to be > > > configured is PAM, but the documentation is rather > > > incomplete. So, anyone know how to setup su to > > > permit sgk to use X clients? > >=20 > > As user kargl: > >=20 > > % xauth nextract /tmp/foo ${DISPLAY} > >=20 > > As user sgk: > >=20 > > % xauth nmerge /tmp/foo > >=20 > > and remember to delete /tmp/foo as soon as possible. > >=20 >=20 > I still get the above results with gnuplot after issuing the > two xauth commands you give above. If I use "xauth list" > with as both users the entry for $DISPLAY shows the same key.=20 >=20 > troutmask:sgk[246] xauth list > troutmask.apl.washington.edu:0 MIT-MAGIC-COOKIE-1 some_long_string > troutmask:kargl[245] xauth list > troutmask.apl.washington.edu:0 MIT-MAGIC-COOKIE-1 some_long_string >=20 >=20 > I suspect that I need to add something to /etc/pam.d/{su,system,xserver}, > but I can't locate adequate documentation. If all your X sessions are local to you machine (and possibly even if they aren't), then try setting the DISPLAY variable to :0.0 -- you'll need to repeat the fun'n'games with xauth to match the new $DISPLAY setting. That means that all connections to the X server will take place via the unix domain socket in /tmp/.X11-unix/ rather than through network sockets. This is generally a good move as the default in FreeBSD nowadays is for the X server not to listen on the network at all. You can check if your X server is listening on the net by running: % netstat -an | grep '\.60[0-6][0-9] ' On a system using the default settings, there won't be any output from that command. Ports 6000 -- 6063 are allocated to the X window system, although generally only the bottom one or two of that range would ever be used on most personal machines. Note that port 6010 or above is generally ssh(1), rather than the X server directly. ssh(1) is also the answer to being able to run X clients remotely without having the X server listening directly on the network, incidentally having the very welcome benefit of encrypting all of the X network traffic. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --y0ulUmNC+osPPQO6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/Wc0FdtESqEQa7a0RAjByAJ9WUk6aKV/4DHadxIy9ODfMISZBIgCghqFe Y7mRsMR2Q9mMmjXlxfmvvD8= =2KRn -----END PGP SIGNATURE----- --y0ulUmNC+osPPQO6--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030906120317.GA78469>