Archives For open as administrator

Want to open folder or edit file as administrator (aka root in Linux)? Here’s how to do the trick by adding menu option in Ubuntu 22.04 file manager.

The ‘Files’ (aka nautilus) has an extension called nautilus-admin to do administrative operations. With it, you may right-click on folder and select “Open as Administrator“, or right-click on file and select “Edit as Administrator“.

Don’t like MS Windows, it however does not support running an app as root.

1. Open Terminal

Firstly, open terminal either by pressing Ctrl+Alt+T key combination on keyboard, or by searching from the ‘Activities’ overview screen.

2. Install nautilus-admin

When the terminal opens, paste the command below into it and hit Enter.

sudo apt install nautilus-admin

Type user password (no asterisk feedback) for sudo authentication and hit Enter to continue.

3. Apply change

Once installed the extension, you need to restart the file manager to apply change.

Not just close and re-open the file manager window, but you need to run command to quit the background service and let it start again automatically:

nautilus -q

That’s all. Enjoy!

gnome shell

This simple tutorial shows how to add ‘Open as Administrator‘ option to file browser right-click menu in Ubuntu 20.04 LTS.

Need to open or edit files with Administrator (root) user privilege directly from file browser in Ubuntu desktop? There’s an extension nautilus-admin can do the job in the default Gnome desktop.

1. Open terminal by either pressing Ctrl+Alt+T on keyboard or searching for ‘terminal’ from application menu.

2. When terminal opens, run command to install the extension:

sudo apt install nautilus-admin

You may replace nautilus-admin with caja-admin or peony-admin if you’re running with MATE or UKUI desktop.

Once installed, run command nautilus -q or log out and back in to apply changes.

Note the extension only adds Administrator privilege to open folders or edit files. There’s no ‘Run as Administrator’ option to run program as super user privilege.

gnome shell

This tutorial shows beginners how to add ‘Open as Administrator’ option in Nautilus file browser context menu (right-click menu) in Ubuntu 19.10.

Want to open a file folder and/or edit a file via root user account? Without running Linux command, you can do this by adding ‘Open as Administrator‘ or ‘Edit as Administrator‘ right-click menu option via nautilus-admin extension.

1.) The nautilus-admin package is available in Ubuntu universe repository. Simply open terminal either from application menu or by pressing Ctrl+Alt+T on keyboard.

When terminal opens, run command to install it:

sudo apt install nautilus-admin

Type user password (no asterisk feedback) for sudo prompt and hit Enter.

2.) Once installed the extension, restart Nautilus file browser via command:

nautilus -q

Next time you open the file browser, you’ll see ‘Open as Administrator‘ context menu option for file folders, and ‘Edit as Administrator‘ option for documents.

That’s it. Enjoy!

Enable “Open as Admin” in Nautilus File Browser

Last updated: February 15, 2018

gnome shell

It’s been a long time last time I wrote about how to enable “Open as root” or “Open as Administrator” in Nautilus’ context menu.

A Nautilus extension called Nautilus Admin has been created for a period of time. It’s a simply Python script that adds some administrative actions to the right-click menu:

  • Open as Administrator: opens a folder in a new Nautilus window running with administrator (root) privileges.
  • Edit as Administrator: opens a file in a Gedit window running with administrator (root) privileges.

To install the Nautilus extension:

The extension is available for all current Ubuntu releases: Ubuntu 14.04, Ubuntu 16.04, Ubuntu 17.10, and Ubuntu 18.04.

1. Simply open “Terminal” either via Ctrl+Alt+T or from app launcher. Then run command:

sudo apt-get install nautilus-admin

Input your password (no visual feedback while typing) when it prompts and hit Enter.

2. Then restart Nautilus via command:

nautilus -q

That’s it. Open nautilus file browser again and enjoy with new context menu options!

ubuntu 14.04 context menu

 

This simple tutorial will show you how to add ‘Open As Root’ or ‘Open As Administrator’ option to context menu so that you can easily edit / open file folders as super user privilege within Nautilus file browser.

Open as Administrator ubuntu 14.04

There’s now a Nautilus extension (see the link) adds administrative actions to Nautilus context menu. It’s easy to install and supports for all current Ubuntu releases.

To get started:

1. Open Ubuntu Software Center. Search for and make sure the package gksu is installed. gksu allows graphical programs to ask a user’s password to run program as root / administrator.

gksu ubuntu 14.04

2. Open Nautilus file browser, press Ctrl+H to view hidden files & folders. Navigate to USER Home -> .local -> share -> nautilus -> scripts.

Create an empty document under this directory named ‘open-as-administrator’ or ‘open-as-root’

open as administtrator ubuntu 14.04

3. Edit and paste following lines into the file

#!/bin/bash
#
# this code will determine exactly the path and the type of object,
# then it will decide use gedit or nautilus to open it by ROOT permission
#
# Determine the path
if [ -e -n $1 ]; then
obj="$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
else
base="`echo $NAUTILUS_SCRIPT_CURRENT_URI | cut -d'/' -f3- | sed 's/%20/ /g'`"
obj="$base/${1##*/}"
fi
# Determine the type and run as ROOT
if [ -f "$obj" ]; then
gksu gedit "$obj"
elif [ -d "$obj" ]; then
gksu nautilus "$obj"
fi

exit 0

4. Press Ctrl+Alt+T to open the terminal. When it opens, run the command below to make executable:

cd .local/share/nautilus/scripts/ && chmod 0755 open-as-administrator

5. Finally restart Nautilus via command nautilus -q, or just log out and back in.