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

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Pingback: How to write a FreeBSD Kernel Module | Rhyous

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