[问题]gksu和sudo命令有什么不同?[已解决]

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
applnk
帖子: 1485
注册时间: 2007-02-13 15:24
来自: 地球

[问题]gksu和sudo命令有什么不同?[已解决]

#1

帖子 applnk » 2007-04-02 17:37

gksu和sudo命令有什么不同?
上次由 applnk 在 2007-04-05 15:13,总共编辑 1 次。
头像
skyx
论坛版主
帖子: 9202
注册时间: 2006-12-23 13:46
来自: Azores Islands
联系:

#2

帖子 skyx » 2007-04-02 17:41

以下全为听说,没有学习过,也没查过相关资讯。

gksu 用于启用gui程式, sudo 用于CLI。

听说 sudo gui程式,会出问题,为什么会出问题,会出什么问题,不知道,

倒底有什么区别,没感觉到。

比如 sudo nautilus 和gksu nautilus

除了password输入方式不同外,没什么区别
上次由 skyx 在 2007-04-02 17:42,总共编辑 1 次。
no security measure is worth anything if an attacker has physical access to the machine
头像
飞雪笑
帖子: 335
注册时间: 2007-03-14 16:21

#3

帖子 飞雪笑 » 2007-04-02 17:41

不晓得哈,你 man sudo 再 man gksu不久可以了吗
英文不好的话可以sudo --help 再 gksu --help 比较一下好像也可以啊
我刚刚把ubuntu给格了,现在就一个xp,呵呵,没有试验的地方
头像
skyx
论坛版主
帖子: 9202
注册时间: 2006-12-23 13:46
来自: Azores Islands
联系:

#4

帖子 skyx » 2007-04-02 17:46

sudo allows a permitted user to execute a command as the superuser or
another user, as specified in the sudoers file. The real and effective
uid and gid are set to match those of the target user as specified in
the passwd file and the group vector is initialized based on the group
file (unless the -P option was specified). If the invoking user is
root or if the target user is the same as the invoking user, no pass‐
word is required. Otherwise, sudo requires that users authenticate
themselves with a password by default (NOTE: in the default configura‐
tion this is the user’s password, not the root password). Once a user
has been authenticated, a timestamp is updated and the user may then
use sudo without a password for a short period of time (15 minutes
unless overridden in sudoers).

When invoked as sudoedit, the -e option (described below), is implied.

sudo determines who is an authorized user by consulting the file
/etc/sudoers. By giving sudo the -v flag a user can update the time
stamp without running a command. The password prompt itself will also
time out if the user’s password is not entered within 0 minutes (unless
overridden via sudoers).

If a user who is not listed in the sudoers file tries to run a command
via sudo, mail is sent to the proper authorities, as defined at config‐
ure time or in the sudoers file (defaults to root). Note that the mail
will not be sent if an unauthorized user tries to run sudo with the -l
or -v flags. This allows users to determine for themselves whether or
not they are allowed to use sudo.

If sudo is run by root and the SUDO_USER environment variable is set,
sudo will use this value to determine who the actual user is. This can
be used by a user to log commands through sudo even when a root shell
has been invoked. It also allows the -e flag to remain useful even
when being run via a sudo-run script or program. Note however, that
the sudoers lookup is still done for root, not the user specified by
SUDO_USER.
sudo can log both successful and unsuccessful attempts (as well as
errors) to syslog(3), a log file, or both. By default sudo will log
via syslog(3) but this is changeable at configure time or via the sudo‐
ers file.
no security measure is worth anything if an attacker has physical access to the machine
头像
skyx
论坛版主
帖子: 9202
注册时间: 2006-12-23 13:46
来自: Azores Islands
联系:

#5

帖子 skyx » 2007-04-02 17:48

sudo nautilus

gksu nautilus

二者在终端中的提示信息的确不同,后者多一点内容。
no security measure is worth anything if an attacker has physical access to the machine
applnk
帖子: 1485
注册时间: 2007-02-13 15:24
来自: 地球

#6

帖子 applnk » 2007-04-05 4:38

skyx 写了:以下全为听说,没有学习过,也没查过相关资讯。

gksu 用于启用gui程式, sudo 用于CLI

听说 sudo gui程式,会出问题,为什么会出问题,会出什么问题,不知道,

倒底有什么区别,没感觉到。

比如 sudo nautilus 和gksu nautilus

除了password输入方式不同外,没什么区别
我怎么知道是 gui 程式还是用于 CLI ?一般程序应该是什么程式?

sudo gui 程式,会出问题,那么是不是永远用 gksu 启动 guiCLI 程式就不会出问题了?
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

#7

帖子 BigSnake.NET » 2007-04-05 13:08

applnk 写了:
skyx 写了:以下全为听说,没有学习过,也没查过相关资讯。

gksu 用于启用gui程式, sudo 用于CLI

听说 sudo gui程式,会出问题,为什么会出问题,会出什么问题,不知道,

倒底有什么区别,没感觉到。

比如 sudo nautilus 和gksu nautilus

除了password输入方式不同外,没什么区别
我怎么知道是 gui 程式还是用于 CLI ?一般程序应该是什么程式?

sudo gui 程式,会出问题,那么是不是永远用 gksu 启动 guiCLI 程式就不会出问题了?
GUI = Graphical User Interface 就是有图形界面的
CLI = Command Line Interface 就是命令行的东东
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
applnk
帖子: 1485
注册时间: 2007-02-13 15:24
来自: 地球

#8

帖子 applnk » 2007-04-05 15:11

BigSnake.NET 写了:GUI = Graphical User Interface 就是有图形界面的
CLI = Command Line Interface 就是命令行的东东
原来如此,谢谢了!
头像
haosir2
帖子: 55
注册时间: 2007-09-07 17:55

[问题]gksu(问题已解决)

#9

帖子 haosir2 » 2007-10-24 9:50

我用sudo运行GUI和CLI都没问题,用gksu运行GUI也没问题,用gksu运行CLI也没问题(用apt和nano作的实验),但一个脚本,里面使用了CLI,sudo没问题,gksu却出现下列错误:
脚本没运行完,出现下列信息:

*** glibc detected *** xrgsu: free(): invalid pointer: 0x080577a8 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7cd1d65]
/lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb7cd5800]
/usr/lib/libstdc++.so.5(_ZdlPv+0x23)[0xb7e8aa33]
/usr/lib/libstdc++.so.5(_ZdaPv+0x1f)[0xb7e8aa8f]
xrgsu[0x804c54a]
xrgsu[0x804cb2a]
xrgsu[0x804c076]
xrgsu[0x804a6d1]
xrgsu[0x804a63d]
/lib/tls/i686/cmov/libpthread.so.0[0xb7db746b]
/lib/tls/i686/cmov/libc.so.6(clone+0x5e)[0xb7d3b73e]
======= Memory map: ========
08048000-08054000 r-xp 00000000 08:0b 357072 /bin/xrgsu
08054000-08055000 rw-p 0000c000 08:0b 357072 /bin/xrgsu
08055000-08077000 rw-p 08055000 00:00 0 [heap]
b1c5a000-b1c5b000 ---p b1c5a000 00:00 0
b1c5b000-b245b000 rw-p b1c5b000 00:00 0
b245b000-b245c000 ---p b245b000 00:00 0
b245c000-b2c5c000 rw-p b245c000 00:00 0
b2c5c000-b2c5d000 ---p b2c5c000 00:00 0
b2c5d000-b345d000 rw-p b2c5d000 00:00 0
b345d000-b345e000 ---p b345d000 00:00 0
b345e000-b3c5e000 rw-p b345e000 00:00 0
b3c5e000-b3c5f000 ---p b3c5e000 00:00 0
b3c5f000-b445f000 rw-p b3c5f000 00:00 0
b445f000-b4460000 ---p b445f000 00:00 0
b4460000-b4c60000 rw-p b4460000 00:00 0
b4c60000-b4c61000 ---p b4c60000 00:00 0
b4c61000-b5461000 rw-p b4c61000 00:00 0
b5461000-b5462000 ---p b5461000 00:00 0
b5462000-b5c62000 rw-p b5462000 00:00 0
b5c62000-b5c63000 ---p b5c62000 00:00 0
b5c63000-b6463000 rw-p b5c63000 00:00 0
b6463000-b6464000 ---p b6463000 00:00 0
b6464000-b6c64000 rw-p b6464000 00:00 0
b6c64000-b6c65000 ---p b6c64000 00:00 0
b6c65000-b7465000 rw-p b6c65000 00:00 0
b7465000-b7466000 ---p b7465000 00:00 0
b7466000-b7c68000 rw-p b7466000 00:00 0
b7c68000-b7dac000 r-xp 00000000 08:0b 794997 /lib/tls/i686/cmov/libc-2.6.1.so
b7dac000-b7dad000 r--p 00143000 08:0b 794997 /lib/tls/i686/cmov/libc-2.6.1.so
b7dad000-b7daf000 rw-p 00144000 08:0b 794997 /lib/tls/i686/cmov/libc-2.6.1.so
b7daf000-b7db2000 rw-p b7daf000 00:00 0
b7db2000-b7dc6000 r-xp 00000000 08:0b 795011 /lib/tls/i686/cmov/libpthread-2.6.1.so
b7dc6000-b7dc8000 rw-p 00013000 08:0b 795011 /lib/tls/i686/cmov/libpthread-2.6.1.so
b7dc8000-b7dca000 rw-p b7dc8000 00:00 0
b7dca000-b7dd4000 r-xp 00000000 08:0b 795038 /lib/libgcc_s.so.1
b7dd4000-b7dd5000 rw-p 0000a000 08:0b 795038 /lib/libgcc_s.so.1
b7dd5000-b7df8000 r-xp 00000000 08:0b 795001 /lib/tls/i686/cmov/libm-2.6.1.so
b7df8000-b7dfa000 rw-p 00023000 08:0b 795001 /lib/tls/i686/cmov/libm-2.6.1.so
b7dfa000-b7eaa000 r-xp 00000000 08:0b 851636 /usr/lib/libstdc++.so.5.0.7
b7eaa000-b7eaf000 rw-p 000af000 08:0b 851636 /usr/lib/libstdc++.so.5.0.7
b7eaf000-b7eb4000 rw-p b7eaf000 00:00 0
b7eb4000-b7edc000 r-xp 00000000 08:0b 850660 /usr/lib/libpcap.so.0.9.7
b7edc000-b7edd000 rw-p 00027000 08:0b 850660 /usr/lib/libpcap.so.0.9.7
b7edd000-b7edf000 rw-p b7edd000 00:00 0
b7ee9000-b7eec000 rw-p b7ee9000 00:00 0
b7eec000-b7f06000 r-xp 00000000 08:0b 796610 /lib/ld-2.6.1.so
b7f06000-b7f08000 rw-p 00019000 08:0b 796610 /lib/ld-2.6.1.so
bfdab000-bfdc0000 rw-p bfdab000 00:00 0 [stack]
ffffe000-fffff000 r-xp 00000000 00:00 0 [vdso]

问题解决,原来我运行这个程序时已经运行一个了。
!!生命在于折腾!!
PIII 533 +256MB+intel810
OS:ubuntu7.10+winXPsp2(windows是留下来给室友用的)
老当益壮,穷且益坚!
80后的人,90后的机器,最新的操作系统。
yuffey
帖子: 193
注册时间: 2007-09-06 16:24
来自: 中国上海

Re: [问题]gksu(问题已解决)

#10

帖子 yuffey » 2007-10-31 19:10

明白了。
haosir2 写了:我用sudo运行GUI和CLI都没问题,用gksu运行GUI也没问题,用gksu运行CLI也没问题(用apt和nano作的实验),但一个脚本,里面使用了CLI,sudo没问题,gksu却出现下列错误:
脚本没运行完,出现下列信。[/color][/size]
回复