LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 02-26-2012, 10:31 AM   #1
CMOS
LQ Newbie
 
Registered: Aug 2003
Posts: 4

Rep: Reputation: 0
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.
 
Old 02-26-2012, 11:11 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,529
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
  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>
 
Old 02-26-2012, 11:45 AM   #3
CMOS
LQ Newbie
 
Registered: Aug 2003
Posts: 4

Original Poster
Rep: Reputation: 0
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.
 
Old 02-26-2012, 12:50 PM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,529
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
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.
 
Old 02-26-2012, 01:26 PM   #5
CMOS
LQ Newbie
 
Registered: Aug 2003
Posts: 4

Original Poster
Rep: Reputation: 0
I've already used the smbpasswd command to create the Samba username/password. Those credentials don't work though...?
 
Old 02-26-2012, 09:21 PM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,529
Blog Entries: 27

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Any firewall on client or server (iptables)?

Which security mode are you using? This is helpful.

Several samba troubleshooting guides here.
 
  


Reply

Tags
debian, samba, shares


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up VPN for Windows machines to access remote Samba shares irvken Linux - Server 1 11-08-2009 02:10 PM
Setting up samba shares more complex 3333 Linux - Software 2 02-10-2006 11:33 PM
Setting up samba shares. scjvsTP Linux - Software 9 02-04-2006 05:45 AM
trouble setting shares so samba networked xp box can browse files mjewell Mandriva 4 11-13-2005 08:20 AM
Samba Config not working setting up user shares. cogs_bobv Linux - Software 9 10-11-2005 08:58 PM


All times are GMT -5. The time now is 10:12 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration