4

I have a dual boot setup with Ubuntu 15.10. I have my music stored on a separate internal (NTFS) HDD along with other files. Is there anyway to let Guest accounts access the music folder and ONLY the music folder on the second drive?

fstab gives access to the entire drive, so that is too much. It's not over a network so Samba isn't the answer either. I saw a post about gaining access using an Admin password but I'm never prompted for that and this is on a separate disk so it might be different. 2nd HDD automounts fine, I just can't get into it as a Guest user. Path to 2nd HDD is /mnt/(drive name). Owner listed as root.

Olliver K
  • 251
  • How do you try to access it what is the error message you receive? – Mostafa Ahangarha Mar 10 '16 at 06:49
  • It just says I don't have the necessary permissions. No code, no number, just the one sentence. – Olliver K Mar 10 '16 at 07:46
  • may you share the related line in the /etc/fstab which mounts your HDD – Mostafa Ahangarha Mar 10 '16 at 08:15
  • Have you tried to connect the HDD after you have logged in to the guest session? – Gunnar Hjalmarsson Mar 10 '16 at 13:56
  • The guest session won't even mount the HDD, hence the auto mount at start up. I'm not sure what is being asked for with the /etc/fstab line. – Olliver K Mar 10 '16 at 16:56
  • 1
    Wonder why - it mounts USB sticks. Probably the 'secret' lies in the file /etc/apparmor.d/abstractions/lightdm. – Gunnar Hjalmarsson Mar 11 '16 at 03:24
  • Indeed it does. If I can edit lightdm to include the path to the music folder with read and traverse permissions, I think that would do it. back to RTFM to find out what "rmwlixk" means. – Olliver K Mar 11 '16 at 05:06
  • OK. I changed lightdm to include .../Music/** rmlix, So now I can cd into the Music folder and ONLY the Music folder from a guest session but I still can't go any further. Rythmbox can't get into it at all. I'm stuck. – Olliver K Mar 11 '16 at 07:58
  • Almost there. Guest-session is limited to the music folder. Rythmbox can play and import the music. Now if I can just get Rythmbox to display it so I can pick the songs I want to hear, I'll be a happy camper. – Olliver K Mar 11 '16 at 08:35

1 Answers1

1

Got it. /etc/apparmor.d/abstractions/lightdm was indeed the answer. It needed two lines of code:

/mnt/DriveName/Music/ r,
/mnt/DriveName/Music/** rmlix

Save the file and reparse:

sudo apparmor_parser -r /etc/apparmor.d/lightdm-guest-session

To edit lightdm, I suppose

sudo nano /etc/apparmor.d/abstractions/lightdm

would've worked but I made a text editor to operate as root: How to run programs as root user without using Terminal

Thanks for pointing me in the right direction.

Olliver K
  • 251
  • 1
    Glad to hear that. But please note that it's a solution with a drawback. The file belongs to the lightdm package, and next time an update of lightdm includes changes to the file, your modifications will be overwritten. So you'd better make a note somewhere of what you did. – Gunnar Hjalmarsson Mar 11 '16 at 11:31
  • I am aware of the drawback. I'm just happy to be able to do it without messing with the root account. Many hours spent searching the boards and RTFM and the many headaches resulted in an education. I've noted how to make the changes in a separate file. Thanks again for confirming lightdm is the right file. – Olliver K Mar 11 '16 at 20:04