磁盘挂载:“需要额外的挂载授权”有什么作用?

cal*_*rus 3 mount hard-drive 16.04

在 ubunutu 16.04 中,我正在使用实用程序Disks探索外部 HDD 。在mount 选项界面下,我看到了需要额外授权才能 mount的可能性。

在此处输入图片说明

我选择了该选项,它所做的只是添加x-udisks-authnosuid,nodev,nofail,noauto. 我找不到有关上述选项的任何相关信息,并且x-udisks-auth由于我对文件系统和磁盘的有限了解,搜索使我获得了无法理解的信息。

那么:简单地说,选择上述选项时需要什么样的额外授权?我欢迎对x-udisks-auth.

mur*_*uru 5

我认为udisks联机帮助页很好地解释了这一点:

ACCESS CONTROL
   By default, logged-in users in active log-in sessions are permitted to
   perform operations (for example, mounting, unlocking or modifying) on
   devices attached to the seat their session is on. Access-control is
   fine-grained and based on polkit(8), see the “Authorization Checks”
   chapter in the udisks documentation for more information. Note that the
   x-udisks-auth option can be used in the /etc/fstab and /etc/crypttab
   files to specify that additional authorization is required to mount
   resp. unlock the device (typically requiring the user to authenticate
   as an administrator). 
Run Code Online (Sandbox Code Playgroud)

因此,默认情况下,本地登录(而不是远程登录,例如通过 SSH 等)的用户可以插入 USB 磁盘并安装它,而无需以管理员身份进行身份验证。该x-udisks-auth禁止这一点,并迫使你提供授权。

正如它所说,授权将通过 polkit 完成。因此,您必须作为对与挂载、卸载、弹出等相对应的 Polkit 操作具有权限的用户进行身份验证。默认情况下,这些将是管理员用户(属于该sudo组的用户)。

如果您是管理员,则只需提供密码:

在此处输入图片说明

在图像中,Polkit 操作是org.freedesktop.udisks2.filesystem-fstab

如果系统上还存在其他管理员用户,您将能够选择作为哪个用户进行身份验证。

  • @calocedrus 足够接近(...从技术上讲,Ubuntu 中默认没有 root 密码,您对 sudo 和 polkit 使用自己的密码)。并且有权限的用户无论如何都可以挂载它,这个选项是强制登录系统的用户让有权限的人批准这个(可能是他们的帐户,也可能是其他人的)。 (2认同)