-   Linux - Server (
-   -   Setting up Shares on Debian(6.0.4) with Samba(3.6.3) (

CMOS 02-26-2012 11:31 AM

Setting up Shares on Debian(6.0.4) with Samba(3.6.3)
For learning purposes, I've been playing around with basic functions in Linux. I'm trying to set up some shares on my Debian server but I've hit a snag and I'm hoping some kind soul here might be able to help.

Neither computer is in a domain. I have 3 directories set up to share. I can connect to all the shares from my Windows 7 box. However, when I try to restrict any of the directories using the 'valid users' option in smb.conf, I get a dialog box prompting me for the username/password when I try to connect in Windows. The user I chose does have a profile for both Linux and Samba. It doesn't take any credentials I give.

So I have a few questions :

1. What should I be using for the credentials? I've been trying the computername\username followed by the password.

2. While I can connect to the shares where I don't restrict the user(s), I can only do so by IP, what would I have to do to allow a connection by computer name?

3. I'm also curious on how I can restrict access by groups as opposed to individual users but how can that be achieved?

Any help is appreciated. Thanks.

catkin 02-26-2012 12:11 PM

  1. The smbpasswd command run by root.
  2. The "hosts allow" option in smb.conf (can be used as either a global setting or as a share setting) with hostname(s). Almost certainly the hostnames have to be resolvable on the samaba server. For small networks /etc/hosts file entries would be easiest.
  3. The "user" option in smb.conf with value @<group name>

CMOS 02-26-2012 12:45 PM

1. I don't follow. I've created an account and password for the valid users on the Linux box as well as Samba. When I try to connect it through Windows I get the dialog box prompting me for a username (which is what I want) but it's not accepting any credentials. I've tried all entering all credentials I have for my samba accounts but it just keeps failing.

2. I'll try that out. Thank you.

3. How does Linux/Samba authenticate that? If I restrict a share to the user group Acct and I have 3 users in the Acct group, how does Linux know that when I'm connecting from a Windows box with one of the users in Acct, it should be valid?

Thank you.

catkin 02-26-2012 01:50 PM

samba has its own username/password database maintained by the smbpasswd command. For users to authenticate they must be have been set up using smbpasswd.

I'm not sure about groups. From the smb.conf username documentation:
If any of the usernames begin with a '@' then the name will be looked up first in the NIS netgroups list (if Samba is compiled with netgroup support), followed by a lookup in the UNIX groups database and will expand to a list of all users in the group of that name.

If any of the usernames begin with a '+' then the name will be looked up only in the UNIX groups database and will expand to a list of all users in the group of that name.
You may need to use username map to map Windows user names to Linux user names to get the desired groups behaviour.

CMOS 02-26-2012 02:26 PM

I've already used the smbpasswd command to create the Samba username/password. Those credentials don't work though...?

catkin 02-26-2012 10:21 PM

Any firewall on client or server (iptables)?

Which security mode are you using? This is helpful.

Several samba troubleshooting guides here.

All times are GMT -5. The time now is 12:15 AM.