THis was reported in Debian (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=423971) I can also reproduce this with the following simple smb.conf: [global] guest account = nobody invalid users = root workgroup = MAISON server string = Le portable de Kiki (samba %v) [homes] comment = Home Directories browseable = yes read only = no create mode = 0700 [public] browseable=yes comment=Public read only=no public=yes path=/var/tmp/samba-test Tests: root@mykerinos:/etc/samba> mount -t smbfs -o guest //192.168.1.3/public /mnt Anonymous login successful root@mykerinos:/etc/samba> umount /mnt root@mykerinos:/etc/samba> mount -t cifs -o guest //192.168.1.3/public /mnt --verbose parsing options: rw,guest mount.cifs kernel mount options unc=//192.168.1.3\public,ip=192.168.1.3,user=root,ver=1,rw,guest mount error 13 = Permission denied Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
The man page (for both smbfs and cifs) specifies: guest Don't prompt for a password I agree that it would make sense for cifs to retry on authentication failure with anonymous user (and also I agree that user mount should try to authenticate with the user not user, although the issue of default uid/gid when mounted to Windows ie bug 4780 needs to be fixed). My initial reaction is that the man page behavior must be followed (no prompt), and that we should attempt to authenticate with the "default" username (either root if we are mounted as root or the user's uid if we are doing a user mount) but that we should allow automatic retry (null user authentication, ie "username=" ie an empty string) if root can not authenticate due to access denied on session setup and perhaps one or two other errors (like a TConX access denied failure). If username "root" can authenticate as "guest" successfully, why retry as anonymous (null user)?
Shirish, Didn't you send a patch to me for this once (retrying failed guest mounts as anonymous userid)? Was it a kernel or userspace patch?
Bug still in samba 3.2.5 (kernel 2.6.25)
Will spend some time today on this bug and try to get resolved.
I think this depends on the server. What is the cifs/smb server? I tried it against a samba server Version 3.2.5-1.3 (smbd -V) from two different linux clients and it works. Against a samba server Version 3.0.22-3 it did not from either of those two cifs client. cifstest4 is running samba server version 3.0.22 cifstest8 is running samba server version 3.2.5 ---------------------------------------------------------------------------- cifstest6:~ # uname -r 2.6.27.8-1-default cifstest6:~ # mount -t cifs //cifstest4/share /mnt/smb_a -o guest mount error 13 = Permission denied cifstest6:~ # mount.cifs //cifstest8/smb8 /mnt/smb_a -o guest cifstest6:~ # mount //cifstest8/smb8 on /mnt/smb_a type cifs (rw,mand) ------------------------------------------------------------------------------ linux-nfs1:~ # uname -r 2.6.16.60-0.6-bigsmp linux-nfs1:~ # mount -t cifs //cifstest4/share /mnt/smb_t -o guest mount error 13 = Permission denied linux-nfs1:~ # mount -t cifs //cifstest8/smb8 /mnt/smb_t -o guest linux-nfs1:~ # mount //cifstest8/smb8 on /mnt/smb_t type cifs (rw,mand)
See additionnal details in the linked Debian bug. That bug finally turns out to be only a wishlist bug for a behaviour change wrt mount.smbfs
Created attachment 3949 [details] login as anonymous for -o guest option to mount.cifs command Fix mount.cifs code to network login as anonymous user during -o guest option of mount.cifs command
Should be fixed in current Samba development trees (3.3 and 3.2 series) and will be in next stable Samba releases (fix to mount.cifs)
*** Bug 4039 has been marked as a duplicate of this bug. ***