I want to give mount privilege to the non-admin users to mount the drives via nautilus. I don't want them to give other admin privilege. I also don't want to use setuid method.
How can I achieve this? I'm using Ubuntu 12.04.
I want to give mount privilege to the non-admin users to mount the drives via nautilus. I don't want them to give other admin privilege. I also don't want to use setuid method.
How can I achieve this? I'm using Ubuntu 12.04.
I solved this problem by changing the default policy. There are three ways to achieve this:
By giving privilege to a group
First create a group
mounter
by using this command:Then add the non-admin users to this group. For examle, I'm adding non-admin user
normal
to this group.Then open the policy file with admin privilege.
At the top of the file there is a section like this:
Add
unix-group:mounter;
afterIdentity=unix-group:admin;unix-group:sudo;
at the first line of the section. The changed section will look like thisThat's it. Now the non-admin users can mount the drives without requiring admin-password. They only need to be added to the
mounter
group. Note to add a usernovice
to the groupmounter
, execute this command:sudo adduser novice mounter
.By giving privilege to specific user
If you don't want to create another group, you can just add their user name (login name) in that file.
Open the policy file with admin privilege. You can type this command in a terminal or in the dash prompt by Pressing Alt-F2.
Then add
unix-user:<login-name>
at theIdentity
line in the section[Mounting, checking, etc. of internal drives]
. Remember to use the login name of the user, not the literal .. For example, if you want to give usertester
this privilege, the line will be look like belowSave the file and exit gedit.
By giving privilege to all users
The above two methods will not work for the default guess user in Ubuntu. Because, the guest user is created dynamically upon login and get deleted after logout.
To workaround this, You can give all users this privilege.
Open the policy file with admin privilege. You can type this command in a terminal or in the dash prompt by Pressing Alt-F2.
Then add
unix-user:*
at theIdentity
line in the section[Mounting, checking, etc. of internal drives]
. After modification the section will look like below:Save the file and exit gedit.
UPDATES