`

ubuntu sudo和gksu的区别

阅读更多

sudo 用来执行命令行(CLI)程序
gksu 用来执行图形的(GUI)程序

 

GUI = Graphical User Interface
CLI = 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/bin

Here'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)

 

ref: http://ubuntuforums.org/showthread.php?t=397398

分享到:
评论

相关推荐

    ubuntu server 安装最小图形界面.docx

    图形界面里的 sudo、synaptic、图形界面的软件包管理:sudo apt-get install gksu synaptic software-properties-gtk 四、美化界面 sudo apt-get install ubuntu-artwork usplash-theme-ubuntu sudo apt-get ...

    ubuntu 科大源更新

    - 使用文本编辑器打开`sources.list`文件,命令如下:`sudo gksu gedit /etc/apt/sources.list`。 - 在打开的文件中替换原有的源地址为USTC提供的地址。具体的配置如下所示: ``` deb ...

    ubuntu910下载源

    本文将详细介绍适用于Ubuntu 9.10的各种软件源配置方法,帮助用户更好地管理和更新系统。 #### 二、理解Ubuntu更新源 在深入探讨Ubuntu 9.10的更新源之前,我们首先需要了解几个关键概念: 1. **主仓库(Main)**...

    ubuntu 8.10的配置

    使用Alt-F2快捷键打开“运行命令”对话框,输入`gksu gedit /etc/apt/sources.list`以管理员身份打开文本编辑器。删除原有的软件源列表,然后粘贴适合你的网络环境的软件源地址。例如,可以使用Linuxsir社区提供的源...

    ubuntu12.04增加系统功能调用详细步骤(自己总结的)

    在Ubuntu 12.04系统中,增加系统功能调用通常涉及到对内核源代码的修改和编译。这个过程对于新手来说可能有些复杂,但通过以下详细步骤,你可以了解如何实现这一操作。 首先,确保你有权限执行必要的命令。在终端中...

    Ubuntu 10.04安装完全指南

    在开始安装 Ubuntu 10.04 之前,确保你已经准备好了以下几项必需的工具和资源: 1. **11G 空间**:为了确保安装过程顺利进行以及系统后续的正常使用,建议为 Ubuntu 10.04 准备至少 11GB 的硬盘空间。 2. **...

    Ubuntu Linux如何启用root用户

    2. **启用 Root 登录**:打开终端,执行 `gksu gedit /etc/gdm/custom.conf`,然后在文件末尾添加 `AllowRootLogin=true`(如果是 Ubuntu 12.04 之前的版本,则需要编辑 `/etc/gdm/gdm.conf`)。 3. **重启系统**:...

    minidwep-gtk 64bit

    进过测试可以在ubuntu... sudo apt-get install gksu sudo apt-get install reaver 安装好后用sudo minidwep - gtk命令运行就行了。 pin没问题能成功获取密码,握手包抓取好像有点问题没抓到包还需要进一步测试。

    ubuntu_10.04_robocup2D平台配置与安装.tx

    - `sudo apt-get install nautilus-gksu`:将“管理员打开选项”添加到右键菜单中,方便以管理员身份打开文件或文件夹。 - `sudo apt-get install nautilus-open-terminal`:将终端添加到右键菜单中,可以直接在...

    Ubuntu 允许root用户登录.docx

    本文详细介绍了 Ubuntu 中 root 用户的登录机制,包括如何允许 su 到 root、如何允许 root 登录、如何设置自动登录、如何使用 SSH 登录远程服务器等,旨在帮助读者更好地理解和使用 Ubuntu 系统。

    Ubuntu 9.04 速配指南

    6. **gksu工具**:一个图形化的即时用户权限提升工具,可以通过键盘快捷键`ALT + F2`呼出运行对话框,然后输入`gksu`打开。 7. **UbuntuTweak工具**:由中国开发者创建的一款实用配置工具,类似于Windows下的优化...

    Ubuntu校园网设置[归类].pdf

    Ubuntu 校园网设置指南 本文档提供了 Ubuntu 10.10 操作系统下配置锐捷校园网的详细步骤,包括所需软件...本文提供了 Ubuntu 10.10 操作系统下配置锐捷校园网的详细步骤和所需软件,希望能够帮助读者成功连接校园网。

    VMware Workstation 下 Ubuntu 11.04安装VMWare Tools小结.pdf

    本文主要涉及的是在VMware Workstation环境下安装Ubuntu 11.04操作系统后,如何安装和配置VMware Tools的过程,以及与之相关的Linux系统管理技巧。以下是详细内容: 1. **开启Ubuntu root用户**:Ubuntu系统默认...

    Ubuntu允许root用户登录.pdf

    "Ubuntu允许root用户登录" 在 Ubuntu 系统中,默认情况下 root 用户...Ubuntu 系统的安全性是非常重要的,需要根据不同的需求和场景来设置 root 用户的权限,并且需要注意公共用的计算机的安全性,避免出现安全问题。

    Ubuntu 允许root用户登录.pdf

    me@tipfoo:~$ sudo passwd root ``` 然后,输入安装时的用户密码,创建新的 root 用户密码。这将允许用户使用 su 命令来获取 root 权限。 允许 root 用户直接登录 如果想要允许 root 用户直接登录,需要进行以下...

    ubuntu_13.04忘记密码的解决方案

    - 输入`chmod 666 /dev/null`和`mount -o remount,rw /`这两条命令,以使文件系统可写。 - 再次尝试`chmod 777 /etc/passwd`,这次应该不会出现错误。 - 使用`ll /etc/passwd`检查文件权限是否正确修改。 - 最后...

    VMware Workstation 下 Ubuntu 11.04安装VMWare Tools小结.docx

    在VMware Workstation环境下安装Ubuntu 11.04后,为了优化虚拟机性能和实现更好的集成,安装VMware Tools是必不可少的步骤。VMware Tools是一组专为虚拟环境优化的驱动程序和实用工具,它提供了硬件兼容性,提高了...

    ubuntu终端su认证失败-允许su到root.pdf

    ~$ gksu /usr/sbin/gdmsetup ``` 在“安全”选项页中,勾选“允许本地管理员登录”。请注意,开启root登录可能增加系统被攻击的风险,因此不推荐在生产环境中这样做。 3. **不输入密码直接登录** 如果你想让...

Global site tag (gtag.js) - Google Analytics