How to Open Files and Folders as Administrator in Nautilus File Manager in Linux

Learn to add an “Open as Administrator” option in the right click context menu in Nautilus file manager in Ubuntu and other Linux distributions.
Warp Terminal

If you want to open or edit a file as root, you can always do that in the terminal. I know a few people don’t feel too comfortable with the command line.

The desktop Linux often provides ways to avoid the command line for terminal-fearing people.

If you are in a situation where you have to access a folder as root or edit a file with root privilege, you can do that graphically in Nautilus file manager.

A neat Nautilus hack allows you to open files and folders as administrator, i.e. root. Let me show you how.

Add ‘open as administrator’ option in right click context menu in Nautilus file manager

Please don’t open and edit random files as root as you might mess up with the wrong files and end up with a broken system. Use it only in cases where it is required.

I am showing the installation steps for Ubuntu. You can change it as per your distribution’s package manager.

You’ll have to use terminal (even if you don’t like it) for installing the Nautilus plugin. Please make sure that you have the universe repository enabled:

sudo apt install nautilus-admin

Close and open the Nautilus file manager again to see the changes in effect.

Open Folder As Administrator Ubuntu
Right click to see the “Open as Administrator” option

You can also edit files as root the same way. Just select the file, right click on it and choose the “Edit as Administrator” option.

Edit Files As Root Ubuntu
Edit Files As Root Ubuntu

In both cases, you’ll be prompted to enter your account’s password:

Authentication Pop Up Ubuntu
You need to enter your password, of course

That’s pretty much it. You can enjoy the comfort of GUI.

In case you don’t want to run Nautilus as root anymore, you can remove this plugin. It’s always good to remove additional things you installed but you don’t use anymore.

In the terminal (yes, again), use the following command to remove the Nautilus plugin.

sudo apt remove nautilus-admin

By the way, if you are using Ubuntu MATE, you can use caja-admin, instead of nautilus-admin. Other file managers may or may not provide such a feature.

More Nautilus tweaks

You can explore more such uncommon, hidden features of Nautilus in this article.

13 Ways to Tweak Nautilus File Manager in Linux
Nautilus, aka GNOME Files, is a good file manager with plenty of features. You can further enhance your experience by using these extensions, tweaks and tips.

I hope you find this quick tip helpful. Questions and suggestions are always welcome.

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries 🕵️‍♂️


Making You a Better Linux User


Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.