# samba question

## green_buddy

Hi everyone,

I'm recently new to samba... went through the samba setup documentation in the desktop configuration guide and got it configured and able to connect to my samba fileserver from my windows box in about a 1/2 hour.  Everything works great, and am very happy as now I have a raid1 mirror to backup all my schit!   :Cool: 

So here's the question, I also want to backup all my mp3's and use the fileserver as an mp3 server on my home lan so I can start consolidating space and reducing redundancy, but instead of connecting to my home directory I want to be able to connect to an mp3 directory and not just as user green, but I want every machine on my lan (regardless of username) to be able to access it.  Is this what samba is for, or am I getting ahead of myself?  It would seem that it is, but I'm unsure at this point.

Thanks,

-green

----------

## paranode

Well if you don't want them to be the user green then you'd have to set up another limited user account I suppose.

----------

## steveb

hmmm... then just allow guest connections to that mp3 share.

cheers

SteveB

----------

## green_buddy

Ok, maybe my question is too complex.  Let's try and break this down a bit...

How do I (as any user) access a directory on a linux samba fileserver from a windows box?

As far as I currently understand the only directory I can access is 

```
/home/green
```

, but I'm thinking that there's something I'm missing here.   :Confused: 

-green

----------

## green_buddy

 *steveb wrote:*   

> hmmm... then just allow guest connections to that mp3 share.

 

Ok, here we go, there is something I'm missing here... how do I do that?  Where's that documentation?

Thanks steveb,

-green

----------

## steveb

ahhh... okay. now i get it.

lets say you want to have a share called mp3 and that share should be open (read/writable) to everyone:

```
[mp3]

        comment = My MP3 directory

        path = /local/samba/mp3 

        force user = nobody 

        force group = nobody 

        read only = No 

        writable = Yes 

        printable = No 

        guest ok = Yes 

        case sensitive = Yes 

        browseable = Yes 

        inherit permissions = Yes 

        create mask = 0777 

        force create mode = 0777 

        security mask = 0777 

        force security mode = 0777 

        directory mask = 0777 

        force directory mode = 0777 

        directory security mask = 0777 

        force directory security mode = 0777
```

after you would restart samba, your local directory (/local/samba/mp3) is now mountable over samba as share mp3 (\\server\mp3).

is that enought for you? let me know if you need more info.

cheers

SteveB

----------

## green_buddy

 *steveb wrote:*   

> ahhh... okay. now i get it.
> 
> lets say you want to have a share called mp3 and that share should be open (read/writable) to everyone:
> 
> ```
> ...

 

Ahhhhhhh... yes!   :Very Happy:  That's exactly what I was looking for.  Do I put that block in my smb.conf file somewhere?  Is there documentation concerning the different directory security masks. So that I can play around with the chmod settings to get things just so.  Like, I'd want people to do just about anything they want underneath /local/samba/mp3, but I wouldn't want them to be able to delete /local/samba/mp3, or go anywhere else in the server per se... like into /local/samba/mp3/.. (which is just /local/samba/).

Also, is it common to put things in /local/samba/<share dir>?  What about another directory hierarchy like /usr/share?  I mean, I know there's probably no rules behind this, but I don't want to be creating schit all over the place in my filesystem you know?

Thanks for your great help here!   :Cool: 

-green

----------

## steveb

yes! you need to add that to your smb.conf file....

on my old redhat server the smb.conf looks like this:

```
# Global parameters

[global]

        workgroup = XXXXX

        netbios name = REDHAT

        server string = %h (RH v7.1/Samba v%v)

        interfaces = 192.168.0.108/24

        encrypt passwords = Yes

        null passwords = Yes

        passwd program = /usr/bin/passwd %u

        passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*

        username map = /etc/samba/smbusers

        username level = 20

        unix password sync = Yes

        log file = /var/log/samba/log.%m

        max log size = 50

        time server = Yes

        socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

        character set = iso8859-1

        client code page = 850

        domain admin group = @smb-admin

        add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u

        logon script = scripts\XXXXX.bat

        logon path = \\%L\Profiles\%U

        logon drive = H:

        domain logons = Yes

        os level = 64

        preferred master = Yes

        domain master = Yes

        dns proxy = No

        wins support = Yes

        admin users = @smb-admin

        printer admin = @smb-admin

        hosts allow = 192.168.0.0/24 127.0.0.1

        hosts deny = 0.0.0.0/0

        log level = 1

        read raw = yes

        write raw = yes

        oplocks = yes

        max xmit = 65535

        dead time = 15

        getwd cache = yes

        valid chars = 148:153 132:142 129:154 255

[ipc$]

        hosts allow = 192.168.0.0/24 127.0.0.1

        hosts deny = 0.0.0.0/0

[homes]

        comment = Home Directories

        read only = No

        force create mode = 0755

        force directory mode = 0755

        guest ok = Yes

        browseable = No

[netlogon]

        comment = Network Logon Service

        path = /local/samba/netlogon

        write list = @smb-admin

        guest ok = Yes

        locking = No

        oplocks = No

        share modes = No

[profiles]

        comment = Profiles

        path = /local/samba/profiles

        read only = No

        create mask = 0600

        directory mask = 0700

        guest ok = Yes

        browseable = No

[printers]

        comment = All Printers

        path = /var/spool/samba

        printable = Yes

        browseable = No

[tmp]

        comment = Temporary file space

        path = /local/samba/tmp

        read only = No

        guest ok = Yes

[public]

        comment = Public Stuff

        path = /local/samba/public

        read only = No

        create mask = 0777

        force create mode = 0777

        force security mode = 0777

        directory mask = 0777

        force directory mode = 0777

        force directory security mode = 0777

        inherit permissions = Yes

        guest ok = Yes

[print$]

        comment = Support the uploading of printer driver files

        path = /local/samba/printers

        write list = @smb-admin

        guest ok = Yes

[bkoffice]

        comment = Back Office

        path = /local/samba/public/Back-Office

        valid users = XXXXX,root,XXXXX,@smb-admin,@smb-backoffice

        admin users = XXXXX,root,XXXXX,+smb-admin,+smb-admin,+smb-backoffice

        force user = smb-admin

        force group = smb-backoffice

        read only = No

        create mask = 0770

        force create mode = 0770

        security mask = 0770

        force security mode = 0770

        directory mask = 0770

        force directory mode = 0770

        directory security mask = 0770

        force directory security mode = 0770

        inherit permissions = Yes

        only user = Yes

        map system = Yes

        browseable = No

[HPLJ8150DN_PCL]

        comment = HP LaserJet 8150 PCL 6/5e

        path = /var/spool/samba

        read only = No

        guest ok = Yes

        printable = Yes

        printer name = HPLJ8150DN_PCL

        printer driver = HP LaserJet 8150 PCL 6

        printer driver location = \\%h\print$

[HPLJ8150DN_PS]

        comment = HP LaserJet 8150 PS

        path = /var/spool/samba

        read only = No

        guest ok = Yes

        printable = Yes

        postscript = Yes

        printer name = HPLJ8150DN_PS

        printer driver = HP LaserJet 8150 PS

        printer driver location = \\%h\print$

[domappl]

        comment = Domino Application Directory

        path = /opt/lotus/bin

        username = root,XXXXX,XXXXX,XXXXX

        write list = root,XXXXX,XXXXX,XXXXX

        read only = No

        create mask = 0777

        directory mask = 0777

        inherit permissions = Yes

        only user = Yes

        case sensitive = Yes

        browseable = No

[domdata]

        comment = Domino Data Directory

        path = /local/notesdata

        username = root,XXXXX,XXXXX,XXXXX

        write list = root,XXXXX,XXXXX,XXXXX

        read only = No

        create mask = 0777

        directory mask = 0777

        inherit permissions = Yes

        only user = Yes

        browseable = No

[telcdinst]

        comment = Telinfo 11/00 Net, Installation CD-ROM

        path = /local/samba/cd-mounted/telcdinst

        create mask = 0777

        force create mode = 0777

        force security mode = 0777

        directory mask = 0777

        force directory mode = 0777

        force directory security mode = 0777

        inherit permissions = Yes

        guest ok = Yes

[telcddata]

        comment = Telinfo 11/00 Net, Daten CD-ROM

        path = /local/samba/cd-mounted/telcddata

        create mask = 0777

        force create mode = 0777

        force security mode = 0777

        directory mask = 0777

        force directory mode = 0777

        force directory security mode = 0777

        inherit permissions = Yes

        guest ok = Yes

[gentoo.distfiles]

        comment = Gentoo Linux distfiles

        path = /local/samba/public/Projekte/Linux/gentoo.distfiles

        create mask = 0777

        force create mode = 0777

        force security mode = 0777

        directory mask = 0777

        force directory mode = 0777

        force directory security mode = 0777

        inherit permissions = Yes

        guest ok = Yes

[cd1]

        comment = Virtual CD-ROM 1

        path = /local/samba/cd-mounted/cd1

        create mask = 0777

        force create mode = 0777

        force security mode = 0777

        directory mask = 0777

        force directory mode = 0777

        force directory security mode = 0777

        inherit permissions = Yes

        guest ok = Yes

[cd2]

        comment = Virtual CD-ROM 2

        path = /local/samba/cd-mounted/cd2

        create mask = 0777

        force create mode = 0777

        force security mode = 0777

        directory mask = 0777

        force directory mode = 0777

        force directory security mode = 0777

        inherit permissions = Yes

        guest ok = Yes

[cd3]

        comment = Virtual CD-ROM 3

        path = /local/samba/cd-mounted/cd3

        create mask = 0777

        force create mode = 0777

        force security mode = 0777

        directory mask = 0777

        force directory mode = 0777

        force directory security mode = 0777

        inherit permissions = Yes

        guest ok = Yes

[cd4]

        comment = Virtual CD-ROM 4

        path = /local/samba/cd-mounted/cd4

        create mask = 0777

        force create mode = 0777

        force security mode = 0777

        directory mask = 0777

        force directory mode = 0777

        force directory security mode = 0777

        inherit permissions = Yes

        guest ok = Yes
```

i changed some stuff to XXXXX inside this smb.conf for privacy reasons....

for samba documentation go to http://www.samba.org/ and look there (i use http://samba.epfl.ch/samba/docs/)

for samba as pdc have a look at this nice tutorial from ibm: http://www-1.ibm.com/servers/esdd/tutorials/samba.html

i don't like to put things in /usr/ since /usr/ is the synonym for unix system ressources and i don't see mp3 to be a system resource  :Wink: 

cheers

SteveB

----------

## green_buddy

Hey steveb... thanks a ton for all your help!  Great stuff!  I appreciate it a ton!   :Very Happy: 

-green

----------

## steveb

 *green_buddy wrote:*   

> Hey steveb... thanks a ton for all your help!  Great stuff!  I appreciate it a ton!  
> 
> -green

 no problem  :Smile: 

this is the reason, the forum is here.

cheers

SteveB

----------

## elfy

Things that help me a lot in configuring these smb shares are Webmin and SWAT.

http://www.webmin.com for a good time!

or you can simply 

```
emerge webmin
```

eh?

----------

