Linux Gksu Usage

Source: Internet
Author: User

Apt-get Install Gksu

Gksu is a Linux-shaped Su/sudo tool

sudo is used to execute a command line (CLI) program
Gksu (GUI) program used to perform graphics

GUI = Graphical User Interface
CLI = Command Line Interface

sudo is the home directory of the current user, Gksu is the root user's home directory

sudo gvim and Gksu gvim differ markedly,
sudo gvim reads the ~/.GVIM configuration file under the current user,
Gksu reads the root user's profile because the settings font in the current user profile does not work: After the CD:P WD results are/root

Therefore, when the system or the program starts, does not run the terminal CLI, may use the Gksu to carry on the root authority.

Usage: Gksu [-u < user;] [options] < commands >

--debug,-d
Print debugging information on the screen that may be useful for diagnosing or resolving problems.

--user < users >,-u < users >
Run as specified user < command >.

--disable-grab,-g
Disables locking of the keyboard, mouse, and focus when the program asks for a password.

--prompt,-p
Ask the user if you need to do this before you have an exclusive keyboard and mouse.

--preserve-env,-k
Preserves the current environment, such as not resetting $HOME and $PATH.

--login,-l
Use this as a login Shell. Beware this may lead to problems with the xauthority magic. Run Xhost to allow the target user to open the window on your display!

--description < Description | Document >,-d < Description | Documents >
Provides a descriptive name for the command to be run that is used in the default information to make it more beautiful. You can also provide an absolute path to a. desktop file whose Name key value will be used for this purpose.

--message < information >,-m < information >
The information that replaces the standard inquiry password is provided for this parameter. Please use only if the--description does not meet your needs.

--print-pass,-p
Let Gksu print the password to standard output, as with Ssh-askpass. Useful in scripts that contain programs that can receive passwords from standard input.

--sudo-mode,-s
Let Gksu use sudo instead of Su, consistent with running the "gksudo" effect.

--su-mode,-w
Let Gksu use Su instead of Libgksu the default method.


Several parameters that are useful in programming

-D: Describes which application is calling the Gksu and does not tell the user any other information.

-M: Use this parameter when you need to inform the user about the behavior of the daemon.

-P: Read Gksu input, print to the standard output, when the program needs a password, with this parameter, but at this time the Gksu is not to verify the correctness of the password, so how to ensure that the password is correct, we need to have the programmer to move the brain.

-W: Allows Gksu to use Su, allowing the user to choose whether to remember the password for the current program

e.g.

First, open the Nautilus File Manager and copy the gedit initiator files from the/usr/share/applications/folder to the desktop.


Second, right click on the Gedit Launcher file on the desktop, select Properties in the menu, add Gksu before the original command, as in the Gksu gedit%u, modify and click on the lower right corner of the close.

The picture is uploaded to the red-linked Linux system tutorial channel.


Third, go back to the desktop, click Gedit Desktop shortcut, this time will bring up a dialog box, enter the power-on password to open a Gedit text editor with root permission.

Linux Gksu Usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.