# Unable to set up a simple Samba share

## suttewal

Hi folks,

I've got a nasty problem with my Samba server. 

All I want to do is creating a shared folder for the clients in my network.

So, I started up by adding a new group "samba" and a new user "samba", with home "/home/samba" and shell "/bin/false". I added my own user and the "samba" user to group "samba".

Next, I created a folder called "/home/samba/share" and changed ownership to user "samba" and group "samba". I also changed permissions to 0770.

Finally, I set up smb.conf as follows:

```

[global]

        workgroup = Workgroup

        server string = Samba Server %v

        passdb backend = smbpasswd

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

        max log size = 1000

        idmap config * : backend = tdb

[share]

        comment = Public share

        path = /home/samba/share

        valid users = samba

        read list = samba

        write list = samba

        read only = No

        create mask = 0770

        case sensitive = No

```

I eventually started Samba server successfully.

Seems simple and straight forward, however, I cannot connect to the Samba server from e.g. my laptop which has Gentoo/KDE installed. If I try to connect via Dolphin, it spills out a "Timeout on server" error. If I try to mount it manually with the following command, it leads to a "Permission denied" error.

```

mount -t cifs //192.168.1.38/share /mnt/share

```

I know issues like that have been discussed millions of times before. However, I believe that eventually something else but Samba is causing the trouble...

iptables is down on both machines, so that is not the problem...

Any clues are appreciated.

Walter

----------

## costel78

"Permission denied" make me think to:

1. maybe group/users are not ok and you should try with mount -t cifs //192.168.1.38/share /mnt/share  -o username=samba 

2. or you omitted to add samba user to samba itself using pdbedit, for example. Samba have it's own users, different from system ones.

----------

## suttewal

Thanks costel78, and sorry for this very late reply. I couldn't manage to get back to this issue any earlier...

In the meantime, I figured out how to set up my Samba environment. This is what I did:

```

# groupadd smbusers

# groupadd smbguests

# groupadd smbadmins

# useradd -m -c "Public Samba user" -G samba -g smbusers samba

# useradd -G smbadmins my_user

# useradd -G smbusers my_user

# net groupmap add ntgroup="Domain Users" unixgroup=smbusers rid=512 type=d

# net groupmap add ntgroup="Domain Guests" unixgroup=smbguests rid=512 type=d

# net groupmap add ntgroup="Domain Admins" unixgroup=smbadmins rid=512 type=d

# pdbedit -a samba

```

I then configured my smb.conf. After having done so, I restarted Samba and checked the configuration by using the testparm command.

```

# testparm 

Load smb config files from /etc/samba/smb.conf

rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)

Processing section "[homes]"

Processing section "[netlogon]"

WARNING: The "share modes" option is deprecated

Processing section "[Profiles]"

Processing section "[share]"

Loaded services file OK.

WARNING: 'workgroup' and 'netbios name' must differ.

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

                                                                                                                                                                                                                                                   

[global]

        workgroup = KASSIOPEIA

        server string = Kassiopeia Samba Server %v

        guest account = samba

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

        max log size = 1000

        idmap config * : backend = tdb

        hosts allow = 192.168.1.

[homes]

        comment = Home Directories

        read only = No

[netlogon]

        comment = Network Logon Service

        path = /var/lib/samba/netlogon

        guest ok = Yes

        share modes = No

[Profiles]

        path = /var/lib/samba/profiles

        guest ok = Yes

        browseable = No

[share]

        comment = Public shared folder

        path = /path/to/my/shared/folder

        valid users = samba

        read list = samba

        write list = samba

        read only = No

        create mask = 0770

        case sensitive = No

```

I hope that makes sense. At least, that's what I figured from studying the Samba manuals. If there is anything wrong with that, please tell me.

I am now able to mount the shared folder on my laptop using your command.   :Very Happy: 

```

# mkdir /mnt/share

# mount -t cifs //192.168.1.38/share /mnt/share -o umask=0022,uid=my_user_id,gid=my_group_id -o username=samba

```

However, I doesn't work with dolphin. When I try to access smb://kassiopeia/, it still gives me a "Timeout on server" error. Can't figure out the reason for that behaviour...   :Confused: 

Walter

----------

