Linux open file browser as root

How to open File Manager as Administrator in Ubuntu Linux

This post describes the steps to open File Manager (nautilus) as an administrator in Ubuntu Linux.

When you log in to Ubuntu Linux, you’re logged in as a normal user who can use root or administrative privileges to perform administrative tasks using the sudo command.

Once you are in as a normal user, it’s challenging to open File Manager or nautilus with root privileges. A tool called nautilus-admin used to work, but it does not anymore.

That tool claims to open files and folders as administrator from the context menu once installed. I tried, and it didn’t work as well. It will install, alright, but it will not allow me to delete files that the root user owns.

It’s sometimes nice to have the ability to edit files and open folders as root or administrator. Below I will show you how to do that.

This post assumes that you are a member of the sudoers file or can run the sudo command.

Without you being able to run the sudo command, the steps below will not work.

To run File Manager as root, press the keyboard shortcut Ctrl — Alt — T to open the terminal console.

Once the terminal is open, run the commands below to launch the file manager as an administrator.

It will prompt you to type your password, and if you have the right to run the command, it will open the file manager (nautilus) as administrator or root.

You cannot browse any folder and delete it as long as it’s not used by a process or another user.

This post showed you how to open the file manager as an administrator in Ubuntu Linux. Please use the comment form below if you find any errors above or have something to add.

Richard W

I love computers; maybe way too much. What I learned I try to share at geekrewind.com.

Источник

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

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.

Читайте также:  Linux starting network manager

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

Open Folder As Administrator Ubuntu

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, you’ll be prompted to enter your account’s password:

Authentication Pop Up Ubuntu

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.

Источник

How to open Ubuntu file manager as root user

By default, the File Manager in Ubuntu or in any other Linux distro uses a non-root user. I mean a user that doesn’t have Administrative rights can access them graphically. It improves overall system security. However, if you want to run File manager as the root user or want to open & edit files and folder with administrative rights that are possible as well. However, you have to use the command terminal to enable that. The following tutorial carried out on Ubuntu 20.04 LTS focal fossa. However, the steps will be the same for earlier versions such as Ubuntu 19.10/19.04; 18.10/18.04 including Debian, Linux Mint, or any similar OS running Nautilus File manager.

Open Ubuntu Nautilus File Manager as root

Open command terminal in Ubuntu -min

  1. Open command terminal either from Applications or using keyboard shortcut- Ctrl+Alt+T.

  2. Run Nautilus file manager with sudo. Here is the syntax:
  • It will ask for your current non-root user’s password that is present in the sudo group.
    Run Nautilus as root-min
  • Ubuntu File manager will open under administrative rights. Now you can navigate to any folder and files that can only be accessed by the root user via the graphical user interface.Using File Manager as administrative -min
  • Edit or Open Ubuntu Files and Folders as root Administrative

    If you want to edit any file or open folder as root user directly from the Nautilus file manager’s graphical user interface. Then, we can embed an option “Edit as Administrator” or “Open as Administrator” privileges in its contextual menu.

    1. Again open command terminal, if you already have not.
    2. Install the Nautilus Admin package.
    sudo apt install nautilus-admin
  • Type exit and hit the Enter key to close the Terminal window.Install Nautilus Admin to access file manager as root-min
  • Now, to edit any file as the root user, open file manager, or right-click on that particular wherever it resides. And select the option “Edit as Administrator”.Edit File as root in Ubuntu Nautilus File manager-min
  • To open folders as root, same just like above right click on that and select “Open as Administrator’.Open Folder as root in Ubuntu file manager-min
  • Warning: Running File Manager as Admin

    Although, the above tutorial is useful in case you are not a well-experienced command terminal user, however, be cautious. Make sure you wouldn’t alter or edit some core configuration files that could leave your Ubuntu unstable or un-bootable.

    Источник

    Enable ‘Open as Administrator’ in Ubuntu 22.04 & 23.04 without Gedit

    Want to enable ‘Open as Administrator’ (aka ‘Open as Root’) in your file browser context menu? Here’s the beginner’s guide shows you how with a quick fix for Ubuntu 22.04, and Ubuntu 23.04 via default Gnome Text Editor.

    The tutorial will work on:

    This tutorial will work on all current Ubuntu releases, including Ubuntu 18.04, Ubuntu 20.04, Ubuntu 22.04 and Ubuntu 23.04. And it’s for the default Nautilus file browser.

    1.) Install nautilus-admin extension:

    Ubuntu comes with the nautilus-admin package in the main repositories. With it, you’ll get “Edit as Administrator” option for editing documents, and “Open as Administrator” option for opening folders as root.

    To install it, press Ctrl+Alt+T on keyboard to open terminal and run command:

    sudo apt install nautilus-admin

    UPDATE: For Ubuntu 22.10 & 23.04, use sudo apt install —no-install-recommends nautilus-admin command instead to skip installing Gedit text editor, since it now uses GNOME Text editor as default.

    Tip: For Ubuntu MATE or Linux Mint MATE desktop, there's also a similar package called caja-admin for the Caja file browser.

    2.) Restart nautilus to apply change:

    After installed the extension, you need to apply change by restarting nautilus via command:

    Or you can just log out and back in. And it should work afterwards.

    3.) Use GNOME Text Editor to edit documents as root in Ubuntu 23.04

    For Ubuntu 22.04|20.04, you’re done now!

    However, Ubuntu 22.10 & 23.04 has replaced Gedit with GNOME Text Editor as default! In case you don’t want to use Gedit to edit documents as administrator. Do following steps one by one:

    1. First, press Ctrl+Alt+T shortcut key on keyboard to open terminal.
    2. Then, run command to edit the extension script file:
    sudo nano /usr/share/nautilus-python/extensions/nautilus-admin.py

  • When file opens in command, find out and replace /usr/bin/gedit with /usr/bin/gnome-text-editor as value for “GEDIT_PATH”.
  • Finally, press Ctrl+X, type y and hit Enter to save file. And, run nautilus -q command to apply change.
  • (For OLD Ubuntu) Fix / Workaround for Ubuntu 21.04 & Ubuntu 21.10:

    In Ubuntu 21.04 Hirsute Hippo, there are two issues in my case. If you get into the same problem, here’s the workaround.

    a.) Fix nautilus -q error for Ubuntu 21.04

    Running nautilus -q command will output an error message in Ubuntu 21.04:

    Traceback (most recent call last):
    File “/usr/share/nautilus-python/extensions/nautilus-admin.py”, line 25, in
    from gettext import gettext, locale, bindtextdomain, textdomain
    ImportError: cannot import name ‘locale’ from ‘gettext’ (/usr/lib/python3.9/gettext.py)

    This is due to a small change in the Python 3.9 library. To fix it, do the steps below one by one:

      Firstly press Ctrl+Alt+T on keyboard to open terminal. When it open, run command to edit the extension script:

    sudo gedit /usr/share/nautilus-python/extensions/nautilus-admin.py

    Finally save the file and restart Nautilus via nautilus -q command.

    b.) Workaround for nautilus admin & gedit admin error:

    Due to update of the gvfs package, you’ll get an error when using ‘Open as Admin’ action:

    GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Unix process subject does not have uid set

    It’s a bug caused by the commit to fix a network permission issue for flatpak apps. The upstream has fixed the issue by releasing gvfs 1.48.1. However, Ubuntu stuck at version 1.47.91 without a fix.

    Solution:

    • Install gvfs 1.48.1 from a third-party PPA.
    • Or downgrade gvfs by installing the package from Ubuntu 20.10.

    Option 1: Install gvfs 1.48.1 from Ubuntu PPA:

    Thanks to Panda Jim, who has backported the package from Debian into this Ubuntu PPA with Ubuntu 21.04 and Ubuntu 21.10 support.

    Open terminal via Ctrl+Alt+T keyboard shortcut, then run the commands below one by one to add the PPA & upgrade gvfs package:

    sudo add-apt-repository ppa:ubuntuhandbook1/gvfs

    After that, the ‘Open as Administrator’ function should work at next login.

    For any issue, purge the PPA which will also revert the package to the stock version:

    sudo apt install ppa-purge && sudo ppa-purge ppa:ubuntuhandbook1/gvfs

    Option 2: install the gvfs packages from Ubuntu 20.10:

    For those don’t like third-party PPAs though upgrading gvfs is preferred, you can alternatively downgrade the gvfs package to the old 1.46 version.

    1. Firstly, download the .deb packages (for 64-bit system) one by one by clicking the following links:
      • gvfs
      • gvfs-libs
      • gvfs-fuse
      • gvfs-daemons
      • gvfs-common
      • gvfs-backends
    2. Secondly, press Ctrl+Alt+T to open terminal and run command to install all downloaded deb packages:
    sudo apt install ./Downloads/gvfs*.deb

    Finally restart your machine to apply changes.

    Источник

    Enable ‘Open as Admin (Root)’ in Ubuntu 19.10 Nautilus

    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:

    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.

    permalink

    Ji m

    I’m a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to remind me outdated tutorial! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1

    2 responses to Enable ‘Open as Admin (Root)’ in Ubuntu 19.10 Nautilus

    This worked for me previously on an ubuntu desktop 19.10 system, however it’s not working for me on ubuntu server 19.10. After installing and configuring gnome plus the nautilus-admin package and using the ‘nautilus -q’ command, “Edit as Administrator” is present in the menu when I right click on a file, however when I attempt to use it the resultant display shows a blank/empty window like it would if the file was completely empty – even when I know the file is there.

    Источник

    Оцените статью
    Adblock
    detector