LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-19-2003, 06:25 AM   #1
stelmed
Member
 
Registered: Mar 2003
Location: Evia-Greece
Distribution: Slackware
Posts: 104

Rep: Reputation: 15
How can I prevent a certain IP from the LAN to connect to Samba


Hello everybody!
I would like to block an IP address from having access to my shared files,
Could someone tell me the line I have to put to the smb.conf in order to prevent a computer with a certain IP to connect to samba and have access t my shared files?

Thank you in advance
 
Old 05-19-2003, 06:29 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
just put a line in the global options for smb.conf, saying "hosts deny = a.b.c.d" and restart samba.
 
Old 05-19-2003, 03:23 PM   #3
KennyK
Member
 
Registered: Apr 2003
Location: California, USA
Distribution: Redhat 8.0, 9.0 Suse 9.0 Pro
Posts: 129

Rep: Reputation: 15
I would sugjest getting deeper into the power of Samba.

Try doing this;

Under [global]
find security and change it to;
security = user

then go down to Share Definitions and insert this;
[homes]
comment = Home Directories
browseable = no
writable = yes

[Profiles]
path = /%G/%U/.profile
writable = yes
browseable = no
guest ok = yes
directory mask = 0755
create mask = 0755
read only = no

comment = share
path = /home/samba/share
valid users= kenny, otheruser
public = yes
writable = yes
printable = no
create mask = 0777
directory mask = 0777
browseable = yes

Restart Samba. Don't forget to change the varibles that are in mine to suit your needs. Also make sure that you create the samba users on the server in order to get the user based security to work.

Regards
 
Old 05-19-2003, 04:27 PM   #4
stelmed
Member
 
Registered: Mar 2003
Location: Evia-Greece
Distribution: Slackware
Posts: 104

Original Poster
Rep: Reputation: 15
hmm. thanx but I will have to know what does every line do before use it..
Thank you very much!
 
Old 05-19-2003, 05:01 PM   #5
KennyK
Member
 
Registered: Apr 2003
Location: California, USA
Distribution: Redhat 8.0, 9.0 Suse 9.0 Pro
Posts: 129

Rep: Reputation: 15
Sorry if I wasn't that detailed on what these do. But here you go.
****************************************************
This will make it so in order to connect to the Samba server, it will prompt you for a username and password.
****************************************************
Under [global]
find security and change it to;
security = user

*************************************************
This will tell samba to direct the user to their home directory.
*************************************************
then go down to Share Definitions and insert this;
[homes]
comment = Home Directories
browseable = no
writable = yes

[Profiles]
path = /%G/%U/.profile
writable = yes
browseable = no
guest ok = yes
directory mask = 0755
create mask = 0755
read only = no

**************************************************
This will add additional share directories and also you can say which user cann access this directory.
*************************************************

comment = share
path = /home/samba/share
valid users= kenny, otheruser
public = yes
writable = yes
printable = no
create mask = 0777
directory mask = 0777
browseable = yes


I hope this clears it up for you.

Regards

Last edited by KennyK; 05-19-2003 at 05:06 PM.
 
  


Reply


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
No Internet but LAN and VPN connect LAN work fine??? xavior SUSE / openSUSE 7 11-09-2005 01:14 PM
how to connect to LAN ninelives1980 Linux - Networking 2 08-25-2005 04:24 AM
Samba: can't connect to my local linux machine but can connect to windows. Royle Linux - Networking 3 01-18-2005 05:32 PM
Can not connect to LAN dca Linux - Networking 1 04-21-2003 03:57 PM
RH cannot connect to LAN esael Linux - Networking 2 09-26-2002 07:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:03 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