LinuxSir.cn,穿越时空的Linuxsir!

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

[已解决]普通用户无法自动mount移动设备

[复制链接]
发表于 2009-4-30 21:57:24 | 显示全部楼层 |阅读模式
普通用户无法mount优盘,提示Permission denied和No such file or directory,但root下读写都正常。按照wiki操作还是没有用,不知道是我理解错了,还是漏了什么,希望大家能帮忙看下。万分感谢。
系统环境:awesome+pcmanfm+xterm

/etc/group内容
  1. root::0:root
  2. bin::1:root,bin,daemon
  3. daemon::2:root,bin,daemon
  4. sys::3:root,bin
  5. adm::4:root,daemon
  6. tty::5:
  7. disk::6:root
  8. lp::7:daemon
  9. mem::8:
  10. kmem::9:
  11. wheel::10:root,arch
  12. ftp::11:
  13. mail::12:
  14. uucp:x:14:
  15. log::19:root
  16. locate:x:21:
  17. smmsp::25:
  18. http::33:
  19. games::50:
  20. network:x:90:arch
  21. video:x:91:arch
  22. audio::92:arch
  23. optical::93:arch,hal
  24. floppy:x:94:hal
  25. storage:x:95:arch,hal
  26. scanner:x:96:
  27. power:x:98:arch
  28. nobody::99:
  29. users::100:
  30. dbus:x:81:arch
  31. policykit:x:101:
  32. hal:x:82:arch
复制代码


/etc/dbus-1/system.d/hal.conf
  1. <!DOCTYPE busconfig PUBLIC
  2. "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
  3. "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
  4. <busconfig>

  5.   <!-- This configuration file specifies the required security policies
  6.        for the HAL to work. -->

  7.   <!-- Only root or user hal can own the HAL service -->
  8.   <policy user="hal">
  9.     <allow own="org.freedesktop.Hal"/>
  10.   </policy>
  11.   <policy user="root">
  12.     <allow own="org.freedesktop.Hal"/>
  13.   </policy>

  14. <policy group="power">
  15.    <allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
  16.    <allow send_interface="org.freedesktop.Hal.Device.LaptopPanel"/>
  17. </policy>

  18. <policy group="storage">
  19.    <allow send_interface="org.freedesktop.Hal.Device.Volume"/>
  20.    <allow send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/>
  21. </policy>

  22.   <!-- Allow anyone to invoke methods on the Manager and Device interfaces -->
  23.   <policy context="default">
  24.     <allow send_destination="org.freedesktop.Hal"
  25.            send_interface="org.freedesktop.DBus.Introspectable"/>
  26.     <allow send_destination="org.freedesktop.Hal"
  27.            send_interface="org.freedesktop.DBus.Properties" />

  28.     <allow send_destination="org.freedesktop.Hal"
  29.            send_interface="org.freedesktop.Hal.Device"/>
  30.     <allow send_destination="org.freedesktop.Hal"
  31.            send_interface="org.freedesktop.Hal.Manager"/>

  32.     <allow send_destination="org.freedesktop.Hal"
  33.            send_interface="org.freedesktop.Hal.Device.CPUFreq"/>
  34.     <allow send_destination="org.freedesktop.Hal"
  35.                send_interface="org.freedesktop.Hal.Device.DockStation"/>
  36.     <allow send_destination="org.freedesktop.Hal"
  37.                send_interface="org.freedesktop.Hal.Device.KillSwitch"/>
  38.     <allow send_destination="org.freedesktop.Hal"
  39.                send_interface="org.freedesktop.Hal.Device.KeyboardBacklight"/>
  40.     <allow send_destination="org.freedesktop.Hal"
  41.                send_interface="org.freedesktop.Hal.Device.LaptopPanel"/>
  42.     <allow send_destination="org.freedesktop.Hal"
  43.                send_interface="org.freedesktop.Hal.Device.Leds"/>
  44.     <allow send_destination="org.freedesktop.Hal"
  45.                send_interface="org.freedesktop.Hal.Device.LightSensor"/>
  46.     <allow send_destination="org.freedesktop.Hal"
  47.                send_interface="org.freedesktop.Hal.Device.Storage"/>
  48.     <allow send_destination="org.freedesktop.Hal"
  49.                send_interface="org.freedesktop.Hal.Device.Storage.Removable"/>
  50.     <allow send_destination="org.freedesktop.Hal"
  51.                send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
  52.     <allow send_destination="org.freedesktop.Hal"
  53.                send_interface="org.freedesktop.Hal.Device.Volume"/>
  54.     <allow send_destination="org.freedesktop.Hal"
  55.                send_interface="org.freedesktop.Hal.Device.Volume.Crypto"/>
  56.     <allow send_destination="org.freedesktop.Hal"
  57.                send_interface="org.freedesktop.Hal.Device.WakeOnLan"/>

  58.   </policy>

  59. </busconfig>
复制代码
发表于 2009-5-1 10:08:09 | 显示全部楼层
.xinitrc  eg:

  1. exec ck-launch-session startlxde
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-1 10:11:01 | 显示全部楼层
http://wiki.archlinux.org/index.php/HAL

再一次看了下wiki,找到这么一条

File: /etc/PolicyKit/PolicyKit.conf
  1.         <match user="$USER">
  2.         <!-- replace with your login or delete the line if you want to allow all users to manipulate devices (keep security issues in mind though) -->
  3.                 <match action="org.freedesktop.hal.storage.*">
  4.                         <return result="yes"/>
  5.                 </match>
  6.                 <match action="hal-storage-mount-fixed-extra-options">
  7.                 <!-- for internal devices mounted with extra options like a wished mount point -->
  8.                         <return result="yes" />
  9.                 </match>
  10.                 <match action="hal-storage-mount-removable-extra-options">
  11.                 <!-- for external devices mounted with extra options like a wished mount point -->
  12.                         <return result="yes" />
  13.                 </match>
  14.         </match> <!-- don't forget to delete this line if you deleted the first one -->
复制代码


Note: make sure you type your user name like this <match user="myuser"> and NOT like <match user="$myuser">.
当时看得不仔细,照着这个提示把$USER换成自己的用户名,再重启就解决了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-1 10:13:22 | 显示全部楼层
Post by 马甲321;1981944
.xinitrc  eg:

  1. exec ck-launch-session startlxde
复制代码


谢谢回复,不过我用的是exec awesom不知道是不是也能这么做:thank
回复 支持 反对

使用道具 举报

发表于 2009-5-4 19:53:29 | 显示全部楼层
懒得修改那些配置文件,每次手动 mount ,U 盘,移动硬盘都一样~
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-4 22:07:01 | 显示全部楼层
呵呵,因为在图形界面下,能省就省了。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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