Sudoers list?
Peter Garrett
peter.garrett at optusnet.com.au
Tue Apr 4 21:36:35 UTC 2006
On Tue, 04 Apr 2006 21:46:29 +0100
Daniel Carrera <daniel.carrera at zmsl.com> wrote:
> I don't want to force people to run this script as root. Running stuff
> as root is a really bad habit. I want this script to be as non-root
> friendly as possible. There is only one step that *might* warrant root
> access and that's if the destination directory belongs to root.
If you run gksudo and the user is not in the sudoers file ( i.e. not a
meber of admin) I assume it will just fail, which is what you would want
it to do anyway.
You could check if the user is in "admin" though... the output of the
"groups" command woud tell you - for instance
grep 106 /etc/group | grep $USER would return nothing if the user isn't
permitted sudo rights. ( 106 is the "admin" group number )
The default /etc/sudoers in Ubuntu just has
Defaults !lecture,tty_tickets,!fqdn
# User privilege specification
root ALL=(ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
Peter
--
Linux User #343161
More information about the ubuntu-users
mailing list