In both Fedora and PCLinuxOS Debian edition which I have installed recently it seems I need to add the only user to sudoers list to perform certain actions.

How to do this?

  • Cyborganism
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 days ago

    Hello,

    Normally this is done by default during installation. As far as Ubuntu does it, this is what a basic sudoers file should look like if you have only a single user:

    Defaults        env_reset
    Defaults        mail_badpass
    Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    
    # This fixes CVE-2005-4890 and possibly breaks some versions of kdesu
    Defaults        use_pty
    
    # User privilege specification
    root    ALL=(ALL:ALL) ALL
    
    # Members of the admin group may gain root privileges
    %admin ALL=(ALL) ALL
    
    # Allow members of group sudo to execute any command
    %sudo   ALL=(ALL:ALL) ALL
    
    @includedir /etc/sudoers.d
    

    And then in the /etc/sudoers.d/kdesu-sudoers file (optional if you don’t have KDE Plasma desktop)

    Defaults!/usr/lib/*/libexec/kf5/kdesu_stub !use_pty

    Then in your /etc/group file:

    sudo:x:27:<your user name here>

    The Sudoers file is pretty distro agnostic so you should be fine.