Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unable to set up a simple Samba share
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
suttewal
n00b
n00b


Joined: 10 Jul 2009
Posts: 32

PostPosted: Sun Feb 23, 2014 7:45 pm    Post subject: Unable to set up a simple Samba share Reply with quote

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:
Code:

[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.
Code:

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
Back to top
View user's profile Send private message
costel78
Guru
Guru


Joined: 20 Apr 2007
Posts: 310

PostPosted: Sun Feb 23, 2014 8:44 pm    Post subject: Reply with quote

"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.
_________________
Sorry for my English. I'm still learning this language.
Back to top
View user's profile Send private message
suttewal
n00b
n00b


Joined: 10 Jul 2009
Posts: 32

PostPosted: Sun Mar 02, 2014 1:58 pm    Post subject: Reply with quote

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:
Code:

# 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.

Code:

# 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. :D

Code:

# 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... :?

Walter
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum