Another Samba Question


Forum: Networking
Topic: Another Samba Question
started by: wade85

Posted by wade85 on May 08 2006,10:42
I know this have been done to death in this forum, but here is what I have.

this is my smb.conf file:

[global]
    # this sets the work group and should match you windows work group
    workgroup = Rivett

     # this string show up in your network neiborhood
     server string = Server

      # these are my private ip networks behind my router firewall and localhost
      hosts allow = 192.168.x.0/24 172.x.0.0/16 127.0.0.1

       # not really needed but could come in handy.  generates a log file
       # for debugging
       log file = /var/log/log.%m

       # sets max limit on file
       max log size = 50

      # this i really struggled with.  by setting the security to share you open
      #your share up to
      # anyone on your network without a password.  if you set it to user then
      # a login is required.  to use the login you
      # must have the next two lines or at least the encrypt password line.  
      # you also need to use smbpasswd
      # to create a smb password.  I eventually got this to work for file sharing
      # but could not get it working for
      # sharing my printer and eventually set security to share.
      security = share
      encrypt passwords = no
       smb passwd file = /etc/samba/smbpasswd

       # this i set because i read it somewhere that it was needed for linux.
       # i don't have clue what it does.
       socket options = TCP_NODELAY SO_RCVBUF=8192  SO_SNDBUF=8192

       # not sure if this is needed, i do not have a dns proxy but since it
       # works well i left it.
       dns proxy = no

# so i have one linux share on this network call kinux-share (don't ask about
# the name).  the path is to a directory
# i created for sharing with other windows and linux boxes.  make sure
# that you set the permissions in the directory
# for whatever you want to allow.  if you want to allow files to written
# then make it writable, etc.  I would suggest
# you try something simple and go from there.  this is not trivial.  good luck

[Rivett]

      comment = NetDocs
      path = /home/dsl/Docs
      guest ok = yes
      read only = no

After rebooting DSL box it no longer shows up in workgroup computers etc.

here is the folder I want to share /home/dsl/mnt/Box/Dsl_Share

Here is the properties of the folder:
Users: Nobody
Group: Users
Permissions: drwxr-sr-x


any help would be most welcome.. only been using DSL for 12hrs Linux for 14 lol..

ws

Posted by dtf on May 08 2006,12:25
Maybe I am missing something but why do you have a

path = /home/dsl/Docs

and then say

here is the folder I want to share /home/dsl/mnt/Box/Dsl_Share

The path in the smb.conf file must match the directory you want to share.  For example, on my dsl box I would create a fold

/home/dsl/my_share    

The name and directory are your decision but the directory must match the path definition so it would be set to

path = /home/dsl/my_share

and be careful of the permissions.  Set them for what you intend (i.e. read only or read/write etc.).  Also realize this is not a secure setup and if your
computer is open to public access, it would not be advisable.

Your permissions are set to read only unless you as a user own the directory.  Unlikely if you are viewing from a windows machine
Permissions: drwxr-sr-x

In your case if you are sharing
/home/dsl/mnt/Box/Dsl_Share

then set path = /home/dsl/mnt/Box/Dsl_Share

Another problem is hosts allow = 192.168.x.0/24 172.x.0.0/16 127.0.0.1

That is an example and should be set to your home network id (also the 'x' needs to be replaced with a valid number).  If you do not
understand what this is then it is best
to leave it out until you study up on it.  This is not intended as a negative comment but the explanation is beyond the scope of this
forum.

Posted by wade85 on May 08 2006,22:38
Thank you, I will try that today, if I cut "allow = 192.168.x.0/24 172.x.0.0/16 127.0.0.1" this bit out will that allow EVERY one on the network in? its a small private network and im not too concerned about security, that will come later..

ws

Posted by dtf on May 09 2006,03:02
if I cut "allow = 192.168.x.0/24 172.x.0.0/16 127.0.0.1" this bit out will that allow EVERY one on the network in?

Yes it should allow everyone with the same group name and on the same network view your share.  Most likely if you have a small  private home network it would be setup as a single network internally with a visable external IP address.

samba has alot of options and there are ways to limit access but I am no expert and you would have to research it some.

Posted by larkl on May 12 2006,12:07
I've found the permissions and samba password to be the problem most of the time. What has always worked best for me with Samba is the following:

Set up linux directory with owner name matching exactly the WIndows username.  Ensure that this user is the owner and has full permissions on this directory.

Use smbpasswd to create samba password for this user.  

Enable password encryption in smb.conf.  

Your approach may work, but I thought I would share what I;'ve had success with.  Finally, there seems to be a lot of latency in Windows and it can take a few minutes for the shared folder to appear.  Go do something else and refresh the windows screen later before you give up.

Posted by dtf on May 12 2006,12:49
larkl - thanks for the contribution.  It would be better to use password protection when setting this up.  But I do have a couple of questions.

I am assuming that the windows' user name must NOT contain spaces even though windows allows this, the linux side would not be happy.  Is this right?

If I set it up this way do I need to supply a password when accessing my linux shares or am I automaticly able to get at the share without the password?

Does this configuration work for a shared printer as well as shared files?

Thanks.

Posted by wade85 on May 15 2006,10:17
Ok here is where I'm at, when i open My Network places on my Windows machine, it shouws my share, when I open the share I get the log in screen, the user name is greyed out with RIVETT(thatsmy workgroup)\Guest. i can not change the user name it wont let me...
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.