[clue] ubuntu admin login as user

Aaron D. Johnson adj at fnord.greeley.co.us
Fri Mar 11 11:19:16 MST 2011


Yaverot writes:
> I can:
> sudo su hisusername
> but then the program I want to run can't access the running copy of X.

I'd assume you're getting something about not being able to
authenticate to the X server.  "Invalid MIT-MAGIC-COOKIE-1 key" or
somesuch.  Or possibly that DISPLAY isn't set at all.

If so, try this instead:

  echo $DISPLAY
  xauth list 
  # sudo clears lots of environment variables.
  # su without '-' option changes a few, too
  sudo su hisusername		
  export DISPLAY=WHAT_DISPLAY_WAS_SET_TO_ABOVE
  export XAUTHORITY=~hisusername/.Xauthority
  xauth add OUTPUT_FROM_XAUTH_LIST_COMMAND_ABOVE

Hope this helps.

- Aaron


More information about the clue mailing list