Execute a process as a specific user

Zac Jensen listbox at cybereal.org
Sat Jun 14 11:51:06 CEST 2003

Hash: SHA1

On Saturday 14 June 2003 03:33 am, Maurix wrote:
> Hi,
> Thanks but... it didn't work!!
> Is better if I explain what i'm tring to do,
> I want to connect to the X server from the console but the
> Xlib say that i don't have the permission if i'm root!
> I use the commando of Tkinter: tk=Tkinter.Tk(":0.0")
> ( ¿¿way if i'm the boss??)
> So i tryed to make this making a su to the user fo X server
> and it work perfectly!! Now i don't want to depend on "su" program
> and i tryied this command, set(e)uid and set(e)grp, but can't connect
> to the X-server anyway: client is not authorized
> My question is, exist a more elegant way to make this: a script
> that show a Tk window from the console, a script that stay in
> background for all the time.
> I'm afraid that i'm out of theme here because is a problem of
> Xservers but, please, if anyone have make somting like this help
> me.

It is an X server issue, which is easily solved, while logged in as the user 
you are running the Xserver as... just run xhost +localhost ; or xhost 
+<owner-user> +root   either of these will solve your issue.  A more general 
but less safe (unless you have a trustworthy firewall) is to run xhost +   
which will allow all clients without trouble.

- -Zac
Version: GnuPG v1.2.2 (GNU/Linux)


More information about the Python-list mailing list