USB drives are mounted with the same permissions the users which runs Kodi has.

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
dgiglio
Posts: 4
Joined: Sun Nov 03, 2019 10:32 am

USB drives are mounted with the same permissions the users which runs Kodi has.

Post by dgiglio »

I use DietPi mainly as media player, so I configured it to start Kodi after the boot. Kodi has the useful feathure that makes usb drives auto mounted once plugged in. The problem is that, since Kodi runs with root permissions, the drive is mounted with its permissions. Moreover Kodi controls don't work if launched by another user.

Any clues in order to have drive accessible by a normal user?
User avatar
Joulinar
Posts: 2572
Joined: Sat Nov 16, 2019 12:49 am

Re: USB drives are mounted with the same permissions the users which runs Kodi has.

Post by Joulinar »

Hi,

the USB drive is not mounted with a specific permission. The device is mounted to a specified folder that has a permission. as well directories on the drive have their own permission. While you drive is mounted, you could change the permission and allow other user
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 2422
Joined: Sat Nov 18, 2017 6:21 pm

Re: USB drives are mounted with the same permissions the users which runs Kodi has.

Post by MichaIng »

You could make Kodi run as a different user. Open dietpi-services, select kodi, select Edit, and add User=yourUser below the [Service] line. In case, you need to add the user to additional groups to grant access to GPU and audio devices:

Code: Select all

usermod -aG audio yourUser # ALSA/audio device access
usermod -aG video yourUser # General video/X server access
usermod -aG render yourUser # DRM access, required on RPi and Odroid N2+C4
usermod -aG dietpi yourUser # To access media/downloads with default permissions on DietPi
Probably more is required to make it run fully featured not sure. Report back how it works, I anyway plan to run Kodi as own user "kodi", group "dietpi" and UMask 002 in the future to limit it's permissions to what is required and allow easier cross access for other users.
Post Reply