Configuring sudo on FreeBSD 8.1 and allowing sudo to open GUI applications

The goal is to install sudo and configure it in a way that allows GUI apps to run.

Without proper configuration the following error occurs when trying to run GUI apps:

No protocol specified
No protocol specified
Error: cannot open display: :0.0

To cofigure sudo, follow these steps below.

  1. Install sudo.
    cd /usr/ports/security/sudo
    make install
  2. Configure sudo be editing the /usr/local/etc/sudoers file.
    ee /usr/local/etc/sudoers
  3. Make the following configuration changes.  The first ones make sudo work with GUI apps.
    Defaults env_keep += “HOME”
    Defaults env_keep += “QTDIR KDEDIR”
    Defaults env_keep += “XDG_SESSION_COOKIE”
    root ALL=(ALL) ALL
    %wheel ALL=(ALL) ALL


  1. [...] the module. This must be done as root. If you have sudo installed, use it, otherwise install it (Configuring sudo on FreeBSD) or su to [...]

  2. Rhyous » Blog Archive » Configuring sudo on FreeBSD 8.1 and … | unixsecure test says:

    [...] original here: Rhyous » Blog Archive » Configuring sudo on FreeBSD 8.1 and … This entry was posted in Uncategorized and tagged allowing-sudo, gui, install-sudo, [...]

Leave a Reply

How to post code in comments?