Kodi accessing remote NFS shares
#1
Hello world,

Using Kodi on nVidia Shield, but this question is likely O/S-agnostic.  Mounted storage in the Shield is via SMB only (not NFS.)  But, within Kodi, one is able to browse and use NFS shares.

Since NFS does not use username/password, but rather UID, the question becomes: What UID does Kodi present when accessing a remote NFS share?

I am able to use NFS shares on Synology NAS, but only with setting "Squash all users to 'admin' (as per Kodi wiki.)"  This is not ideal, since 'admin' has elevated rights, but DSM does not allow to squash to any other user.  However, that can be changed by editing some configuration files on the NAS.  Apparently NFS (in general, don't know about Synology) allows access under a given normal user account, but only if the client (Kodi, in this case) is using exactly the same username, UID, and GID.  I don't think Kodi is presenting a username or GID, but must at least present a UID to the NFS server.  Thus, the question above.
Reply
#2
(2018-06-11, 23:17)Positron Wrote: What UID does Kodi present when accessing a remote NFS share

You can squash the user/ID from kodi to anonymous in the exports-file on your NFS server.
Reply
#3
(2018-06-12, 07:27)DaVu Wrote:
(2018-06-11, 23:17)Positron Wrote: What UID does Kodi present when accessing a remote NFS share

You can squash the user/ID from kodi to anonymous in the exports-file on your NFS server.  
Thank you.  Yes, that was the conclusion I had come to from reading.  You can actually set any user you like in exports.  The problem, however, is that the exports file (at least on Synology) gets overwritten with each DSM update.  It would be very nice to know what UID Kodi is using--is it a secret, or is it randomly generated, or...?
Reply
#4
(2018-06-12, 19:04)Positron Wrote: The problem, however, is that the exports file (at least on Synology) gets overwritten with each DSM update.
That was never the case in the old days... (209+ NAS) :-\
You could of course make a simple copy of the exports file for safe keeping.
Reply
#5
(2018-06-12, 19:21)Klojum Wrote: That was never the case in the old days... (209+ NAS) :-\
You could of course make a simple copy of the exports file for safe keeping. 
Sigh... that would seem to be one of the few alternatives.  Though no networking expert, reading has led me to believe that if the UID presented by Kodi were known, that the share could be mounted using that particular user on the NAS--no squashing required.

Surely someone who was able to understand the code (not I) could examine it to determine what UID was being used, or if it were random, or...?  So there doesn't seem to be any reason for it to be a secret.
Reply
#6
For the Nvidia Shield you would require to install/sideload a SSH server if you want info user id's from the Android system.
On your Synology NAS you can simply come in through the SSH backdoor (when enabled), and do a 'id' command to see your current user/group values.

As an example, these are mine on my Ubuntu machine:
cpp:
klojum@officepc:~$ id
uid=1000(klojum) gid=1000(klojum) groups=1000(klojum),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),113(lpadmin),128(sambashare)
Reply
#7
The UID is not set by Kodi - so I can‘t tell. It’s the user id that the kodi process runs under - no clue which one it is on android or if it is device dependend. I for myself have squashed to a defined low access rights user because I run kodi on different platforms which for example gives user id 501 on macOS and 1001 on Ubuntu and so on.

Not sure if you have access to the logs on the nas - or you could make a folder „world writable“ and remove the squashing - then generate a folder there with Kodis file manager and investigate the used user I’d of that folder on the nas ...
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#8
(2018-06-12, 21:10)Klojum Wrote: For the Nvidia Shield you would require to install/sideload a SSH server if you want info user id's from the Android system.
Thank you; interesting idea.  Not sure whether an SSH server is available for Shield, but before investigating that, will see what else I can find on the Synology.
Reply
#9
(2018-06-12, 21:20)Memphiz Wrote: The UID is not set by Kodi - so I can‘t tell. It’s the user id that the kodi process runs under - no clue which one it is on android or if it is device dependend. I for myself have squashed to a defined low access rights user because I run kodi on different platforms which for example gives user id 501 on macOS and 1001 on Ubuntu and so on.

Not sure if you have access to the logs on the nas - or you could make a folder „world writable“ and remove the squashing - then generate a folder there with Kodis file manager and investigate the used user I’d of that folder on the nas ...
Thank you; good information.  Yes, logs are available, and I will give your idea a try--which log files in particular would be of interest?
Reply
#10
So, with no squash, Shield/Kodi has no access to the NAS.  The only setting which allows access is, "squash all to admin."
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi accessing remote NFS shares0