Skip to content

X DISPLAY issue with sudo

Gianfranco Costamagna edited this page Mar 23, 2022 · 3 revisions

X issue when ettercap is started with sudo and GTK UI

Introduction

When ettercap is started via sudo trying to launch the GTK graphical user interface, permissions issues accessing the root's $DISPLAY variable potentially occur, depending on the distribution's default security settings.

Symptom

The following shows a typical symptom of the issue:

   $ sudo ettercap -G
   ettercap 0.8.2 copyright 2001-2015 Ettercap Development Team   
   
   No protocol specified
   
   GTK+ failed to initialize. Is X running?

Solution

There is a easy fix to this issue. Run the following command in the user's context.

   $ xhost local:root

If it doesn't work, try with pkexec

   $ ettercap-pkexec -G