usershares guest_ok=y results in "Permission denied" error

Bug #389049 reported by Mihai Capotă
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: samba

Usershare having guest_ok=y cannot be mounted as guest. I have the default smb.conf from Jaunty which includes:
usershare allow guests = yes

I tried creating such a share using both nautilus and net usershare. The resulting file is identical:
mihai@dutier:~$ cat /var/lib/samba/usershares/public
#VERSION 2
path=/home/mihai/Public
comment=
usershare_acl=S-1-1-0:R
guest_ok=y

I tried accessing the usershare using:
-nautilus
Can't mount location
Failed to mount Windows share

-mount.cifs
mihai@dutier:~$ sudo mount.cifs //dutier/public Media/tmp/ -o guest
retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

-smbclient
mihai@dutier:~$ smbclient -N //dutier/Public
Anonymous login successful
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.3.2]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

Every time I get the same error in the samba log:
[2009/06/18 17:24:41, 0] smbd/service.c:make_connection_snum(1073)
  '/home/mihai/Public' does not exist or permission denied when connecting to [public] Error was Permission denied

I can access the same usershare using a username:
-mount.cifs
mihai@dutier:~$ sudo mount.cifs //dutier/public Media/tmp/ -o user=mihai

-smbclient
mihai@dutier:~$ smbclient //dutier/Public
Enter mihai's password:
Domain=[DUTIER] OS=[Unix] Server=[Samba 3.3.2]
smb: \>

ProblemType: Bug
Architecture: amd64
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia
Package: samba 2:3.3.2-1ubuntu3
ProcEnviron:
 LANG=ro_RO.UTF-8
 SHELL=/bin/bash
SourcePackage: samba
Uname: Linux 2.6.28-11-generic x86_64

Revision history for this message
Mihai Capotă (mihaic) wrote :
Revision history for this message
Mihai Capotă (mihaic) wrote :

At least one other person has the same problem:
https://bugs.launchpad.net/ubuntu/+source/samba/+bug/204703/comments/4

Revision history for this message
Montel Edwards (montel) wrote :

Hello and thank you for finding that duplicate and making it aware. In the future though please take the liberty of marking your bug a duplicate of that bug as soon as you find it. That would help greatly.

Thanks
-Montel

Revision history for this message
Mihai Capotă (mihaic) wrote :

@Montel Edwards
The commenter from the other bug I was referring too was advised to open a separate bug:
https://bugs.launchpad.net/ubuntu/+source/samba/+bug/204703/comments/5

Revision history for this message
Thierry Carrez (ttx) wrote :

@Mihai: thanks for reporting this bug.

Does:
$ sudo mount.cifs //dutier/public Media/tmp/ -o sec=none
work any better ?

What are the permissions on the public shared directory:
$ ls -ld /home/mihai
$ ls -ld /home/mihai/Public

Changed in samba (Ubuntu):
status: New → Incomplete
Revision history for this message
Mihai Capotă (mihaic) wrote :

mihai@dutier:~$ ls -ld /home/mihai/
drwx------ 86 mihai mihai 12K 2009-06-18 20:37 /home/mihai/
mihai@dutier:~$ ls -ld /home/mihai/Public/
drwxr-xr-x 2 mihai mihai 4,0K 2009-06-18 14:28 /home/mihai/Public/

I added the execute bit on /home/mihai and it now works.
Since the permission was there by default and I removed it, I'm marking this bug as invalid.

Revision history for this message
Mihai Capotă (mihaic) wrote :

mihai@dutier:~$ ls -ld /home/mihai/
drwx------ 86 mihai mihai 12K 2009-06-18 20:37 /home/mihai/
mihai@dutier:~$ ls -ld /home/mihai/Public/
drwxr-xr-x 2 mihai mihai 4,0K 2009-06-18 14:28 /home/mihai/Public/

I added the execute bit on /home/mihai and it now works.
Since the permission was there by default and I removed it, this bug as invalid.

Changed in samba (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
Dusan Maliarik (dusan-maliarik) wrote :

I got this same problem with Karmic, while it apparent what's the problem, people usually share folders in their home directories, so I guess nautilus' sharing extension should inform users when creating/modyfying shares, and offer them permission changes

Revision history for this message
psypher (psypher246) wrote :

fyi for anyone else having this issue, in my case the problem was caused by me setting chmod -R 700 on my home folder, just doing chmod 755 on my home fixed it.

Revision history for this message
Sergio Fernández Marcos (sfmarcos) wrote :

It's not necessary to give 755 permissions to your home folder. It works with 711 (setting execute bit for all users).

Revision history for this message
Anton Belyaev (anton-belyaev) wrote :

Yes, execute bit is enough.

While Nautilus in Gnome offers to set some permissions automatically for the shared folder, it does not set it for parent (home) folder.

Somehow after a fresh install permissions for my home were drwx------.
For newly created desktop users (after the installation), their home permissions were drwxr-xr-x.

I have a question: doesnt setting X bit violate any privacy for me? I would like to share a single directory in my home without loosening permissons for the rest of home.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.