This tip will show you how to add an “Edit as Administrator” item to the “right-click” menu in Ubuntu’s file manager.
Rather than having to open a terminal and type out a command just to edit a file, why not create a quick shortcut to skip those steps? Here’s how!
- Start out by launching the Ubuntu Software Centre from your Dock.
- Search for the phrase nautilus-admin
- In the search results section locate the “Extension for Nautilus to do administrative operations” item and click the Install button.
- Enter your password then click the Authenticate button.
- The nautilus-admin utility will now install. Once completed, you’ll be prompted to restart your File Manager. Click the Restart File Manager button to do just that.
- Now open your File Manager. Locate a text file that would typically require administrative privileges to edit (your hosts file, a server config file). “Right-click” that file and in the ‘options’ list now you’ll see a new item, Edit as Administrator. Select it.
- A stern warning screen will pop up. Remember: be very careful when editing a file that requires administrative privileges to do so. That file requires those privileges for a reason: if it’s incorrectly altered, something is going to break. Always be careful when editing these files. Click OK
- Now enter your password and click the Authenticate button.
- Ta-da! gedit will open and you can now edit/make changes to the file and be able to save it (overwriting the previous ‘version’, which again, can be dangerous if there are any ‘mistakes’ in that file).