Re: addendum, Re: One-user system.
Greg Wooledge wrote:
> On Thu, Feb 10, 2022 at 06:37:04PM -0800, peter@easthope.ca wrote:
> > root@joule:~# su peter
> > peter@joule:~$ firefox-esr --display=:0
> > Invalid MIT-MAGIC-COOKIE-1 keyUnable to init server: Could not connect: Connection refused
> > Error: cannot open display: :0
> >
> > peter, logged in directly, can run firefox.
> > root, logged in directly, can run firefox.
> > The above is from a security mechanism in firefox?
>
> No, you simply haven't provided enough credentials to the X server.
> It's the X server who's rejecting connections from "peter", because
> "peter" has not presented the correct MIT-MAGIC-COOKIE (auth token).
A different solution, with less security, especially on multi-user system might be:
enable access for a specific user by "xhost".
In your case, do before "su peter", as user root:
xhost +si:localuser:peter
This prevents the X server security mechanism, which Greg explains.
Beaware, it's more dangerous, opening it X this way.
Best regards,
Klaus.
--
Klaus Singvogel
GnuPG-Key-ID: 1024R/5068792D 1994-06-27
Reply to: