Nick's Tech Blog: Plex on Ubuntu > can't access home directory

Pages

Thursday, February 28, 2013

Plex on Ubuntu > can't access home directory

Problem

After installing plex media server, I went to add some media libraries. I couldn't see any directories under my home directory.

Solution - Difficulty: Very Easy

The "plex" user account doesn't have permission to view any directories under your home directory. In addition, if there are any subdirectories it can't view, rather than show the directories it can, it shows nothing.


First of all, lets give it access to your home directory:

nick@pc:~$ ll -d ~
drwx------ 89 nick nick 28672 Feb 28 19:21 /home/nick/
nick@pc:~$ sudo chmod 755 ~
nick@pc:~$ ll -d ~
drwxr-xr-x 89 nick nick 28672 Feb 28 19:21 /home/nick/

Because I still can't add my media library plex, I'm going to "pull out" just the folders I want plex to use, into it's own home directory (using symbolic links).

nick@pc:~$ sudo mkdir /home/plex
nick@pc:~$ sudo chown plex:plex /home/plex
nick@pc:~$ sudo ln -s /home/nick/Music /home/plex/Music
nick@pc:~$ ll /home/plex
total 8
drwxr-xr-x 2 plex plex 4096 Feb 28 20:23 ./
drwxr-xr-x 5 root root 4096 Feb 28 20:22 ../
lrwxrwxrwx 1 root root   16 Feb 28 20:23 Music --> /home/nick/Music/

And there you have it. You should now be able to add "/home/plex/Music".


Additional Troubleshooting:

If you want to test what directories the "plex" user account can access, you can become the "plex" user by typing:

nick@pc:~$ sudo su plex

Navigate around, do some troubleshooting. To exit back to your own account, just type "exit".

4 comments:

  1. Thanks best post on the web about this problem!

    ReplyDelete
  2. Thanks Matthijs, I appreciate the feedback!

    ReplyDelete
  3. would this enable other users also to read my home folder?

    ReplyDelete
    Replies
    1. Yes, that is exactly what is happening in this example. I should've written a warning, to suggest only providing access to the required directories/only providing access to the `plex` user. Thanks for pointing this out.

      Delete