How to easily add a context menu item that enables a Linux user to open files as the root user or administrator when browsing their file system using nautilus. This feature allows the user to navigate their file system and open or edit any file or directory as the root user or admin of the system. It is a perfect solution for those that are not completely comfortable using terminal commands.
Note: This tutorial assumes your using a Debian based system and will be utilizing nautilus. Systems such as Ubuntu or another Debian based derivative should work. An Ubuntu Live CD was used for this tutorial. In addition, if your attempting this on a Full Blown Debian installation, you will first need to make sure your user has been added to the sudoers list.
Add a menu to Right Click Open Files as Root
How to easily add a contextual menu item that enables you to Open files as Administrator with a simple right click selection.
- Open the Terminal
- Type sudo su and press enter.
- Provide your password and press enter
- Then type apt-get install -y nautilus-admin and press enter
- Now type nautilus -q and press enter
- Finally type exit and press enter, and close the terminal window
All set. Now when you want to open a file as root, simply right click the folder and select Open as Administrator.
Pro Tip: You may need to logoff and then log back in to see the changes!
Right Click Open Files as Root Administrator
You also have the option to Edit Files as Administrator using a right click.