Using Samba


Forum: Networking
Topic: Using Samba
started by: linux4all

Posted by linux4all on April 22 2006,18:00
I have downloaded Samba from the MyDSL applications, and would like to be able to enable file sharing on my DSL machine. I'm a relative newbie to linux,  having experience only with Xandros and DSL. The speed and simplicity of DSL interests me, especially for use on older hardware.

I'm wondering if there is something I'm overlooking in the Samba Distribution for DSL. I can't find a place (in the GUI interface for Samba) to set up a Machine Name and Workgroup for my DSL computer. I also can't figure out how to share a directory on the network.

I would be eternally grateful for any help from someone with some Samba experience.

Posted by dtf on April 22 2006,20:54
With DSL once you download the samba.dsl extension you should be able to see your windows share without doing anything.  If you want to share a directory with windows from the DSL computer you will need to edit /etc/samba/smb.conf.

The topic has been cover several times. You might try searching the wiki and forums for previous discussions on the topic.  If you still are having problems, I try to find a link to a previous discussion.

Posted by rjmusto on April 28 2006,19:29
Linux4all:

I'm trying to do exactly the same thing but not succeeding. (I want to modify the smb.conf file but it's always Read Only).

Did you find a solution and, if so, where?

Posted by dtf on April 28 2006,19:38
To modify the /etc/smb.conf file you must be root.

enter

sudo su

at the prombt

Posted by rjmusto on April 28 2006,20:17
Ok, but do you have to edit the file from within the console? If so, how.

I've tried logging on as Root in console and then using Ted to edit the file, but that doesn't work.

Sorry, bit of a novice at this!

Posted by fivel256 on April 28 2006,20:44
so from a console do sudo su
then do a vi "/your/file/name"


"THIS IS NOT A vi TUTORIAL" when in doubt google vi tutorials


that will open your file in the vi text editor. you should be able to use the arrow keys to move in this mode. If not h j k l will move you around


quick key reference

x = delete
i = insert
esc = get out of insert mode
: = command mode

to quit and save type

:w
:q

yah I know its pretty rough but without the man pages what can you do?

Posted by rjmusto on April 29 2006,18:07
Thanks for that.

VI works fine.

Having modified the conf file I assume it is necessary to restart smb in order to pick up the changes. How do I do that?

I've seen other LINUX posts using the 'service' command to restart smb, but that does not seem to be implemented in DSL.

Posted by linux4all on April 29 2006,21:05
Quote (rjmusto @ April 29 2006,14:07)
Thanks for that.

VI works fine.

Having modified the conf file I assume it is necessary to restart smb in order to pick up the changes. How do I do that?

I've seen other LINUX posts using the 'service' command to restart smb, but that does not seem to be implemented in DSL.

I'm still wrestling with this. I'm sure I'll be able to somehow edit the smb.conf file, but I'm wondering what exactly to put into it. Can I assume that i can copy entries from a smb.conf file from another system... in my case, a Xandros distribution, which is also a Debian Distro?
If I do this, then to share a Fat32 windows drive F:, I should add the following entries to my smb.conf file

[F]
public=yes
browseable=yes
path=path-to-F
writeable=yes
force user=dsl
max connections=0
available=yes

Will that do the trick, or do I need to add more to smb.conf to get it to work.

Does anyone know how to restart samba in dsl, or is it the same as in the normal samba man pages?

Thanks for helping out a new linux user.

Posted by rjmusto on April 29 2006,21:19
Wrestling is a good term - me too.  Have got as far as the DSL machine is now shown as a workgroup computer on the Windows machines, but not managed to configure the shares right yet, so can't view anything.

Restarting SAMBA I now know is:

smbd restart &
nmbd restart &

Just make sure your logged on as SUDO SU on Aterminal first.

Hope you sort it out!

Posted by dtf on April 29 2006,21:41
Here is the simplest smb.conf file I have come up with.  However, it is not really secure but my network is behind a router firewall using a private ip address.

[QUOTE]
[global]

Posted by dtf on April 29 2006,22:15
[global]
     # this sets the work group and should match you windows work group
     workgroup = <your work group>

      # this string show up in your network neiborhood
      server string = <discriptive string>

       # 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 = yes
        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

[kinux-share]
       comment = Kinux-box share
       path = /mnt/sda1/public/kinux_share
       guest ok = yes
       read only = no

Posted by rjmusto on April 29 2006,22:32
Hmm, nice idea.

I tried it and could view the DSL machine in network neighbourhood on Windows, but can't view anything. It keeps asking for a password.

Have changed the [global] settings to:

security = share
workgroupe = (my workgroup)

and I can now view the directory on the DSL machine, but can't write to it.

Have tried adding this to the directory settings:

public = yes
writable = yes
read only = no

but hasn't made any difference.

Any suggestions?

Posted by rjmusto on April 29 2006,22:34
.... sorry these posts overalapped......
Posted by dtf on April 29 2006,22:40
Make sure you permissions are set correctly.  You need to make sure your directory is writable.

root@box:/etc/samba# ls -lstd /mnt/sda1/public/kinux_share
  4 drwxrwxrwx    6 dsl      staff        4096 Apr 29 01:08 /mnt/sda1/public/kinux_share

Posted by dtf on April 29 2006,22:43
Also I was stuck on the password bussiness for a while.  In my case the key was setting the encryption to yes like in the examble I posted earlier. Also you need to set up the user and password with smbpasswd.
Posted by linux4all on April 30 2006,19:02
Quote (dtf @ April 29 2006,18:43)
Also I was stuck on the password bussiness for a while.  In my case the key was setting the encryption to yes like in the examble I posted earlier. Also you need to set up the user and password with smbpasswd.

At this point, we seem to have turned this thread into a tutorial discussion on samba configuration, using the smb.conf file. I went searching on the internet for more information, and came across the following Samba How-to, which seems to have answered all of my questions... (though I have yet to try it all in DSL). I think each of us would be well served to read through this document. It seems to cover just about everything we are discussing here. The article I'm referring to is at the following web address:

< http://www.ibiblio.org/pub....TO.html >

Thank you all for the help you have provided. It looks like the DSL version of Samba works pretty much the same as in my other Debian Distro.

Dick

Posted by rjmusto on April 30 2006,20:44
Yes it does seem to be a how-to on getting DSL to communicate with Windows - but then there does seem to be a lot of queries on the forum on this topic.

My set-up does work now in that the DSL drive is fully accessible from all Windows machines on the network, though to be honest I'm not sure now what change did the trick in the end. Like dtf I use a hardware firewall, so am not too bothered about users and passwords. I would not recommend this on an open system.

For what it's worth, my smb.conf file looks like this;

[DSL_Share]
path = /mnt/hda1
guest ok = yes
read only = no
public = yes
writable = yes

[global]
security = share
workgroup = <myworkgroup>


That's it, very simple! Also make sure the permissions are set to writable in the file manager.

Hope that's usefull to somebody and thanks for the help.

R

Posted by dtf on April 30 2006,22:07
linux4all - thanks for the link.  When I get some time I look forward to going through it.

rjmusto - happy to hear you got it working.  I have convince myself that changes you make in the smb.conf file are not instancely propagated through the network.  I know this is true of other network protocols but not sure about samba.  My point being that when you say that you are not sure of what did the trick, it could be that you didn't see the change in the network instancely but it did show up eventually.

Setting this up can be frustrating at times but for me DSL+samba running on a mini-itx platform provides a nice file/print server that is quite and comsumes minimal power.

Posted by linux4all on May 02 2006,15:28
Quote (rjmusto @ April 29 2006,14:07)
Thanks for that.

VI works fine.

Having modified the conf file I assume it is necessary to restart smb in order to pick up the changes. How do I do that?

I've seen other LINUX posts using the 'service' command to restart smb, but that does not seem to be implemented in DSL.

Just for your info, If you want to use another editor other than VI to edit the smb.conf file, just copy the file to your home directory, then edit that file, and when you are done, go to an administrator console and copy it back over the old copy.

Dick.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.