You are not logged in.
Pages: 1
Hello, im new on this distribution, its awesome and i did install it on a USB.
I want disable sudo access to my user but i want use polkit to gparted etc... but if i disable user in /etc/sudoers polkit asks me user password and not root password.
How can i configure that?
Thanks.
If you don't like the hand that fate's dealt you, fight for a new one.
Offline
if i disable user in /etc/sudoers
Please post the full content of /etc/sudoers
To disable `sudo` for your user, simply remove them from the "sudo" group:
# gpasswd -d $USER sudo
Run the command with root privileges and replace $USER with your actual username.
Offline
I am by no means a polkit expert, but I believe you'd also have to edit the policy files that polkit looks at. For example (as always guys, fact check me here) I believe that in /usr/share/polkit-1/actions you'll find actions that polkit monitors. (like your gparted example). You then have to edit that file to change rather you want the user or not to be allowed to perform it. It's an XML style file iirc with a few different options like "yes" "no" "auth_self" auth_admin" etc....
I *think* that's what you're going to need to change and configure to get it working for you mate.
"I have not failed, I have found 10,000 ways that will not work" -Edison
Offline
Darnit, I was ninja'd. Then HoaS, is most likely correct here.
"I have not failed, I have found 10,000 ways that will not work" -Edison
Offline
Snake wrote:if i disable user in /etc/sudoers
Please post the full content of /etc/sudoers
To disable `sudo` for your user, simply remove them from the "sudo" group:
# gpasswd -d $USER sudo
Run the command with root privileges and replace $USER with your actual username.
Thanks for response.
My full /etc/sudoers is:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
#root ALL=(ALL:ALL) ALL
# Allow members of group sudo to execute any command
#%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
I did comment a few things for disable sudo, i dont like sudo, i want use "su" command but when i launch an app graphically, like gparted into openbox menu, polkit ask me user password and not root password.
Last edited by Snake (2016-11-01 20:23:34)
If you don't like the hand that fate's dealt you, fight for a new one.
Offline
I don't have access to a GNU/Linux box at the moment but this documentation explains the location and syntax of the polkit configuration files:
https://www.freedesktop.org/software/po … kit.8.html
I will post back when I can offer more specific guidance.
Offline
@OP: if you don't like sudo, why not remove it, altogether?
BEWARE: proper way to remove sudo package should be:
1.
$ sudo passwd su # set password for user 'root', which remains
# unset on 'sudo'-based BL setups like BL
2. As an ordinary user, execute
$ su # 'login' yourself as a root, and simultaneously check
# that your 'root' user is accessible
3. Actually remove sudo package
$ sudo apt-get --purge remove sudo
Now you can log in as a 'root' user, and do the stuff.
EDIT: changed advice, to make it more foolproof.
Last edited by iMBeCil (2016-11-01 21:28:30)
Postpone all your duties; if you die, you won't have to do them ..
Offline
Uhh isn't removing sudo a pretty big and glaring security 'no no' ?
I don't have access to a GNU/Linux box at the moment but this documentation explains the location and syntax of the polkit configuration files:
https://www.freedesktop.org/software/po … kit.8.html
I will post back when I can offer more specific guidance.
Sweet! My method would work according that link!
Last edited by Horizon_Brave (2016-11-01 21:23:20)
"I have not failed, I have found 10,000 ways that will not work" -Edison
Offline
^Hm ... I would say quite the opposite. But, properly configured sudo is probably as safe ...
But, you are probably referring to cases where non-skilled (and careless) user uses too much 'root' account (equivalent of logging in as the Administrator on MS Windows). Yes, in this case 'sudo' is probably better solution.
But, I was answering OP's question, and his desire to not to use 'sudo'. Give him some credit
Postpone all your duties; if you die, you won't have to do them ..
Offline
Thanks to all for response.
Finally i did disable sudo with "iMBeCil" method, i did want use polkit with root account, anyway with this is well.
If you don't like the hand that fate's dealt you, fight for a new one.
Offline
I did comment a few things for disable sudo, i dont like sudo, i want use "su" command but when i launch an app graphically, like gparted into openbox menu, polkit ask me user password and not root password.
comment? you mean the sudoers file?
honestly i wouldn't do it.
i also wouldn't uninstall sudo.
removing user from sudo group should be totally sufficient for your demands!!!
about the graphical apps, i guess you are starting them from the menu, and that uses e.g. "pkexec-gparted" which i think will invoke the gksu dialog.
i know that gksu can be configured to use su instead of sudo!
try "gksu-properties".
Offline
Snake wrote:I did comment a few things for disable sudo, i dont like sudo, i want use "su" command but when i launch an app graphically, like gparted into openbox menu, polkit ask me user password and not root password.
comment? you mean the sudoers file?
honestly i wouldn't do it.
i also wouldn't uninstall sudo.
removing user from sudo group should be totally sufficient for your demands!!!about the graphical apps, i guess you are starting them from the menu, and that uses e.g. "pkexec-gparted" which i think will invoke the gksu dialog.
i know that gksu can be configured to use su instead of sudo!
try "gksu-properties".
Thanks you very much!!!
I has configure gksu-properties for use root account and i has delete user from sudo group, works fine now.
If you don't like the hand that fate's dealt you, fight for a new one.
Offline
So...I gotta ask, OP and to anyone really..What's the advantage of doing all of this? If you're just going to trade the idea of using sudo instead with gksu...what benefit does this provide?
"I have not failed, I have found 10,000 ways that will not work" -Edison
Offline
So...I gotta ask, ...what benefit does this provide?
The ability to switch distros in a dual-boot setup without having to retrain yourself into different habits according to which wallpaper is showing, and not much else besides the learning experience.
Blessed is he who expecteth nothing, for he shall not be disappointed...
If there's an obscure or silly way to break it, but you don't know what.. Just ask me
Offline
Pages: 1