Kodi Community Forum

Full Version: Set up Samba with secure acces from Win 7?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am pretty much a linux noob and can't seem to set up Samba in such a way that I can access it from windows 7 using credentials.

Most of my progress can be found here: http://forum.xbmc.org/showthread.php?tid=77222&page=2

I can set up samba, but it seems it is either wide open to anyone, and when I use credentials I lose any access. I tried some stuff on windows 7 side as well and have reverted to disabling Samba and using FTP for the time being. However now transferring files is less convenient and I can't use any tools in Windows such as Ember.

I don't care if the access from windows uses the same credentials als the xbmc logon which I used to install xbmc with, as long as it is not wide open.

I'd appreciate it if someone has some time to help me get this fixed. In return, when it is working, I'll write up a single thread covering all steps to help out others. This is usually easier for others to follow then a long thread with many steps that might not turn out to be necessary in the end. I did the same with NFS access here: http://forum.xbmc.org/showpost.php?p=597...stcount=15

EDIT: this is in the end all I did to get it working summarized in one place

Note: I installed xbmc live with default logon xbmc and a personal password. For the guest account and all steps here I always used exactly the same combination of username and password!

I followed the excellent guide here: http://forum.xbmc.org/showpost.php?p=568466&postcount=1 to set up samba, and I only made one change I changed "guest ok" to no.

Code:
guest ok = no

Before trying to access from Windows I then ran the suggestion here where "xbmc is my username". I think it prompts for a password twice and I used the same as my xbmc live install.

Code:
sudo smbpasswd -a xbmc

I then proceeded in guide above to acces the pc first (I went to network locations which i found easier, clicked on the pc name, saw the samba mapping which is also xbmc and on clicking it was asked the username and password. It works!
Hi. First off thx for your work so far. I used it to get up and running with samba using the links you posted. I to ran into the same problem. I could access the share fine with guest ok = Yes but as soon as I set it to no I couldn't connect no matter what combination of user and password i tried in Win7. So I went digging and eureka found a solution that worked for me.

Run sudo smbpasswd -a USERNAME

Replacing USERNAME with your username making sure that it all ready exists in LIVE. And that did it for me. I set guest to no and it prompted me for logon credentials and using the username password I created using sudo smbpasswd -a it logs me in just fine. Hope this helps!
Thanks this looks promising. My xbmc live logon is the default xbmc with a chosen password. Could I just run:

Code:
sudo smbpasswd -a xbmc
I would think that would work yes. I'm a nix noobie though so I can't say for sure. I used a different login and shared that /home directory.
Yes, technically that would work ... if you want some multiple logins, and have private directories for users (and groups) here's a way you can set it up (which is how I have it setup)

CREATE SAMBA USERS:

sudo smbpasswd -a username (of course type in the SAME password that you use on your Win7 machine)

This section will map the linux user to the samba user (of which you can also create groups to handle this as well) NOTE:

sudo nano /etc/samba/smbusers

linuxuser = "sambauser"

In the "Authenication" section of /etc/samba/smb.conf

security = user
username map = /etc/samba/smbusers

encrypt passwords = true

If you have users on the machine already, and you want to map the unix users to the samba users passwords, in the same "Authenication" section change:

unix password sync = no

to: unix password sync = yes

Now, for the shares:

sudo nano /etc/samba/smb.conf

For a STANDARD share that all users have access to, the simplest way is in the "Share Definitions" section:
[SHARENAME]
path = /path/to/directory
writeable = yes
browseable = yes

For the private share:
[SHARENAME]
path = /path/to/directory
valid users = sambauser
writeable = yes

NOTE: If you want to create separate linux users; and map their home directory:

sudo useradd -d /home/user -m user

then, create their password:

sudo passwd user

Give all that a bash and see how you go, give me a hoi if you need any further help.
Thanks. Haven't had time yet to try, but I'll post back once I have and this looks promising!
It worked! Just did a full 10.0 install and this was the last piece of the puzzle. I'll turn it into a guide soon when I have everything up and running.