1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Discuss in my forum

Open files with administrative privileges from the file manager

Ubuntu Documentation

By

To enable support for opening files with administrative privileges from the file manager, you need to add a Nautilus script:

Warning: Please note that opening files with administrative privileges constitutes a security risk. Always ensure that you are familiar with the file that you are opening.

  • Open a new file to edit in the relevant directory:

    gedit $HOME/.gnome2/nautilus-scripts/Open\ as\ Administrator

  • Insert the following lines into the new file:

    for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do gksudo "gnome-open $uri" & done
  • Save the edited file (an example)

  • Make the edited file executable:

    chmod +x $HOME/.gnome2/nautilus-scripts/Open\ as\ Administrator

  • You can now open files as root by right clicking on the file and selecting Scripts->Open as Administrator

* License

* Ubuntu Desktop Guide Index

  1. About.com
  2. Technology
  3. Linux
  4. Linux Distributions
  5. Popular Linux Distros
  6. Ubuntu
  7. Ubuntu Documentation
  8. Ubuntu Desktop Guide - Open files with administrative privileges from the file manager

©2014 About.com. All rights reserved.