External SDD mounts as root
I have an external SDD drive which I have encrypted with LUKS and formated with ext4 (Label ext225).
When I click mount and open, I get the password promt to decrypt the drive and it gets mounted under /media/bruni/ext225
. However, it gets mounted as root. Is it possible to get kde to mount this drive as user bruni, each time it gets mounted?
I am on Kubuntu 21.04 with the kde/backports ppa enabled. The drive has no entry in /etc/fstab
Solution 1:
Even for removable drives, it is normal that a file system that supports linux permissions is mounted for root
. Only file systems not supporting linux permissions will be mounted for the user connecting the drive.
You therefore need to set permissions, either on the mount point if you want to assign the entire drive to a single user, or on selected folders on the drive.
To change ownerschip of the entire drive by changing the ownership of the mount point, execute:
sudo chown $USER:$USER /media/bruni/ext225
$USER
is a variable that automatically will be replaced by your login name. Substitute another login to grant ownership to a different user.
Mount points of removable drives are automatically created and removed when the drive is removed. The ownership and permissions, however, are remembered.