How to Enable ‘Open as Administrator / Root’ in Debian 11 Bullseye

This simple tutorial shows how to enable the ‘Open as Administrator’ right-click menu option in Debian 11 Gnome, XFCE, or MATE editions.

In Linux, users need root (Administrator) permission to edit files, e.g, system configurations, or do some copy & paste things outside of user’s home directory. So, the context menu option “Open as Administrator” or “Edit as Administrator” born for beginners and/or those hate Linux commands.

Enable ‘Open as Admin’ in GNOME / MATE:

For GNOME and MATE desktop environment, the package nautilus-admin and caja-admin are available in official repositories to do the job.

Install nautilus-admin for GNOME:

Click on top-left ‘Activities‘ or press Windows key on keyboard, then search for and open ‘Synaptic Package Manager’.

When it opens, do following steps one by one:

  • Search ‘nautilus-admin’ (without quotes).
  • Highlight the package, right-click on choose ‘Mark for installation’.
  • Finally click on ‘Apply’ button to install it.

Install caja-admin for MATE:

Also in ‘Synaptic Package Manager’ search for, mark, and apply to install ‘caja-admin’ package instead.

Restart File Manager

After installation, you have to restart the file manager to apply change. For GNOME, press Alt+F2 to bring up ‘Run a Command’ box, type nautilus -q and hit Enter. For XFCE, you can either logout and back in or run caja -q command in terminal.

Finally right-click on a file or folder and you’ll see the new menu option to edit file or open folder via root user permission.

Edit file via root (Administration) permission

Enable ‘Open as Admin’ in XFCE:

The XFCE desktop environment does not has a similar package for the function. However, the default Thunar file manager supports for custom actions via its app menu.

1.) First, click ‘Home’ icon on desktop to open the file manager. Go to menu “Edit ->Configure custom actions…” to bring up the dialog.

2.) Next, click on the ‘+‘ button create a new action and type:

  • name: Open as Administrator
  • description: whatever as you want.
  • command: pkexec thunar %f
  • choose “Directories” under Appearance Conditions tab.

After that, you’ll see an option to open folders as admin in right-click menu. For editing files as admin, create anther action via:

  • name : Edit as Administrator
  • description: whatever as you want.
  • command: pkexec mousepad %f
  • choose ‘Text Files‘ under Appearance Conditions tab.

You can replace mousepad with other text editor as you prefer to open text files. That’s all. Enjoy!

Exit mobile version