How to use nautilus as administrator

Nautilus is the Gnome file manager.

IMPORTANT NOTE: This procedure doesn't work under Wayland, It only works on Gnome under Xorg.

The way is by using pkexec. For this to be possible, we must create an execution policy, which will go in a file that we will locate in /usr/share/polkit-1/actions/. This file will be:

sudo nano /usr/share/polkit-1/actions/nautilus-root.policy

...and inside, copy:

<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "">
   <action id="">
     <description>Run Nautilus As Admin</description>
     <message>Authentication is required to run Nautilus As Admin</message>
     <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/nautilus</annotate>
     <annotate key="org.freedesktop.policykit.exec.allow_gui">TRUE</annotate>

Then, to run nautilus as root:

pkexec nautilus