User avatar
Posts: 7
Joined: Fri Jan 18, 2013 1:45 pm
Location: UK, Kent
Contact: Website

Client is not authorized to connect to...

Sun Jan 20, 2013 12:55 am

After happily setting up my Pi with VNC working fully, I just installed lighttpd and its essentials, however now when trying to execute a program with sudo, such as leafpad to edit the HTML files, it says "Client is not authorized to connect to Serverleafpad: Cannot open display:", yet without sudo it works fine.

Is this due to something I've installed that's conflicting with it or because I'm on a different desktop session (using VNC) instead of the pi's session?

I'm looking at this right now: ... op-as-root and due to my lack of knowledge in Linux it pretty much goes over my head.

Hope someone can help!

Posts: 1
Joined: Mon Dec 16, 2013 8:43 pm

Re: Client is not authorized to connect to...

Wed May 28, 2014 1:38 pm

Well, I don't have an answer as much as a workaround. I actually came here with the same issue. :) Funny that it seems to be Leafpad causing the problem, as it is (so far) the only one complaining.

Anyhow, if you go to the Menu, go to Accessories | Root Terminal, it will open up a terminal as root, which will run Leafpad.

Posts: 1
Joined: Sat Oct 03, 2015 3:33 am

Re: Client is not authorized to connect to...

Sat Oct 03, 2015 3:38 am


I know it has been a while and no one seemed to have an answer for this issue. After some quick searches on google, I found this website that describes a similar problem: ... -from.html

The bottom line is that the error can be generated because you are using a remote connection while trying to execute a root command. Try using "gksudo". (It worked for me)

Posts: 1
Joined: Thu Jun 02, 2016 7:02 pm

Re: Client is not authorized to connect to...

Thu Jun 02, 2016 7:09 pm

I had the same problem and I was able to find the solution very fast.
"gksudo" workes for me, too.

Posts: 1
Joined: Sat Dec 31, 2016 2:04 am

Re: Client is not authorized to connect to...

Sat Dec 31, 2016 2:20 am

hey, gksudo don't work for me ,but i guess it's about vncserver.
So i stop vncserver an restart it by root,it works!! Maybe it's help to you.

Return to “Troubleshooting”