LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-12-2013, 01:56 AM   #1
gdizzle
Member
 
Registered: Jul 2012
Posts: 234

Rep: Reputation: Disabled
Question Samba Share restrict share by hostname


Hi all,
I am trying to figure out to restrict a samba in a per share instance by hostname. I already have this working with IP Address like this:

Code:
vim /etc/samba/smb.conf

[Testfolder]
        comment = testfolder
        path = /testfolder
        create mask = 0777
        guest ok = yes
        hosts allow = 192.168.10.1 127.0.0.1
If I change the hosts allow to the hostnames of the computer (yes which I have tested I can ping etc from the server) this does not work.

Does anyone have a working example of a samba per share restriction by hostname?

Thanks
 
Old 04-12-2013, 08:13 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
If you specify hosts allow in the global section it will take precedence over the share. However, I assume that there isn't anything configured for hostname lookup. i.e. /etc/hosts file or network browsing. I also assume that your samba clients do not use static IP address.

http://www.samba.org/samba/docs/man/...kBrowsing.html
 
Old 04-14-2013, 07:38 PM   #3
gdizzle
Member
 
Registered: Jul 2012
Posts: 234

Original Poster
Rep: Reputation: Disabled
Hi michaelk,
Thanks for your reply here is the full /etc/samba/smb.conf:

Code:
[global]
        workgroup = Test
        server string = Test01
        smb passwd file = /etc/samba/smbpasswd
        log file = /var/log/samba/%m.log
        max log size = 50
        printcap name = /etc/printcap
        dns proxy = No
        idmap config * : backend = tdb
        cups options = raw
        security = user
        map to guest = bad user

[Testfolder]
        comment = testfolder
        path = /testfolder
        create mask = 0777
        guest ok = yes
        hosts allow = wstest.example.com
I have been looking around online and I cannot see any examples from a per share basis in the smb.conf where it uses a workstation name, only IP, and I am not willing to really make them static in /etc/hosts as these clients may loose there dhcp lease in time, so I am trying to keep this dynamic.

So I am wondering if samba can filter by computer name?

I am not going to join this to the Windows Domain, as it's using Tivoli Identity Manager to manage the accounts (yes I know another hurdle), and I have not found anything like that with Samba yet.


Thanks
 
Old 04-14-2013, 08:44 PM   #4
gdizzle
Member
 
Registered: Jul 2012
Posts: 234

Original Poster
Rep: Reputation: Disabled
Ok found an example:

http://www.samba.org/samba/docs/man/...mb.conf.5.html for "hosts allow" .
 
  


Reply



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
Exporting a samba share as NFS share bluforce Linux - Server 1 08-29-2012 08:31 AM
Why is the SAMBA share option 'grayed out' in the share dialog? Atari911 Slackware 1 03-18-2011 07:00 PM
mount windows share export to samba share -> improve network performance tuning newuser77 Linux - Server 1 07-23-2008 11:28 AM
searching samba share breaks connection to share Elomis Linux - Server 1 05-11-2007 12:28 AM
Simple Samba Setup, Share & Not Share timmywo Linux - Software 4 07-30-2004 07:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:00 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration