How to create Xauthority file?
As muru suggested with the URL, doing xhost si:localuser:root
solved the issue. If he/she wants to answer the question, I will accept it as the correct one.
Related videos on Youtube
lucasdelevy
Updated on September 18, 2022Comments
-
lucasdelevy almost 2 years
I am trying to run nautilus with
gksudo nautilus
. However, whenever I try, this dialog appears:Along with the following message in the terminal:
Error copying '/home/.../.Xauthority' to '/tmp/libgksu-v8QBGW': No such file or directory
Then I tried to create a new ~/.Xauthority file by
sudo touch ~/.Xauthority
. Once I rungksudo nautilus
, a dialog asks for my password (also, I cannot write in the textbox, only paste. So I paste my password...)The following error shows:
Unable to init server: Could not connect: Connection refused
(nautilus:4202): Gtk-WARNING **: cannot open display: :0
I've looked everywhere but cannot find a solution. Also, I cannot open any other visual interface using root, like
gksudo synaptic
, as the same happens. Please help.-
muru about 6 years
-
lucasdelevy about 6 yearsThank you, @muru. I had just solved it by doing "xhost +", then I saw the link you posted, which is more appropriate. I wish I could choose your comment as a correct answer.
-
-
lucasdelevy about 6 yearsThanks for your answer. I did what you said and got the error
(gksudo:16130): Gtk-WARNING **: cannot open display: 1
. When I dols /tmp/.X11-unix
, I get:X0 X1024
. So, even changing DISPLAY=1024 gets me the same error.