Linux command
gksudo 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Example
gksudo -u [userid] [command]
Example
gksudo -u [userid] -k [command]
Example
gksudo -u [userid] -w [command]
Example
gksudo -u [userid] -S [command]
Example
gksudo -u [userid] -d [command]
说明
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.
参数
- -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
FAQ
What is the gksudo command used for?
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.
How do I run a basic gksudo example?
Run `gksudo -u [userid] [command]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -u, --user _USER_ do in gksudo?
Run command as specified user (default: root)