X11: Invalid MIT-MAGIC-COOKIE-1 keyError: Can't open display: :0 on Ubuntu 16.04
I fixed the problem. I added passwords to students with sudo passwd username
After that, I tried to get into user environment by using ssh username@ip
, then I did who
and saw the :0
or :1
as a display number. I used export DISPLAY=:0
or :1
then I ran xeyes
command and HEYYYYYYY, IT WORKED! (Pardon my excitement)
I used this website.
It gave me a hint about what to do next.
Related videos on Youtube
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on September 18, 2022Comments
-
Admin almost 2 years
I want to open GUI applications (xeyes, firefox, xlock etc) on remote computer by using SSH from Local computer to connect to remote computer. Local PC--> SSH to --> Remote PC I have two computers. I use one computer that I like the most. Let's call it "main" or "local". Second computer is just a doll for me, lab to test my experiments on. Let's call it "guinea pig" or "remote".
I have a problem, that has been with me for so long. I don't know how to fix it. Example:
ssh -p 22 IP address xclock (shows clock on local PC [main]) who student102 tty7 2019-02-13 10:54 (:0) admin pts/2 2019-02-13 13:23 (IP address) export DISPLAY=:0 xclock (Error: Invalid MIT-MAGIC-COOKIE-1 keyError: Can't open display: :0
I have tried ssh -Y and ssh -X and same result. Same error. What should I do? Reinstall Ubuntu? Reinstall SSH and Xorg? How can I fix this error?
-
steeldriver over 5 yearsIt looks like you are SSHing as user
admin
- but trying to runxclock
on a display owned by userstudent102
? -
Admin over 5 yearsYeah. I figured that export DISPLAY=:0 or whatever student102 uses works but I get this error.
-
-
Gringo Suave almost 4 yearsI had to login first as the user at the graphics station tty7 with
sudo su - username
, then it worked.