web-dev-qa-db-ja.com

USB自動マウントが「許可されていません」に失敗する

USB自動マウントは数か月間はうまく機能しましたが、いくつかの更新後、Nautilusは表示されます enter image description here

これらのコマンドでそれはうまく機能します:

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
4
Aubin

承認の問題のようです。もちろん、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