# [SOLVED] Samba on Gentoo

## C5ace

I am new to Gentoo.

My home network consists of 4 OpenSuse 12.2 PC's with Gnome Desktops running Samba and 2 Win7 in VirtualBox. The users can share and unshare directories such as ~/Downloads, ~/Videos, ~/Documents/spreadsheets, etc. with right clicking in Nautilus, Thunar or Windows Explorer on the relevant directory and grand or withdraw the share (read/write) permission for the other users on the LAN.  The users can, without password as "guest" connect to, list, download and upload files from and to other user's shared directories by clicking on "Browse Network" and selecting the desired PC and Share from the list. 

I wish to replace OpenSuse with Gentoo (Xfce Desktop) because of Bloat and the requirement to re-install and configure every year or so a new version of the OS and all applications on all on all 4 PC's.

I installed for testing Gentoo with Xfce Desktop on a virtual machine. All works fine and can be configured as users want and need, except SAMBA, following the various HowToo's and postings. 

I kindly ask for:

1.) The list of the items to emerge.

2.) The applicable smb.config and other configuration files.

This is the smb.conf file from my OpenSuse PC's:

```

/etc/samba/smb.conf

# smb.conf is the main Samba configuration file. You find a full commented

# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the

# samba-doc package is installed.

# Date: 2012-08-08

[global]

   workgroup = WORKGROUP

   name resolve order = bcast host

   passdb backend = tdbsam

   printing = cups

   printcap name = cups

   printcap cache time = 750

   cups options = raw

   map to guest = Bad User

   logon path = \\%L\profiles\.msprofile

   logon home = \\%L\%U\.9xprofile

   logon drive = P:

   usershare allow guests = Yes

   security = domain

   usershare max shares = 100

   netbios name = PROXY-64

   wins support = Yes

[homes]

   comment = Home Directories

   valid users = %S, %D%w%S

   browseable = No

   read only = No

   inherit acls = Yes

[profiles]

   comment = Network Profiles Service

   path = %H

   read only = No

   store dos attributes = Yes

   create mask = 0600

   directory mask = 0700

[users]

   comment = All users

   path = /home

   read only = No

   inherit acls = Yes

   veto files = /aquota.user/groups/shares/

[groups]

   comment = All groups

   path = /home/groups

   read only = No

   inherit acls = Yes

[printers]

   comment = All Printers

   path = /var/tmp

   printable = Yes

   create mask = 0600

   browseable = No

[print$]

   comment = Printer Drivers

   path = /var/lib/samba/drivers

   write list = @ntadmin root

   force group = ntadmin

   create mask = 0664

   directory mask = 0775

```

Examples of:

/var/lib/samba/usershares/documents:

```

#VERSION 2

path=/home/jack/Documents

comment=

usershare_acl=S-1-1-0:F

guest_ok=y

sharename=Documents

```

/var/lib/samba/usershares/downloads:

```

#VERSION 2

path=/home/jack/Downloads

comment=

usershare_acl=S-1-1-0:F

guest_ok=y

sharename=Downloads

```

3.) This is the fstab file from my OpenSuse PC's: 

```

/dev/md1    swap                swap     defaults        0 0

/dev/md2    /                   ext4     acl,user_xattr  1 1

/dev/md0    /boot               ext4     acl,user_xattr  1 2

/dev/md3    /home               ext4     acl,user_xattr  1 2

proc        /proc               proc     defaults        0 0

sysfs       /sys                sysfs    noauto          0 0

debugfs     /sys/kernel/debug   debugfs  noauto          0 0

usbfs       /proc/bus/usb       usbfs    noauto          0 0

devpts      /dev/pts            devpts   mode=0620,gid=5 0 0

/dev/md4    /VirtualBox         ext4     acl,user_xattr  1 2

/dev/sdd9   /mnt/sdd9           ext4     defaults        1 2

```

4.) This is the fstab file from my Gentoo PC:

```

# <fs>      <mountpoint>  <type>  <opts>          <dump/pass>

/dev/sda1   /boot         ext4    noauto,noatime  1 2

/dev/sda6   /             ext4    noatime         0 1

/dev/sda7   /home         ext4    noatime         0 2

/dev/sda5   none          swap    sw              0 0

/dev/cdrom  /mnt/cdrom    auto    noauto,user     0 0

# /dev/fd0  /mnt/floppy   auto    noauto          0 0

```

Thanks in advance for your help.Last edited by C5ace on Sun Dec 29, 2013 7:00 am; edited 2 times in total

----------

## dataking

You should use code tags when posting config files to help separate post content.  Moderators?

----------

## C5ace

 *dataking wrote:*   

> You should use code tags when posting config files to help separate post content.  Moderators?

 

Done.

Have a Merry Christmas.

----------

## Tony0945

From one of my machines:

```
 emerge -pv samba

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R    ] net-fs/samba-3.6.22  USE="acl aio client cups fam netapi pam readline server smbclient syslog winbind -addns -ads -avahi -caps -cluster -debug -dmapi -doc -examples -ldap -ldb -quota (-selinux) -smbsharemodes -swat" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

```

I can't say this is perfect because samba seems to require a windows machine on the network, but at least windows can see and share with the Gentoo machines.

My /etc/samba/smb.conf is 543 lines but this part may be relevant:

```
   hosts allow = 192.168.0.  127.

   allow hosts = 192.168.0.100 192.168.0.102   127.

```

Are you having emerge problems? Or problems running? (did you do rc-update?) or problems connecting? If so, Windows to Linux or Linux to Windows or Linux to Linux?

----------

## 666threesixes666

just make sure to enable samba use flag in /etc/portage/make.conf

then 

(as root)

emerge -avuND world

i use xfce4 with some gnome apps, thunar with gvfs + samba use flag makes it so i can browse through shares  i did previous works on samba to get right clicking auto shares working but i haven't gone over that recently.

----------

## cwr

I use Samba without a Windows box around, although my laptop also logs into

Windows WORKGROUP domains without problems.  Adding "samba" to the

make.conf USE flags pulls in a lot of code, but is probably the best way to

start debugging the setup. If you just want to access a Samba server, then

cifs-utils will do the job.

There was a period a few years ago when Samba had problems updating

file status, but apart from that it's been entirely solid. 

Will

----------

## C5ace

Thanks everyone for the inspirations. The system now works. I will rebuild and document the installation during the next week or so and post the the various configuration files to be used by others as a simple "howto".

----------

## Tony0945

Looking forward to it, C5ace.

----------

