问题原文
原帖链接 · bolind · CC BY-SA 4.0
We have a situation where a site office has a couple of Rocky Linux 8 servers and regularly receives large amounts of data from clients. Data arrives on a variety of external USB hard drives and the occasional USB memory stick. These drives can have all sorts of file systems, but the most common are NTFS and exFAT.
NTFS is natively supported on RL8, but exFAT is not. We have used the fuse-exfat package from rpmfusion. (https://github.com/relan/exfat).
I would like my users, who do not have, and should not have root access, to be able to mount these in a smooth fashion. Previously, we have used pmount, but pmount doesn't play well with exFAT. I think that's because it's FUSE, not because it's exFAT.
Is there a good, secure way to achieve this?
Edit: pmount appears to be a very thin wrapper around mount, and permissions are achieved via a setuid bit on the executable. So basically it's a finite set of mount commands, and exfat is not one of them. There's some discussion here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755434 and a proposed patch here: launchpadlibrarian.net/229524614/pmount.exfat.patch
社区高分解答
原帖链接 · Saxtheowl · CC BY-SA 4.0
You could use udisks2, which allows users to manage and mount storage devices without root access.
Setup
- Install the tool:
sudo dnf install udisks2 ntfs-3g fuse-exfat - Allow user to manage:
sudo usermod -a -G disk <username>
Non-root users in the disk group can use the udisksctl command-line tool to manage and mount external drives.
Replace <username> with the user you want to allow to manage the drives.
Usage examples
- Mount a drive:
udisksctl mount -b /dev/sdXY - Unmound a drive:
udisksctl unmount -b /dev/sdXY - Get information:
udisksctl info -b /dev/sdXY
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
