Change what user Plex runs as

I am slowly working on getting my home lab over to using LDAP (Zentyal server specifically). My media is hosted on a FreeNAS system and I want to have Plex run as a specific user on my Ubuntu server. This user will be a LDAP user. I know there are a few ways to accomplish this. 

 

1) Change the UID on my Plex server to match the LDAP UID

2) Map the UIDs on my Plex server (LDAP UID == Plex UID)

3) Change which user Plex runs as

 

Which is the best way to do it?  I think #3 would be best but I am not sure how to accomplish it.

for #3 it should work like this:

Stop plex if it is running
>sudo service plexmediaserver stop

Edit the plexmediaserver file

sudo nano /etc/default/plexmediaserver
scroll down to
PLEX_MEDIA_SERVER_USER=plex ← change this to the username you want to use
save changes

Modify groups

sudo addgroup plex youruser
sudo addgroup youruser plex

then start plex again

sudo service plexmediaserver start

Hi !


Do you have any more information or a link about the first method ? (How to change the identity provider to a LDAP server to allow specific users only)


Thanks

I followed these directions word for word, but my server is still running as the user plex. I even rebooted to see if that might help. No luck. Any other ideas? Server ver 9.12.12 running on Ubuntu 15.10.

same here it wont run as the user i set it to

top -u plex still lists Plex as running under the plex user for me as well… what should I do?

@ajthemacboy: read your script (init.d, systemd, launchd, rc.d…) which launches plexmediaserver. It depends on your particular incarnation of Unix how it is done.

@eckarth said:
@ajthemacboy: read your script (init.d, systemd, launchd, rc.d…) which launches plexmediaserver. It depends on your particular incarnation of Unix how it is done.

I’m on Ubuntu 15.10, and there doesn’t appear to be a plex script in /etc/init.d/, where might it be…?

This is an old thread and my issue might be different but… this worked for me;

$ sudo usermod -aG vboxsf

Just rebooted the plex box afterwards and suddenly all vbox shares were visible. Rather
than asking plex to run under a different account, add the plex account to your significant
group. Got it from;

1 Like

hi how i can integrate authentification with active directory in ubuntu plex server

Instructions for changing the user on Ubuntu (later versions that use systemd):

  1. Edit /etc/default/plexmediaserver
  • Change the “PLEX_MEDIA_SERVER_USER=” to your new username

(not sure if this step is strictly needed on Ubuntu, but best to keep it all the same…)

  1. Stop plex:

(as root)
systemctl stop plexmediaserver.service

  1. Edit /lib/systemd/system/plexmediaserver.service
  • change the “User=” and “Group=” entries to suit your needs
  1. Change the ownership of any files owned by plex:

(as root)
find . -user plex -print0 | xargs -0 chown newUser:newGroup

  1. Restart plex:

(as root)
systemctl start plexmediaserver.service

And that should do it.

The procedure works when done correctly and on the right version.

Ubuntu 14 and Centos 6 are init
Ubuntu 16, Centos 7, Debian 8+, and all Fedora versions are systemd

cat /proc/1/comm - returns the control program. This will be init or systemd

I had to run this to change the command to this while running as ‘root’:

find . -user plex -exec chown user:plex {} +

Ubuntu 16.04.6 LTS

Please explain what you’re trying to accomplish?

It seems as if you’re searching for file which are owned by plex then acting on them.

It was my hope the procedure was more clear and would not have required two steps when it came to setting the new permissions.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.