From owner-freebsd-questions Sat Feb 15 12:51: 6 2003 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 B6C7B37B401 for ; Sat, 15 Feb 2003 12:51:03 -0800 (PST) Received: from ns1.tetronsoftware.com (ns1.tetronsoftware.com [65.67.249.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9AB7843FAF for ; Sat, 15 Feb 2003 12:51:02 -0800 (PST) (envelope-from geneh@tetronsoftware.com) Received: from ns1.tetronsoftware.com (ns1.tetronsoftware.com [65.67.249.85]) by ns1.tetronsoftware.com (8.12.7/8.12.5) with ESMTP id h1FKouPP006145; Sat, 15 Feb 2003 14:50:56 -0600 (CST) (envelope-from geneh@tetronsoftware.com) From: Gene Harris Organization: Gene Harris, LLC To: Dennis <4real@home.nl>, "Paul A. Mayer" Subject: Re: Running X program under different user Date: Sat, 15 Feb 2003 14:50:55 -0600 User-Agent: KMail/1.5 Cc: kitsune , freebsd-questions@FreeBSD.ORG References: <3E4E7786.2010809@home.nl> <3E4E90F1.4010406@fnug.net> <3E4E9AD4.1020902@home.nl> In-Reply-To: <3E4E9AD4.1020902@home.nl> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200302151450.55738.geneh@tetronsoftware.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG You need to use 'su -m', which leaves the environment, including the DISPLAY export unchanged from the current user, but changes the userid to the user you want to switch to. You can then run your x program as the user you wish to use. I believe this is a MIT-MAGIC-COOKIE issue and is reasonably well documented in the questions mailing list archive. In your previous KDE life, were you using XFree86 v3 and now you have switched to XFree86 v4? This is one of the first things many users run into after they switch. Gene On Saturday 15 February 2003 01:53 pm, Dennis wrote: > Paul A. Mayer wrote: > > Hi, > > > > Did you try to call: > > > > xhost +localhost > > > > before your su command? > > > > Looks like your X session is not letting your other user access your > > display. > > > > $.02, hope it helps. > > > > /Paul > > > > Dennis wrote: > >> kitsune wrote: > >>> On Sat, 15 Feb 2003 18:23:18 +0100 > >>> > >>> Dennis <4real@home.nl> wrote: > >>>> Hi, > >>>> > >>>> I'm a former kde user, using Windowmaker now.... > >>>> > >>>> And in the past i always used RUN in kde, to startup my favourite > >>>> irc client... > >>>> > >>>> RUN had several options to execute programs under a different user > >>>> etc, which comes in handy when using IRC... > >>> > >>> if that run thing was a command that can be done then it can still > >>> be used under windowmaker... > >>> > >>>> But now i need to use SU i think to accomplish this, but it doesnt > >>>> work :( > >>> > >>> wierd it works here... > >>> su -c > >>> > >>> example... > >>> su kitsune -c scilab > >>> this will su user kitsune and then run scilab > >>> > >>>> Does anyone know which command i can use to execute an X program > >>>> under a different user? > >>> > >>> this will work too... > >>> ssh 127.0.0.1 -X -l > >>> the -X turns on X forwarding > >> > >> when i try su [user] -c xchat, i get this error: > >> > >> Xlib: connection to ":0.0" refused by server > >> Xlib: No protocol specified > >> > >> > >> Gtk-WARNING **: cannot open display: :0.0 > >> > >> RUN in kde was a kde-specific command...i think it was in the KDE Panel > >> > >> > >> > >> > >> To Unsubscribe: send mail to majordomo@FreeBSD.org > >> with "unsubscribe freebsd-questions" in the body of the message > > Thanx for ur replies... > > Tried the xhost command, but i get the exact error message afterwards... > So i guess something else causes the problem.. > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message