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:

  1. Open the Terminal
    Opening a Terminal
  2. Type sudo su and press enter.
  3. Provide your password and press enter
  4. Then type apt-get install -y nautilus-admin and press enter
  5. Now type nautilus -q and press enter
  6. 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

 

Right Click Open as Root (Administrator)

You also have the option to Edit Files as Administrator using a right click.

Right Click Edit File as Admin

How to open files as root via a right click published under Using and Configuring Linux 

Disclaimer