You are not logged in.
My /etc/sudoers file
I am trying to use sudo command without entering password, so I changed the sudoers file
by typing 'sudo EDITOR=vim visudo' than uncommented wheel group.Also added my user
to wheel group but when I use sudo command it is still requiring me for a password, need help here.
## sudoers file.
##
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
##
## See the sudoers man page for the details on how to write a sudoers file.
##
##
## Host alias specification
##
## Groups of machines. These may include host names (optionally with wildcards),
## IP addresses, network numbers or netgroups.
# Host_Alias WEBSERVERS = www1, www2, www3
##
## User alias specification
##
## Groups of users. These may consist of user names, uids, Unix groups,
## or netgroups.
# User_Alias ADMINS = millert, dowdy, mikef
##
## Cmnd alias specification
##
## Groups of commands. Often used to group related commands together.
# Cmnd_Alias PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
# /usr/bin/pkill, /usr/bin/top
# Cmnd_Alias REBOOT = /sbin/halt, /sbin/reboot, /sbin/poweroff
##
## Defaults specification
##
## You may wish to keep some of the following environment variables
## when running commands via sudo.
##
## Locale settings
# Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
##
## Run X applications through sudo; HOME is used to find the
## .Xauthority file. Note that other programs use HOME to find
## configuration files and this may lead to privilege escalation!
# Defaults env_keep += "HOME"
##
## X11 resource path settings
# Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
##
## Desktop path settings
# Defaults env_keep += "QTDIR KDEDIR"
##
## Allow sudo-run commands to inherit the callers' ConsoleKit session
# Defaults env_keep += "XDG_SESSION_COOKIE"
##
## Uncomment to enable special input methods. Care should be taken as
## this may allow users to subvert the command being run via sudo.
# Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
##
## Uncomment to use a hard-coded PATH instead of the user's to find commands
# Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
##
## Uncomment to send mail if the user does not enter the correct password.
# Defaults mail_badpass
##
## Uncomment to enable logging of a command's output, except for
## sudoreplay and reboot. Use sudoreplay to play back logged sessions.
# Defaults log_output
# Defaults!/usr/bin/sudoreplay !log_output
# Defaults!/usr/local/bin/sudoreplay !log_output
# Defaults!REBOOT !log_output
##
## Runas alias specification
##
##
## User privilege specification
##
root ALL=(ALL) ALL
## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL
## Same thing without a password
%wheel ALL=(ALL) NOPASSWD: ALL
## Uncomment to allow members of group sudo to execute any command
# %sudo ALL=(ALL) ALL
## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw # Ask for the password of the target user
# ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw'
## Read drop-in files from /etc/sudoers.d
@includedir /etc/sudoers.dMy user's groups.
[burak@thinkpad] <~> ➤ id
uid=1000(burak) gid=984(users) groups=984(users),150(wireshark),998(wheel),1000(sudo)Last edited by Krygen (2021-09-15 22:32:04)
Offline
Have you logged out after adding yourself to wheel?
Also, would be nice if you wrap your code within
[code]...[/code] ![]()
Last edited by Gregosky (2021-09-12 22:58:29)
Offline
Yes, I also rebooted my system couple of times
Offline
Do you have anything in /etc/sudoers.d ?
Eenie meenie, chili beanie, the spirits are about to speak -- Bullwinkle J. Moose
It's a big club...and you ain't in it -- George Carlin
Registered Linux user #149839
perl -e 'print$i=pack(c5,(41*2),sqrt(7056),(unpack(c,H)-2),oct(115),10); '
Offline
[burak@thinkpad] <~> ➤ sudo tree /etc/sudoers.d
/etc/sudoers.d
|-- aurbuilder
|-- burak
`-- ctdb
0 directories, 3 filesOffline
sudo -llAlso please post the exact command and output that requires you to enter credentials.
Online
Offline
[burak@thinkpad] <~> ➤ sudo -ll
Runas and Command-specific defaults for burak:
Defaults!/etc/ctdb/statd-callout !requiretty
User burak may run the following commands on thinkpad:
Sudoers entry:
RunAsUsers: ALL
Options: !authenticate
Commands:
ALL
Sudoers entry:
RunAsUsers: ALL
Commands:
ALLLast edited by Krygen (2021-09-14 05:36:09)
Offline
* did not work for some reason.However etc sudoer.d includes 3 files.
[burak@thinkpad] <~> ➤ sudo cat /etc/sudoers.d/burak
burak ALL=(ALL) ALL
[burak@thinkpad] <~> ➤ sudo cat /etc/sudoers.d/ctdb
Defaults!/etc/ctdb/statd-callout !requiretty
rpcuser ALL=(ALL) NOPASSWD: /etc/ctdb/statd-callout
[burak@thinkpad] <~> ➤ sudo cat /etc/sudoers.d/aurbuilder
aurbuilder ALL=(ALL) NOPASSWD: ALL
root ALL=(aurbuilder) NOPASSWD: ALL
[burak@thinkpad] <~> ➤ Offline
I have manually edited the
/etc/sudoers.d/burakfile, from this->
burak ALL=(ALL) ALLto this ->
burak ALL=(ALL) NOPASSWD: ALL.
Now it is working, I can run sudo commands without password.
However I still can not get it, why editing sudoers file did not work both for
%wheel ALL=(ALL) NOPASSWD: ALL, and
burak ALL=(ALL) NOPASSWD: ALLin the first place, because it is the right and conventional way to do it
Last edited by Krygen (2021-09-14 05:48:41)
Offline
"later" matches override earlier definitions, that file/directory is by default included last, so of these three rules the last one is what ultimately defined your rights.
Last edited by V1del (2021-09-14 06:18:17)
Offline
Remove /etc/sudoers.d/burak - the user trumps the group.
Edit: fuck.
Last edited by seth (2021-09-14 06:17:17)
Online
Thank you everyone, now how can I lock the thread ![]()
Offline
Mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Online
Could not find it
Offline
There is an Edit button at the bottom right of your post. Editing the first post will allow you to change the title.
Offline