NOTE: This is unsafe
Temporarily disable X server’s access control.
Disable for only local:
$ xhost +local: non-network local connections being added to access control list
Disable for any host:
$ xhost + access control disabled, clients can connect from any host
Run an X program as another user.
$ sudo -u gdm dbus-launch gnome-control-center
If you also need to change the user’s shell.
$ sudo -u gdm -s /bin/bash -c "dbus-launch gnome-control-center"
Renable X server’s access control.
$ xhost -local: non-network local connections being removed from access control list
$ xhost - access control enabled, only authorized clients can connect