polkit and admin: They work with xed and Nemo

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
pgmer6809
Level 4
Level 4
Posts: 228
Joined: Sun Mar 04, 2012 9:06 pm

polkit and admin: They work with xed and Nemo

Post by pgmer6809 »

In a recent post (I cant find it; might have been on Ubuntu forums) someone mentioned that you can type admin://etc/default into the navigation bar in Nautilus and have it open that directory with elevated privileges if you enter the correct password.
They speculated that this might work for Mint developed software also.
I can confirm that this does indeed work for Nemo. In fact as soon as you enter admin:///e The auto complete function kicks in and it expands to admin:///etc and the password dialog box opens. You then enter your admin password and continue on to whatever subdir of /etc you want (default, samba etc.)
From there you can right click on a file and open it for editing with xed (the Mint editor) or gedit and likely also geany etc.

This admin:/// (note the THREE slashes with no spaces between them) trick will work also for files directories that are marked as 'locked' by Nemo, say /home/lost+found.

It also works a bit like sudo in that once you have authenticated you can go to various other 'protected' directories and it will not ask you for your password again. (I assume there is a timeout limit for this.)

The admin:/// trick also works on the command line. So you can say

Code: Select all

 xed admin:///etc/samba/smb.conf
and it will bring up the password dialog, and let you edit the file. Again the elevated privileges are valid for a certain length of time, so after editing smb.conf say, you can issue

Code: Select all

xed admin:///etc/hosts
and make some changes, with no prompt for a password. Note that you still need to open the file as admin:///etc/hosts, just doing

Code: Select all

xed /etc/hosts
will bring up the editor but you will not be able to save changes.
pgmer6809
Post Reply

Return to “Tutorials”