TranslateProject/sources/tech/20200415 How to Open Files and Folders as Administrator in Nautilus File Manager in Linux.md
2020-04-15 08:56:05 +08:00

4.0 KiB
Raw Blame History

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 dont 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.

Recommended Read:

Root User in Ubuntu: Important Things You Should Know

Root user is essential to any Linux distribution. Learn why Ubuntu locks the root user and how can you use it in this Ubuntu beginner series.

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

A word of warning! Please dont 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 distributions package manager.

Youll have to use terminal (even if you dont 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.

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

In both cases, youll be prompted to enter your accounts password:

You need to enter your password, of course

Thats pretty much it. You can enjoy the comfort of GUI.

In case you dont want to run Nautilus as root anymore, you can remove this plugin. Its always good to remove additional things you installed but you dont 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.


via: https://itsfoss.com/open-nautilus-as-administrator/

作者:Abhishek Prakash 选题:lujun9972 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出