LinuxCommandLibrary

gksudo

Graphical frontend for sudo with GTK password dialog

TLDR

Run a command as a specific user

$ gksudo -u [userid] [command]
copy
Run the command while preserving the current environment
$ gksudo -u [userid] -k [command]
copy
Force gksudo to use su to run the command
$ gksudo -u [userid] -w [command]
copy
Force gksudo to use sudo to run the command
$ gksudo -u [userid] -S [command]
copy
Output debug info for the given command
$ gksudo -u [userid] -d [command]
copy

SYNOPSIS

gksudo [options] command

DESCRIPTION

gksudo is a graphical frontend for `sudo` that prompts for a password using a GTK dialog. It is essentially `gksu` configured to use sudo-mode by default, authenticating with the current user's password and sudo privileges.
This allows running graphical applications with elevated privileges while using sudo's configuration for permission control.

DEPRECATED: gksudo is no longer maintained and has security issues. Use pkexec from PolicyKit for graphical privilege escalation instead.

PARAMETERS

-u, --user USER

Run command as specified user (default: root)
-k, --preserve-env
Preserve current environment variables
-w, --su-mode
Force use of su for authentication
-S, --sudo-mode
Force use of sudo for authentication (default)
-d, --debug
Output debug information
-m, --message MSG
Custom message in password dialog
-D, --description DESC
Description for the command being run

CAVEATS

Deprecated and unmaintained. Running graphical applications as root can cause permission problems with user config files and X authority. Modern systems discourage running GUI applications as root.

HISTORY

gksudo was created alongside gksu for Ubuntu and other distributions that preferred sudo over su for privilege escalation. Both were deprecated around 2012 in favor of PolicyKit's pkexec mechanism.

SEE ALSO

pkexec(1), sudo(8), gksu(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community