How to open files as root via a right click
The following tutorial explains how to 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's 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.
Adding a contextual menu to right click open files as root:
- 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.
Note: You may need to logoff and then login to see the changes!
Right Click Open as (Root) Administrator
You also have the option to Edit Files as Administrator using a right click.
How to open files as root via a right click published under Using and Configuring Linux