USB 自动挂载失败“未经授权”

USB 自动挂载失败“未经授权”

USB 自动挂载运行良好几个月,但经过一些更新后,Nautilus 显示在此处输入图片描述

使用这些命令,它可以很好地工作:

aubin@Breizh-Atao:~$ sudo fdisk -l

[...]

Disk /dev/sdf: 15.6 GB, 15610576896 bytes
119 heads, 55 sectors/track, 4658 cylinders, total 30489408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc3072e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sdf1   *        8064    30489407    15240672    c  W95 FAT32 (LBA)
aubin@Breizh-Atao:~$ sudo mount -t vfat /dev/sdf1 /media/usb/
aubin@Breizh-Atao:~$

我如何才能恢复自动挂载提供的正确设置?

笔记: uname -a返回

Linux Breizh-Atao 4.6.0-040600-generic #201606100558 SMP Fri Jun 10 10:01:15 UTC 2016 x86_64 GNU/Linux

答案1

这似乎是一个授权问题。当然,root 有权限挂载,但 polkit 不允许其他用户自动挂载。(稍后更新)

对于 Debian 或其衍生产品,创建:

 sudo vim /etc/polkit-1/localauthority/50-local.d/55-storage.pkla

和:

[Storage Permissions]
Identity=unix-group:plugdev
Action=org.freedesktop.udisks.filesystem-mount;org.freedesktop.udisks.drive-eject;org.freedesktop.udisks.drive-detach;org.freedesktop.udisks.luks-unlock;org.freedesktop.udisks.inhibit-polling;org.freedesktop.udisks.drive-set-spindown
ResultAny=yes
ResultActive=yes
ResultInactive=no

将您的用户添加到 plugdev 组: (通常默认添加)

 sudo usermod -a -G plugdev <your username>

然后重新启动。

来源:https://unix.stackexchange.com/questions/66654/how-to-mount-usb-stick-on-debian-sid

相关内容