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.

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 a files and folders as administrator i.e. root. Let me show you how.

.ugb-4186990-wrapper.ugb-container__wrapper{border-radius:0px !important;padding-top:0 !important;padding-bottom:0 !important;background-color:#f1f1f1 !important}.ugb-4186990-wrapper > .ugb-container__side{padding-top:35px !important;padding-bottom:35px !important}.ugb-4186990-wrapper.ugb-container__wrapper:before{background-color:#f1f1f1 !important}.ugb-4186990-content-wrapper > h1,.ugb-4186990-content-wrapper > h2,.ugb-4186990-content-wrapper > h3,.ugb-4186990-content-wrapper > h4,.ugb-4186990-content-wrapper > h5,.ugb-4186990-content-wrapper > h6{color:#222222}.ugb-4186990-content-wrapper > p,.ugb-4186990-content-wrapper > ol li,.ugb-4186990-content-wrapper > ul li{color:#222222}

Recommended Read:

.ugb-c9ad6c7 .ugb-blog-posts__featured-image{border-radius:0px !important}.ugb-c9ad6c7 .ugb-blog-posts__title a{color:#000000 !important}.ugb-c9ad6c7 .ugb-blog-posts__title a:hover{color:#00b6ba !important}

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

A word of warning! Please don’t go around opening and editing random files as root as you might mess up with wrong files and end up with a broken system. Use it only in the 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 Nautilus file manager again to see the changes in effect.

Open Folder As Administrator Ubuntu
Right clock 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.

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



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.