OSMC Samba woes

That shouldn’t be necessary.

The Samba config file maps user access to the devices share as the root user - that means filesystem permissions on the drive will not be an issue.

Agreed, but it is worth a try in the investigations, is it not.

Best wishes,

Ken

Perhaps, but it won’t help :wink:

FAT32 drives get mounted with all files appearing to be owned as osmc, (FAT32 doesn’t have file ownership permissions of course, so they have to be made up) while NTFS drives are mounted with all files appearing to be owned by root.

This is regardless of what file permissions might be set on the NTFS drive under windows. (NTFS file ownership permissions are ignored)

This is why we need force user = root in smb.conf for the devices share.

User here has similar problem - access to Sd card but not USB disk

map to guest = bad user did not work unfortunately. I did a fresh install, installed samba from app store, updated the added map to guest = bad user in the global section.

did you reboot/restart the samba service??

what exactly didnt work ?? access at all ?? access without using password ?? access clicking on osmc icon ???

What version of windows are you using??

Did you try typing \\ip of kodi in the address bar of “my computer” \\10.0.0.10 in your case - what do you see (not it did not work)

Yes I rebooted both the pc and the pi after adding the line in the general section.
What I am trying to accomplish is to access my media (external hard drive) attached to the pi from any device in my home without the need for a password/username. So far all attempts either fail (unable to see devices or osmc home folder) or I continue to be asked for a username and password. I have tried adding the external hard drive to the fstab as /mnt instead of media and edited the smb.conf to reflect this.
I have tried access via windows 8.1 and Ubuntu 14.10.

I know what you are trying to achieve and I think it splits into 2 parts -
The issue of whether you see OSMC from the windows machine
and
Acessing the drive without the username and password

You keep mixing up answers " So far all attempts either fail (unable to see devices or osmc home
folder) or I continue to be asked for a username and password" I cant work out from what you are saying here what the conditions are that you can see OSMC home folder. or what the conditions are when you cant access without username/password

Think you need to try one thing at a time

I posted earlier(may have been on other samba thread) about enabling “root” but I cant see any answer to that - why do I ask well I have total access to anything(mounted drives, usb sticks, sd card) plugged into the pi (running OSMC rc2) without using a username/password and I know what set up I use. I can post my smb.conf but unless you enable the root user I suspect it ont help. BTW I also map OSMC root to a drive(as sam suggested) because I cant always see it in my network (its always been like this)

Question? Why can I not use the smb.conf from raspbmc with osmc? Obviously changing pi to osmc which I did but it was of no use.

to answer this earlier question - I think SAMBA on osmc is a later version than on RASPMc (some commands are deprecated )

OK this is how I achieve the non username/password access - I’m not worried about security or messing things up with root user.

ssh in to osmc using osmc / osmc
type in
sudo passwd root
and then type in a new root password (twice)
logout of the ssh session and log back in again using root / password you type above

edit the /etc/samba/smb.conf file

[global]
workgroup = WORKGROUP
security=user
map to guest = Bad Password
guest account = root
follow symlinks = yes
wide links = no
unix extensions = no
lock directory = /var/cache/samba
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
log level = 1
[osmc]
browsable = yes
read only = no
guest ok = yes
path = /home/osmc
[devices]
browsable = yes
read only = no
guest ok = yes
path = /media
force user = root
[rootfs]
comment = Public Folder
path = /
public = Yes
guest ok = Yes
browsable = Yes
read only = No

save and exit
and restart the samba server by typing
service samba restart
when back at the prompt logout of the ssh session

On the windows machine in the address bar of “my computer” or “computer” type
\\ip of OSMC machine
you should see 3 directorices
devices (actually the /media directory)
osmc
rootfs (the whole of the file sytem)

clicking on any should give the directory without asking for username/password
rightclick any will allow you to “map network drive” so it can be accessed easily

HTH

3 Likes

Thank you for all your help. I know I should be addressing one issue at a time but at the time it seemed as one issue. I’ll give your last post a try and get back you.

Sorry for late reply, your suggestion worked a treat. Thank you.

1 Like

No problem.

Unfortunately when you update RC2 it will overwrite your smb.conf file and you will be back to square one. Don’t despair there is now a nice elegant way to solve this(thanks OSMC team)

  1. using ssh copy your smb.conf to be smb-local conf
    cd /etc/samba
    cp smb.conf smb-local.conf

  2. edit your smb.conf file and insert the following line in the global section
    config file = /etc/samba/smb-local.conf

  3. save and exit.
    and restart the samba server by typing
    service samba restart

check it still works

When the samba package is updated the smb.conf file will be overwritten but the new file will contain the config file …line and so it will use your smb-local.conf and so will keep your settings

I am already running rc2 and have copied my working smb.conf elsewhere for future reference.
I’m hoping rc3 or final or what ever is next won’t upset it but as I said I have the backup.

Edit: I also added your suggestion as per previous post and all still working plus have it running as smb-local.conf

yes its the update from RC2 to RC3(and further updates ) or whatever its called that will overwrite the smb.conf with one containing the config file line so you are prepared anyway :smile:

  1. Have you changed your password to osmc and if so are you expecting that new password to work for samba as well ? The samba password must be changed separately to the ssh password using smbpasswd. Both passwords start out as osmc, but they don’t track each other.

Exactly - Had to update smbpasswd as I always change the default password - Might be a good idea to implement passwd sync in default smb.conf if possible!

I’ve testet the following but can’t make it sync:

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
    unix password sync = yes

Anyone got a suggestion on getting sync to work?

unix password sync actually does the opposite of what you probably expect - it syncs the unix password (set with passwd) with the samba password. (set with smbpasswd)

unix password sync actually does the opposite of what you probably expect - it syncs the unix password (set with passwd) with the samba password. (set with smbpasswd)

It’s exactly what I want, as I’ve changed unix passwd with the passwd command - But it dosen’t sync to smbpasswd. I’ve installed samba server in app store

No it works the other way - the samba password is copied to the Unix password. It’s designed for use on servers that are primarily samba servers.

Thanks for the clarification - Makes sense in a standard Windows environment.

I have a custom smb.conf file saved as smb-local.conf and it is still showing the drives connected under the automount template section in the original smb.conf even when commented out or removed. Is there a way to remove this?