Linux Commands Examples

A great documentation place for Linux commands


GTK+ frontend for su and sudo

see also : su - sudo



gksu [-u <user>] [options] <command>

gksudo [-u <user>] [options] <command>

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


gksudo nautilus "$@"
gksudo /opt/rox
gksudo "shutdown -h now"
gksudo ./
ssh edd@debbie gksudo halt

Why gksudo does not exit after it started background process?

It seems to me that gksudo never does that. For example, gvim will give you a working shell back when you started it. But starting it with gksudo will block the shell.

The easiest thing you can do is run it in the background:

gksudo conky &

"gksu" doesn't prompt for the root password

set a password for your keyring, or remove your gksu password from the keyring.

When you tell a gnome system to remember a password, it places it on the keyring. the keyring should have a master password that you use to unlock the keyring and access your stored passwords automatically.

When your keyring does not have a password, your passwords are stored in cleartext, and you don't need a password to access them, so gksu just reads it normally.

If you set your keyring master password, you will need to enter it upon each boot, the first time you access a stored password. once done, you will not be able to gksu your terminal without either providing the keyring or account password.

If you remove your account password from the keyring, you will be prompted to enter it when running gksu. Just be sure not to tell it to remember the password.


This manual page documents briefly gksu and gksudo

gksu is a frontend to su and gksudo is a frontend to sudo. Their primary purpose is to run graphical commands that need root without the need to run an X terminal emulator and using su directly.

Notice that all the magic is done by the underlying library, libgksu. Also notice that the library will decide if it should use su or sudo as backend using the /apps/gksu/sudo-mode gconf key, if you call the gksu command. You can force the backend by using the gksudo command, or by using the --sudo-mode and --su-mode options.

If no command is given, the gksu program will display a small window that allows you to type in a command to be run, and to select what user the program should be run as. The other options are disregarded, right now, in this mode.


--debug, -d

Print information on the screen that might be useful for diagnosing and/or solving problems.

--user <user>, -u <user>

Call <command> as the specified user.

--disable-grab, -g

Disable the "locking" of the keyboard, mouse, and focus done by the program when asking for password.

--prompt, -P

Ask the user if they want to have their keyboard and mouse grabbed before doing so.

--preserve-env, -k

Preserve the current environments, does not set $HOME nor $PATH, for example.

--login, -l

Make this a login shell. Beware this may cause problems with the Xauthority magic. Run xhost to allow the target user to open windows on your display!

--description <description|file>, -D <description|file>

Provide a descriptive name for the command to be used in the default message, making it nicer. You can also provide the absolute path for a .desktop file. The Name key for will be used in this case.

--message <message>, -m <message>

Replace the standard message shown to ask for password for the argument passed to the option. Only use this if --description does not suffice.

--print-pass, -p

Ask gksu to print the password to stdout, just like ssh-askpass. Useful to use in scripts with programs that accept receiving the password on stdin.

--su-mode, -w

Force gksu to use su(1) as its backend for running the programs.

--sudo-mode, -S

Force gksu to use sudo(1) as its backend for running the programs.

see also

su , sudo

How can this site be more helpful to YOU ?

give  feedback