LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

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
Ask gksudo to print the password to stdout
$ gksudo -p [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, does not set `$HOME` or `$PATH`
-l, --login
Make this a login shell (may cause problems with Xauthority)
-w, --su-mode
Force use of su for authentication
-S, --sudo-mode
Force use of sudo for authentication (default)
-d, --debug
Output debug information
-g, --disable-grab
Disable locking of the keyboard, mouse, and focus while asking for the password
-P, --prompt
Ask the user before grabbing the keyboard and mouse
-m, --message MSG
Custom message in password dialog
-D, --description DESC|FILE
Description for the command being run, used in the default message
-p, --print-pass
Print the password to stdout, like ssh-askpass

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)

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid