You are not logged in.

#1 2013-06-13 10:29:57

Markus00000
Member
Registered: 2011-03-27
Posts: 318

[SOLVED] sudo -i changes ownership of .Xauthority to root, breaks X

From a normal user's terminal session running in xmonad, I tried to enter a root terminal session with "sudo -i".

I got sent to the virtual console and couldn't switch back to X. An error message told me .Xauthority was not writable. The user's .Xauthority file was now owned by root and not writable.

After removing the root-owned files, I could start X and everything seems normal.

"sudo -s" and "su" work as expected.

Do I have a bad configuration? Do I not understand "sudo -i"?

Edit: Could sudo's "initial login" try to start X as root? I have auto-login configured for the first virtual console. I'll try to switch that off and try again.

SOLVED: The cause was my root user's .bash_profile and .zprofile. I copied my user's .bash_profile and .zprofile over to root and didn't notice that I should comment the following line to automatically start X:

[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx

Last edited by Markus00000 (2013-06-13 13:04:31)

Offline

Board footer

Powered by FluxBB