What Is 'gksu' and Why Would You Use It?

Use 'gksu' to elevate your permissions for apps in your desktop environment

Developers believe gksu is a security risk. It's been unmaintained since 2014. Instead of using this utility, use PolicyKit instead (in managed settings) or rely on shell-based tools like sudo.

The gksu and gksudo commands elevate your permissions when you run graphical applications. They are equivalent GUI-focused commands to the su command and the sudo command in a shell session.

These programs may not be installed by default. Install them from your distribution's repository.

Why Would You Use 'gksu'?

When you open a folder to which you enjoy limited permissions, you will find that options such as create file and create folder are grayed out.

You could open a terminal window, switch to another user using the su command, and then create or edit files using a text editor. Alternatively, you could use the sudo command to edit files in places where you don't have the correct permissions.

The gksu application runs Nautilus as a different user—typically the root user or its equivalent—which means you gain access to the files and folders that are currently grayed out, without having to resort to the shell prompt.

How to Use 'gksu'

A simple way to run gksu is to open a terminal window or press Alt+F2 and type the following:

gksu gedit /home/user/filename

A small window will opens with two boxes. The run box asks the name of the program you wish to run and the as user box selects which user to run the program as. If you run gksu and enter nautilus as the run command and leave the user as root, you're free to manipulate files and folders previously inaccessible.

Deprecated 'gksu' in Ubuntu/Fedora

gedit with admin prompt

Starting with Ubuntu 18.04, gksu is not longer available—and it cannot be installed from repositories. This utility has been deprecated from Debian-based distributions since early 2018 and cannot be installed at all.

To approximate the use of gksu, run a command with admin:// appending the file's URI. Thus, to open a gedit window to modify the file ls.txt, execute in the Run box the following command:

gedit admin:///home/user/ls.txt

You'll be prompted to specify the elevated credentials as normal.

Alternatively, use sudo:

sudo gedit /home/user/ls.txt