OSMC not taking password protected SMB Shares

I got the latest OSMC for Raspberry Pi 2 and given some privacy issues I planned to add passwords to my SMB shares in my WD EX4. Once I added them I rebooted the EX-4 and also my PI.

When I try to access my share OSMC keep asking for the password and seems to be not taking the password. I did access the password protected share via my MAC (connect as) and it’s taking my U/P.

Please help with this issue. I also did try to setup Full access / Read only via EX-4 but no chnage in OSMC and it’s not taking the new password. I even added the U/P to passwords.xml and also to sources.xml one at a time and also both at the same time but no luck,

Please help guys…

Sample from my passwords.xml

<passwords>
    <path>
        <from pathversion="1">smb://192.168.1.12/P2P</from>
        <to pathversion="1">smb://username:password@192.168.1.12/P2P/</to>
    </path>
</passwords>

Why do you have different IP addresses in the from and to line? That wouldn’t work.

Sorry it was my typo. In settings actually they match. I have updated it now in this help request.

Where did you save your password.xml?

Also enable smb logging and provide logs.

Apology for delay and issue still preset. Note that I can map the share from my MAC after giving U/P

I can see below error from the log files and location of the password.xml as below

Location:
/home/osmc/.kodi/userdata

Debug.log when I try to enter U/P:
20:04:50 18205.349609 T:1957872176 DEBUG: ------ Window Deinit (LockSettings.xml) ------
20:04:50 18205.363281 T:1487926304 NOTICE: Thread JobWorker start, auto delete: true
20:04:50 18205.365234 T:1487926304 DEBUG: OpenDir: Using authentication url smb://USERNAME:PASSWORD@192.168.1.12/P2P
20:04:50 18205.455078 T:1487926304 ERROR: SMBDirectory->GetDirectory: Unable to open directory : ‘smb://USERNAME:PASSWORD@192.168.1.12/P2P’
unix_err:‘d’ error : ‘Permission denied’
20:04:50 18205.457031 T:1957872176 DEBUG: ------ Window Init (LockSettings.xml) ------
20:04:50 18205.457031 T:1957872176 DEBUG: CSettingsManager: requested setting (user.name) was not found.
20:04:50 18205.457031 T:1957872176 DEBUG: CSettingsManager: requested setting (user.password) was not found.
20:04:50 18205.457031 T:1957872176 DEBUG: CSettingsManager: requested setting (user.rememberpassword) was not found.
20:04:52 18207.160156 T:1444934688 DEBUG: webserver: request received for /jsonrpc
20:05:20 18235.457031 T:1487926304 DEBUG: Previous line repeats 14 times.
20:05:20 18235.457031 T:1487926304 DEBUG: Thread JobWorker 1487926304 terminating (autodelete)
20:05:22 18237.158203 T:1444934688 DEBUG: webserver: request received for /jsonrpc
20:05:33 18248.066406 T:1741403168 DEBUG: Previous line repeats 5 times.

Another go:
20:04:09 18164.832031 T:1957872176 DEBUG: OnKey: 11 (0x0b) pressed, action is Select
20:04:10 18165.060547 T:1855415328 DEBUG: PushCecKeypress - received key b duration 230 (rep:0 size:0)
20:04:10 18165.062500 T:1855415328 DEBUG: PushCecKeypress - ignored key b
20:04:10 18165.164062 T:1444934688 DEBUG: webserver: request received for /jsonrpc
20:04:10 18165.228516 T:1957872176 DEBUG: ------ Window Deinit (LockSettings.xml) ------
20:04:10 18165.238281 T:1409545248 NOTICE: Thread JobWorker start, auto delete: true
20:04:10 18165.238281 T:1409545248 DEBUG: OpenDir: Using authentication url smb://USERNAME:PASSWORD@192.168.1.12/P2P
20:04:10 18165.542969 T:1409545248 ERROR: SMBDirectory->GetDirectory: Unable to open directory : ‘smb://USERNAME:PASSWORD@192.168.1.12/P2P’
unix_err:‘d’ error : ‘Permission denied’
20:04:10 18165.542969 T:1957872176 DEBUG: ------ Window Init (LockSettings.xml) ------
20:04:10 18165.542969 T:1957872176 DEBUG: CSettingsManager: requested setting (user.name) was not found.
20:04:10 18165.542969 T:1957872176 DEBUG: CSettingsManager: requested setting (user.password) was not found.
20:04:10 18165.542969 T:1957872176 DEBUG: CSettingsManager: requested setting (user.rememberpassword) was not found.
20:04:12 18167.166016 T:1444934688 DEBUG: webserver: request received for /jsonrpc
20:04:27 18182.332031 T:1855415328 DEBUG: Previous line repeats 7 times.

Did you check again and again that your Username/Password is correct?

100%. It’s a very simple u/p. User name in my WD EX4 is admin and I also created one called osmc.

Both are not working when I give the password. I know EX4 is correctly setup as via MAC when I access my share its taking the U / P and when connect as guest I can’t see password enabled folder.

Please help…

Just a thought: once given an smb username/password combination, does Kodi still store this within the file ‘passwords.xml’ in plaintext, or is this saved elsewhere, hashed maybe, so that the old login data (before those smb shares got a password protection) got somewhat cached by Kodi and it still tries to use them?
As I said, just a thought…

Yes. It’s saving it to the file but only the username. Given the password is not successful it’s not remembering it.

If I update the password directly in password.xml and try to load it it’s also not showing until I restart the PI and when I restart it Username and password loading but when try it’s keep asking me the user name.

What should I do next?

He Guys

I did more checkings and I think I found the bug. It seems to be once you add a share as Public to OSMC and then try to add a U/P to it for some reason it’s not working. In my case I can’t just remove current shares as I got media library scanned and it will take a lone time to scan them back.

I did add a new share with U/P and it worked.

I am happy to be a guinea pig for this… Lot os other users reporting the same issue and it will be good to get this fixed. I will wait for more information or instructions from you guys…

Hi,

This does not seem to fly anymore. I’ve added a new share, but that didn’t work either. Watching the network traffic it’s clear that osmc tries to access the share with a null username.

When trying through the web browser, the URL showing is not using the username and password I’ve provided in the sources.xml. If I do put it in the URL manually, it works for that folder, that time, but all links to subfolders are again links without username and password.

I started digging a bit in the code but eventually just used this workaround:

Add the share to /etc/fstab

//192.168.1.2/Blabla /mnt cifs username=myusername,password=mysecretpassword,ro 0 0

(then either run mount -a as root, or reboot the device)

Then add /mnt to sources.xml.