Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-19-2003, 06:25 AM
|
#1
|
Member
Registered: Mar 2003
Location: Evia-Greece
Distribution: Slackware
Posts: 104
Rep:
|
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
|
|
|
05-19-2003, 06:29 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
just put a line in the global options for smb.conf, saying "hosts deny = a.b.c.d" and restart samba.
|
|
|
05-19-2003, 03:23 PM
|
#3
|
Member
Registered: Apr 2003
Location: California, USA
Distribution: Redhat 8.0, 9.0 Suse 9.0 Pro
Posts: 129
Rep:
|
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
|
|
|
05-19-2003, 04:27 PM
|
#4
|
Member
Registered: Mar 2003
Location: Evia-Greece
Distribution: Slackware
Posts: 104
Original Poster
Rep:
|
hmm. thanx but I will have to know what does every line do before use it..
Thank you very much!
|
|
|
05-19-2003, 05:01 PM
|
#5
|
Member
Registered: Apr 2003
Location: California, USA
Distribution: Redhat 8.0, 9.0 Suse 9.0 Pro
Posts: 129
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 10:38 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|