Ubuntu sudo和gksu的區別

Ubuntu sudo和gksu的區別


sudo 用來執行命令行(CLI)程序gksu 用來執行圖形的(GUI)程序GUI = Graphical User InterfaceCLI = Command Line Interface

sudo 是當前用戶的home目錄,gksu 是root 用戶的home目錄sudo gvim 和 gksu gvim 明顯不同,sudo gvim 讀取當前用戶下的 ~/.gvim 配置文件,gksu 讀取 root 用戶的配置文件,因爲當前用戶配置文件裏設置字體沒起作用,:cd 後 :pwd 結果是 /root所以在系統或程序啓動時,沒有運行終端CLI,可以用gksu來實行root權限。

su/sudo for CLI commands, and gksu/gksudo for running GUI applications (launched from the command line).In ubuntu gksudo is just a link to gksu, so your always running gksu anyways. You can check for yourself> nautilus /usr/binHere's a little known tip, if you run just "gksu" you will get a root run dialog, to run any app as root or other user.1. In Ubuntu (I suppose in most unix/linux systems), there is a user called root (also called superuser) that has the necessary rights (privileges) to do anything that he wants.2. In Ubuntu, they have chosen to disable the root user, because any user that belongs to the admin group is able to execute commands as if he was the root user. To execute a command with the same privileges as the root user, he has to put the word "sudo" before the command. (I suppose, sudo stands for SuperUserDO)3. There is also the command su, that stands for switch user. It is intended to switch from one user to another user in the terminal; the syntax is "su name_of_the_other_user".4. If you call su without indicating the name_of_the_other_user, su assumes that the other user is the root user. So Ubuntu edgy and feisty simply replaces sudo with su without the name_of_the_other_user, which corresponds to su root.(Question: how can su switch to the root user if the root user is disabled?)5. gksu and gksudo are in the graphical environments what su and sudo are in the terminal.By the way, I have read in another thread: people should use gksudo in the terminal to launch a graphical application with root privileges; for example "gksudo gedit". It is also possible to use "sudo gedit", but it is not a good way to do it, because gksudo sets up things for a graphical environment, but sudo sets them up for a text environment. (or something like this)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章