LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2758|回复: 4

chmod u+s是什么意思

[复制链接]
发表于 2004-11-23 21:23:02 | 显示全部楼层 |阅读模式
今天突然不能su到root了,root密码是正确的,但是就是显示密码错误
还有mount也不能在一般用户里用了,不管有没有设备,都说没有权限

到google上搜索了一番,发现了这样一段:
---------------------------
Try doing (note back-ticks not quotes)
$ ll `which mount`
it should report :

$ ll `which mount`
-rwsr-xr-x   1 root     root        52788 Apr 17 16:54 /bin/mount
   ^
   |
  /
This means the mount program is setuid root. If your copy is not,
you will need to do a chmod u+s `which mount` while logged in as root.

This should fix it. If you still have problems, you could check the
permissions of your cdrom device in /dev, but I don't think this is the
problem.
-----------------------------

运行了一下chmod u+s /bin/*,结果就都好了
u+s代表什么意思呢?
发表于 2004-11-23 21:38:04 | 显示全部楼层
给/bin/* 的拥有者增加可执行权限。

很多人可能都喜欢用chmod 755、644、777等赋予权限,其实还是用chmod ugo+rwx这样的形式比较直观。

u--拥有者
g--同组用户
o--其它用户
r--可读
w--可写
x--可执行
s--可执行(跟x差不多,我还不清楚两者的区别)
发表于 2004-11-24 01:18:34 | 显示全部楼层
chmod u+s `which mount` 会将/bin/mount设成setuid root,即是说任何用户在执行这个指令时会拥有root权限,可以想superuser一样用此指令做这个指令可做的任何事。Root拥有的setuid的程序有潜在的危险性,一般用sudo来设置会好一点。
发表于 2004-11-24 10:08:04 | 显示全部楼层
恩,对,但是有时候需要,
发表于 2004-11-25 20:33:58 | 显示全部楼层
some experiences for guys here:

  i noticed that usually only several items in /bin/ should have the priviliage of 's',such as mount, su, ping, umount and so on.
So to solve the problem above you can use the command 'chmod u+s' only to these command instead of /bin/*.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表