Score:0

Why is a ext4 flash drive being mounted with the rights of a different user?

sg flag

I have a computer using 20.04 with three users, where only one is a system administrator. If one of the other users puts in a FAT formatted USB thumb drive everything is fine. They can access it as expected. If the same drive with the same content is formatted as ext4, it is mounted within the correct users folder, but the drives folder has the administrator user as the owner. Why is that? Can I fix this without sudo and without bothering my non-techy users?

To be honest I expected ext4 to work more smooth within a linux ecosystem than FAT. I suspect it is because ext4 knows linux permissions, but then does it mean ext4 is nonsense for portable drives, because the user IDs vary from system to system?

user535733 avatar
cn flag
Non-admin users cannot use the `mount` command anyway, Instead, non-admin users can use `pmount`, which is specifically designed to prevent UID confusion. ([pmount manpage](http://manpages.ubuntu.com/manpages/hirsute/man1/pmount.1.html))
Score:2
cn flag

An ext4 flash drive is being mounted with root user's permissions, because ext4 supports Linux permissions, and Linux, by design, is a secure operating system. By default, users have full access under their own home folder only. They need to be granted access by the person administering the system to write elsewhere.

File systems not supporting Linux file permissions are indeed mounted with full rights for the user that inserts the drive.

Have the system administrator once grant permissions to folder on that ext4 drive, and the user will be able to use these folders.

If the user is the only one using that drive, you could grant permissions to the mount point. Even if the mount point is deleted once the drive is removed, the permission settings are remembered.

Can I fix this without sudo and without bothering my non-techy users?

If you are the administrator of the computer, it does not harm to have to use sudo: it is made so not anyone can ticker with the system.

If you are the administrator of the system, you are in charge, so, yes, you have to bother your non-techy users once to grant them the permissions you deem relevant.

sg flag
Granting access to every single drive is not relly feasible in my case. Is it possible to allow users to access drives that were inserted while their session was active? The users use a lot of different flash drives, I can not identify them all by UUID or name. I already set the permissions (to read-only in my case) for all partitions (permanent ones) that require it. (btw: The problem is not that I'd have to use sudo, I do not want my users to require it for access.)
vanadium avatar
cn flag
Something here: https://unix.stackexchange.com/questions/422656/how-to-make-an-ext4-formatted-usb-drive-with-full-rw-permissions-for-any-linux-m but it is not straightforward.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.