Hello,
I’ve been trying to solve this issue with accessing a samba share from a windows 7 box.
Samba is on a openSuse 13.1 computer and /mnt/media is shared.
From windows 7 I enter the IP of the suse server and enter my samba user name and password. It then shows me the share media. But when I double click it it says I don’t have permission to access \192.268.xxx.xxx\media.
Here is my smb.conf file
[global]
passdb backend = tdbsam
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
domain logons = No
domain master = No
security = user
usershare allow guests =No
map to guest = bad use
[Media]
comment = mnt media
path = /mnt/media
valid users = bstent
force group = users
writable = yes
Here are the permissions on the /mnt/media
drwxrwxrwx 13 bstent media 4096 Mar 9 16:49 .
drwxr-xr-x 4 root root 4096 Mar 9 14:27 …
drwxrwxrwx 4 bstent media 4096 Feb 10 17:13 .Trash-1000
drwxrwxrwx 6 bstent media 4096 Mar 9 19:50 Files and Software
drwxrwxrwx 19 bstent media 4096 Mar 12 17:04 Movies
drwxrwxrwx 297 bstent media 20480 Mar 3 08:29 Music
drwxrwxrwx 67 bstent media 12288 Jan 23 14:35 Pictures
I have no idea what I’m doing wrong but I’m sure it’s a simple over sight or misunderstanding of permissions.
Please help me if you can. it is much appreciated.
I don’t see any particular problem in your smb.conf file and in your share permissions. Did you add bstent to the Samba user database using smbpasswd as root?
Thanks for your reply.
I have added bstent to the smbpasswd when I enter \192.168.0.2 in windows explorer it asks for a username /password. I enter the one I used for bstent and then it presents me with the media share. When I go to click on that it says I don’t have permission to access the folder.
I’m not sure how this can be so difficult. I’m sure I’m missing something simple…
As you added bstent to the Samba user database, I read the contents of your smb.conf again, and I found two possible issues:
[global]
passdb backend = tdbsam
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
domain logons = No
domain master = No
security = user
usershare allow guests =No
**map to guest = bad use**
[Media]
comment = mnt media
path = /mnt/media
valid users = bstent
writable = yes
The first issue is a typo I think, the correct value for map to guest is bad user. The second isn’t really an issue, but the permissions on /mnt/media show the group media as its group class. Maybe you should force group to media in the share definition?
If you still can’t access to the Media share from your Windows 7 computer, you should increase Samba verbosity by setting the parameter log level to 2 in the global section of your smb.conf file. Then:
check your smb.conf file with testparm (just in case)
restart smbd deamon
wait for a minute
attempt a connection to the Media share with you Windows 7 computer
check Samba smbd deamon log in /var/log/samba (if I remember well, otherwise check log files’ location with smbd -b | grep LOGFILEBASE)
Of course, we will be happy to help you if you share with us the content of the log file. In that case, please copy its content between CODE tags (tag usage: [TAG]text[/TAG]).
I tired your edits thanks, but still am getting blocked. I did create the logs and here is what they look like after I attempt to connect to the media share.
before you view the logs I thought I’d should post my mount settings from /etc/fstab just to be sure there isn’t an option there that is causing the problem. I am a newb after all
suseserv:/home/bstent/log # cat samba.log.bstent
[2014/03/14 15:33:37.726651, 2] …/source3/smbd/service.c:848(make_connection_snum)
bstent (ipv4:192.168.222.55:27926) connect to service Media initially as user bstent (uid=1000, gid=1000) (pid 5827)
Good idea! That could explain a lot. Samba Wiki recommends to mount ext4 filesystems with acl an user_xattr options [1]. Futhermore, as users option automaticaly disables some features, my recommendation is to change /dev/sdb1 line in /etc/fstab to:
/dev/sdb1 /mnt/media ext4 acl,user_xattr 0 2
Note that the sixth field should have a value of 2 for filesystems other than the root filesystem (such as /dev/sdb1 and /dev/sdc1). See man fstab for details.
Don’t forget to make a copy of your /etc/fstab before any modification. I won’t like to be responsible of an unbootable system!
So authentification works. From your previous post we know that permissions on the share are OK. I hope changing the mount options will fix the problem, otherwise we will start to run in circles!
I think I’m having a similar issue, and no solutions as of yet as well:
My goal is sharing a r/w directory of my htpc for everyone
my smb.conf:
[global]
workgroup = WORKGROUP
netbios name = HTPC
passdb backend = tdbsam
map to guest = Bad User
log file = /var/log/samba/log.%m
[shared1]
path = /srv/samba/
read only = No
guest ok = Yes
guest only = Yes
[shared2]
path = /home/balint
read only = No
guest ok = Yes
guest only = Yes
This allows me to see the 2 shares, but I’m only able to enter 1 of them, the one in my home directory: http://i58.tinypic.com/149sj0j.png
I tried your recommendations to no avail. Before I re-post my current configs. I do want to mention like the other poster. I can access shares that are within my home folder /home/bstent/ Its just anything outside of that I can’t access.
Here is the permission of the share.
drwxrwxrwx 13 bstent users 4096 Mar 9 16:49 media
Here is my Fstab of the drive I’m trying to access.
/dev/sdb1 /mnt/media ext4 acl,user_xattr 0 2
Here is my smb.conf (note I added the home share to test and it allows me access)
[global]
passdb backend = tdbsam
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
domain logons = No
domain master = No
security = domain
usershare allow guests = Yes
map to guest = bad user
[Media]
comment = mnt media
path = /mnt/media
valid users = bstent
force group = users
writable = yes
force group = users
guest ok = Yes
read only = No
public = yes
[bstent]
comment = bstent
inherit acls = Yes
path = /home/bstent
read only = No
guest ok = Yes
I’m not sure if OpenSuse 13.1 has some override that disables access to anything from outside the users /home folder? My firewall is also disabled if that helps.
Thanks again for troubleshooting.
It seems I’m not alone with this issue let me know if you find a solution Balint and I will do the same.
SUCCESS!!! Thank you so much to everyone who help me out with this!
I didn’t know about apparmor… I created a profile for my share using yast and then I was able to access my samba share from outside my home directory at /mnt/media with read and write access.
I know this thread will help a lot of other people out. Hopefully they will find it first before they search every samba thread on the internet like I did.
Just in case no one else sees it soon, isn’t the local class C address
space start with 192.168.X.X instead of 192.268.X.X
>
>Hello,
>I’ve been trying to solve this issue with accessing a samba share from a
>windows 7 box.
>Samba is on a openSuse 13.1 computer and /mnt/media is shared.
>From windows 7 I enter the IP of the suse server and enter my samba user
>name and password. It then shows me the share media. But when I double
>click it it says I don’t have permission to access >\192.268.xxx.xxx\media.
>
>Here is my smb.conf file
>
>[global]
>
>passdb backend = tdbsam
>add machine script = /usr/sbin/useradd -c Machine -d
>/var/lib/nobody -s /bin/false %m$
>domain logons = No
>domain master = No
>security = user
>usershare allow guests =No
>map to guest = bad use
>
>
>[Media]
>comment = mnt media
>path = /mnt/media
>valid users = bstent
>force group = users
>writable = yes
>
>Here are the permissions on the /mnt/media
>
>drwxrwxrwx 13 bstent media 4096 Mar 9 16:49 .
>drwxr-xr-x 4 root root 4096 Mar 9 14:27 …
>drwxrwxrwx 4 bstent media 4096 Feb 10 17:13 .Trash-1000
>drwxrwxrwx 6 bstent media 4096 Mar 9 19:50 Files and Software
>drwxrwxrwx 19 bstent media 4096 Mar 12 17:04 Movies
>drwxrwxrwx 297 bstent media 20480 Mar 3 08:29 Music
>drwxrwxrwx 67 bstent media 12288 Jan 23 14:35 Pictures
>
>I have no idea what I’m doing wrong but I’m sure it’s a simple over
>sight or misunderstanding of permissions.
>Please help me if you can. it is much appreciated.
>
>Regards
>Brian