Sudo for first user

Rahul Sundaram sundaram at fedoraproject.org
Sat Oct 4 16:14:06 UTC 2008


Hi

You can add the following snippet to the fedora-desktop ks file into a 
init script to make sudo just work for the first user. It can't be added 
to %post since firstboot wouldn't have launched then. Let me know what 
you think:

-----------------

# check for the first user and add it to user wheel and then to sudoers

USER=$( grep 500 /etc/passwd | cut -d: -f1 )
GROUPS=$( groups $USER )
if ! groups $USER | grep -q wheel ; then
        usermod -a -G wheel $USER
        sed -i 's/# %wheel    ALL=(ALL)    ALL/ %wheel    ALL=(ALL)    
ALL/' /etc/sudoers
fi


EOF
------------

Rahul




More information about the Fedora-desktop-list mailing list