为什么我应该为 Gtk 应用程序使用 gksudo 而不是 sudo?

Tho*_*ley 9 gnome security command-line sudo gksu

我在某处读到人们应该将其gksudo用于使用 Gtk GUI 而不是sudo? 这是什么原因?

Uri*_*era 12

来源。

  1. 但是,也有其他时候,副作用可能像 Firefox 扩展程序不粘连一样轻微,也可能像 .ICEauthority 的权限发生变化而导致无法再登录。

出现这些错误是因为有时当 sudo 启动应用程序时,它以 root 权限启动但使用用户的配置文件。

例如,如果您使用以下命令启动 Firefox

 gksudo firefox
Run Code Online (Sandbox Code Playgroud)

它使用 root 的 Firefox 配置文件。

但是如果您使用以下命令启动 Firefox

 sudo firefox
Run Code Online (Sandbox Code Playgroud)

它以 root 权限运行,但使用用户的配置文件。