Adding Open As Root to your right click (Ubuntu-Mint)

Discussion in 'GNU/Linux' started by melbo, Sep 25, 2010.


  1. melbo

    melbo Hunter Gatherer Administrator Founding Member

    It's slightly frustrating (especially for new users), to discover that you can't always edit a file in the filesystem through the GUI because it requires admin privileges. I do most of my opening and editing through the Terminal but every once in awhile I just want a quick cut and paste.

    I started using this trick a few years ago and it works on all Debian based distros: Ubuntu, Mint, Etc. I originally found it at Boot and run Linux from a USB flash memory stick | USB Pen Drive Linux

    From Terminal, type
    Code:
    sudo su
    Enter your password

    Then enter:
    Code:
    gedit .gnome2/nautilus-scripts/Open\ as\ root
    A blank document will open. Enter the following 3 lines, click save and close the document:

    Code:
    for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
    
    gksudo "gnome-open $uri" &
    
    done
    Type this into the terminal window:
    Code:
    sudo chmod +x .gnome2/nautilus-scripts/Open\ as\ root
    Next time you want to open a file as root, right click>scripts>Open As Root

    System restart may be necessary to get the right click.
     
survivalmonkey SSL seal        survivalmonkey.com warrant canary
17282WuJHksJ9798f34razfKbPATqTq9E7