Ask Your Question

sudo graphical applications

asked 2018-01-27 01:51:56 -0500

alfC gravatar image

updated 2018-01-28 06:36:18 -0500

I am pretty sure that used to be possible to execute graphical application by sudo. However, in Fedora 27, when I try to do this I get an error:

$ sudo gedit
[sudo] password for user: 
No protocol specified
Unable to init server: Could not connect: Connection refused

(gedit:10151): Gtk-WARNING **: cannot open display: :0

How can I allow that? is it a limitations of Wayland?

Summary of accepted answer:

$ xhost +
access control disabled, clients can connect from any host
$ sudo gedit
edit retag flag offensive close merge delete



It's a design decision in wayland for security reasons. AFAIK a common framework for granting wayland clients root priviledges in a safe way is under development.

fcomida gravatar imagefcomida ( 2018-01-27 10:21:57 -0500 )edit

For gedit in particular I found this:

alfC gravatar imagealfC ( 2018-01-28 03:21:43 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-01-27 11:28:41 -0500

demahom03 gravatar image

before running the graphical application, you should run xhost +

edit flag offensive delete link more


with sudo? before sudo? in a sudo su session`? no combination worked.

alfC gravatar imagealfC ( 2018-01-27 13:51:26 -0500 )edit

That works on X not Wayland.

fcomida gravatar imagefcomida ( 2018-01-28 05:31:27 -0500 )edit

it worked for me (i'm on wayland), and without a sudo

demahom03 gravatar imagedemahom03 ( 2018-01-28 05:43:27 -0500 )edit

You are right, it works.

alfC gravatar imagealfC ( 2018-01-28 06:36:55 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-01-27 01:51:56 -0500

Seen: 754 times

Last updated: Jan 28 '18