When debugging with smbclient I had no problem browsing around a share and doing my stuff without having a valid account on the machine. When I later tried mounting it I could not get around gettint a "-13 Access denied". After some analysing with wireshark I figured out the difference. smbclient will fall back to setting up an anonymous session when the auth fails. With mount.cifs, all I can do is supress the password prompt. (The server being tested here was Samba itself).
Same problem here. 2.6.18: 14:04 ichi:~ # mount -t smbfs //ichi/terran /mnt/0 -o guest Anonymous login successful 14:04 ichi:~ # umount /mnt/0 14:04 ichi:~ # mount -t cifs //ichi/terran /mnt/0 -o guest mount error 13 = Permission denied Refer to the mount.cifs(8) manual page (e.g.man mount.cifs) 14:04 ichi:~ # smbclient //ichi/terran Password: <empty> Anonymous login successful Domain=[NONE] OS=[Unix] Server=[Samba 3.0.22-jen] smb: \>
The kernel portion of this is fixed in the kernel cifs.ko module in cifs-2.6.git tree. Note that the parameter "guest" means "do not prompt for password" not "user a null user" (anonymous). The intent of the parm "sec=none" was to use a null user.
So if -o guest is not the same in cifs as in smbfs, what has been fixed? And why keep around a flag that has changed semantics rather severely?
This problem is still causing me trouble. uname -r 2.6.19-1.2895.fc6 (FC6's current kernel which is based on 2.6.19.2) # mount -t cifs //station11.class2/tmp /mnt -o guest,sec=none mount error 13 = Permission denied Refer to the mount.cifs(8) manual page (e.g.man mount.cifs) while # mount -t smbfs //station11.class2/tmp /mnt/tmp Password: Anonymous login successful Is it correct that the problem resided purely in kernel cifs module and that Linux merged the fix on Feb 7th 2007?
Looking closer it appears the fix went in on Nov 3rd, 2006.
See thread http://lists.samba.org/archive/linux-cifs-client/2007-February/001729.html for solution.
(In reply to comment #6) > See thread > http://lists.samba.org/archive/linux-cifs-client/2007-February/001729.html for > solution. > That is a solution to a different problem involving a mismatch between the NetBIOS name the server expects and what the client sends.
(In reply to comment #5) > Looking closer it appears the fix went in on Nov 3rd, 2006. > Well, I tried with a kernel 2.6.20 (released Feb 4th), and still no luck. # uname -r 2.6.20 # mount -t cifs //station11/tmp /mnt/tmp -o guest,sec=none mount error 13 = Permission denied Refer to the mount.cifs(8) manual page (e.g.man mount.cifs) #
This works mount -t cifs //192.168.1.149/cifsdir /cifsdir/ssp -o guest,sec=none but this does not mount -t cifs //192.168.1.149/cifsdir /cifsdir/ssp -o guest with 1.48 of cifs client on 2.6.20-rc6-default kernel on SLES10 and another SLES9 machine running samba server 3.0.24.
The problem, I think, is that "guest" just tells the userspace mount helper not to prompt for a password. It should be fairly easy to make "guest" also specify "sec=none" if no other "sec=" option is specified.
The fix for this is in latest samba git tree.
*** This bug has been marked as a duplicate of bug 4640 ***