Can't log using root directly nor RDP

After upgrading from 42 to 43, I am not able to log using root user directly from Hyper-V > connect nor using RDP as before.

I followed the instructions at Making sure you're not a bot!

as I understood that root in 43 was locked but it did not help

Why I need to log as root? Because I need to run BleachBit with root as with sudo on command line I get an error

$ sudo bleachbit
[sudo] password for salam:
Invalid MIT-MAGIC-COOKIE-1 key
Invalid MIT-MAGIC-COOKIE-1 key

(bleachbit:749655): Gdk-CRITICAL **: 16:16:49.324: gdk_screen_get_root_window: assertion ‘GDK_IS_SCREEN (screen)’ failed
Invalid MIT-MAGIC-COOKIE-1 key

(bleachbit:749655): Gtk-WARNING **: 16:16:49.465: cannot open display: :10.0

If you have the password set for root as indicated then you would not need to connect as root from remote. (By default root connections from remote is blocked).

Instead you could use su - and connect from your terminal to a root session locally.

1 Like

Yes, because su has a better way to propagate the Xauthority than sudo:

  • uses ~/.Xauthority if XAUTHORITY is unset
  • extract the Xauthority in a temporary file in the homedir of the target user
  • set XAUTHORITY to this file
  • sudo only export the XAUTHORITY variable

Another less secure way is to use xhost and sudo :

  • xhost si:localuser:root
  • sudo bleachbit

So many thanks Francis, the less secured solution worked like a charm. But tell me please what is this xhost si… command do? and does this mean I can never log as root as before?

It allows the root user to open an X application to your session.
See: man xhost

This is unrelated. If you applied properly the reset-root-password doc, you should be
able to log as root in textual mode. I don’t know (and don’t want to known) for a
graphical session.

Have you tried: (this should work if you set properly the root password) ?

  • su -
  • bleachbit
1 Like