Re: Problem mounting samba shares with PLAINTEXT password

Jeff Layton <[email protected]>
Newsgroups gmane.linux.file-systems.cifs
Message-ID <[email protected]>
On Mon, 30 Nov 2009 17:08:44 +0100
Sébastien Canchon <[email protected]> wrote:

> Try with ubuntu 9.10 and it works perfectly with 'sec=lanman'.
> 
> I have recompiled cifs-module with these 3 patchs:
> 
> [CIFS] Turn off Unicode during session establishment for plaintext
> authentication
> [CIFS] Fix plaintext authentication
> [CIFS] Re-enable Lanman security (don't sure this patch is really usefull)
> 
> And It works now.
> Perhaps do I have to submit a bug in ubuntu ?
> 

Probably. Unless you want to carry the fix yourself.

> Thanks for your help in background Jeff :-)

No problem.

> Regards,
> SC.
> 2009/11/30 Jeff Layton <[email protected]>:
> > On Mon, 30 Nov 2009 14:41:16 +0100
> > Sébastien Canchon <[email protected]> wrote:
> >
> >> Hello,
> >>
> >> I currently try to mount a samba share with plaintext auth.
> >> This works perfectly on linux box with smbfs, but I can't mount it
> >> CIFS box (like kubuntu 8.04).
> >> Under windows, with the good registry modification, I doesn't have problems.
> >>
> >> samba version installed on the client: 3.0.28a-1ubuntu4.9
> >>
> >> Here an output of 'modinfo cifs':
> >> filename:       /lib/modules/2.6.24-24-generic/kernel/fs/cifs/cifs.ko
> >> version:        1.52
> >> description:    VFS to access servers complying with the SNIA CIFS
> >> Specification e.g. Samba and Windows
> >> license:        GPL
> >> author:         Steve French <[email protected]>
> >> srcversion:     2CAF307257F44341D360511
> >> depends:
> >> vermagic:       2.6.24-24-generic SMP mod_unload 586
> >> parm:           CIFSMaxBufSize:Network buffer size (not including
> >> header). Default: 16384 Range: 8192 to 130048 (int)
> >> parm:           cifs_min_rcv:Network buffers in pool. Default: 4
> >> Range: 1 to 64 (int)
> >> parm:           cifs_min_small:Small network buffers in pool. Default:
> >> 30 Range: 2 to 256 (int)
> >> parm:           cifs_max_pending:Simultaneous requests to server.
> >> Default: 50 Range: 2 to 256 (int)
> >>
> >> CIFS module compiled with CONFIG_CIFS_WEAK_PW_HASH enabled
> >>
> >> /proc/fs/cifs/SecurityFlags setup with "39" (0x27 in Hex)
> >>
> >> added theses lines into /etc/samba/smb.conf:
> >> client plaintext auth=yes
> >> client lanman auth=yes
> >> client ntlmv2 auth=no
> >> and rebooted the box (and re-setup 39 in /proc/fs/cifs/SecurityFlags).
> >>
> >> Now, try to mount:
> >> root@P126:~# mount.cifs //10.66.232.12/dev_users share/ -o
> >> username=G132248 --verbose
> >> Password:
> >>
> >> mount.cifs kernel mount options:
> >> unc=//10.66.232.12\dev_users,ip=10.66.232.12,ver=1,username=G132248,pass=********
> >> mount error 13 = Permission denied
> >> Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
> >>
> >> ----- dmesg outpout -----
> >> [ 2504.662550]  /build/buildd/linux-2.6.24/fs/cifs/cifsfs.c: Devname:
> >> //10.66.232.12/dev_users flags: 64
> >> [ 2504.662562]  /build/buildd/linux-2.6.24/fs/cifs/connect.c: CIFS
> >> VFS: in cifs_mount as Xid: 14 with uid: 0
> >> [ 2504.662572]  /build/buildd/linux-2.6.24/fs/cifs/connect.c: Username: G132248
> >> [ 2504.662576]  /build/buildd/linux-2.6.24/fs/cifs/connect.c: UNC:
> >> \\10.66.232.12\dev_users ip: 10.66.232.12
> >> [ 2504.662587]  /build/buildd/linux-2.6.24/fs/cifs/connect.c: Socket created
> >> [ 2504.664035]  /build/buildd/linux-2.6.24/fs/cifs/connect.c: sndbuf
> >> 16384 rcvbuf 87380 rcvtimeo 0x7fffffff
> >> [ 2504.664070]  /build/buildd/linux-2.6.24/fs/cifs/connect.c:
> >> Demultiplex PID: 6875
> >> [ 2504.664079]  /build/buildd/linux-2.6.24/fs/cifs/connect.c: Existing
> >> smb sess not found
> >> [ 2504.664088]  /build/buildd/linux-2.6.24/fs/cifs/cifssmb.c: secFlags 0x27
> >> [ 2504.664094]  /build/buildd/linux-2.6.24/fs/cifs/transport.c: For
> >> smb_command 114
> >> [ 2504.664098]  /build/buildd/linux-2.6.24/fs/cifs/transport.c:
> >> Sending smb of length 69
> >> [ 2504.664101] | 0x00 0x00 0x00 0x45 0xff 0x53 0x4d 0x42  |  _ _ _ E � S M B
> >> [ 2504.664112] | 0x72 0x00 0x00 0x00 0x00 0x00 0x01 0xc0  |  r _ _ _ _ _ _
> >> �[ 2504.664122] | 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00  |  _ _ _ _ _ _ _ _
> >> [ 2504.664131] | 0x00 0x00 0x00 0x00 0x00 0x00 0xda 0x1a  |  _ _ _ _ _ _ � _
> >> [ 2504.664139] | 0x00 0x00 0x01 0x00 0x00 0x22 0x00 0x02  |  _ _ _ _ _ " _ _
> >> [ 2504.664148] | 0x4c 0x4d 0x31 0x2e 0x32 0x58 0x30 0x30  |  L M 1 . 2 X 0 0
> >> [ 2504.664157] | 0x32 0x00 0x02 0x4c 0x41 0x4e 0x4d 0x41  |  2 _ _ L A N M A
> >> [ 2504.664166] | 0x4e 0x32 0x2e 0x31 0x00 0x02 0x4e 0x54  |  N 2 . 1 _ _ N T
> >> [ 2504.664175] | 0x20 0x4c 0x4d 0x20 0x30 0x2e 0x31 0x32  |    L M   0 . 1 2
> >> [ 2504.664183] | 0x00                                     |  _
> >> [ 2504.670105]  /build/buildd/linux-2.6.24/fs/cifs/connect.c: rfc1002
> >> length 0x5d
> >> [ 2504.670113] | 0x59 0x00 0x00 0x00 0xff 0x53 0x4d 0x42  |  Y _ _ _ � S M B
> >> [ 2504.670123] | 0x72 0x00 0x00 0x00 0x00 0x80 0x01 0xc0  |  r _ _ _ _ _ _
> >> �[ 2504.670132] | 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00  |  _ _ _ _ _ _ _ _
> >> [ 2504.670141] | 0x00 0x00 0x00 0x00 0x00 0x00 0xda 0x1a  |  _ _ _ _ _ _ � _
> >> [ 2504.670150] | 0x00 0x00 0x01 0x00 0x11 0x02 0x00 0x01  |  _ _ _ _ _ _ _ _
> >> [ 2504.670159] | 0x32 0x00 0x01 0x00 0x04 0x41 0x00 0x00  |  2 _ _ _ _ A _ _
> >> [ 2504.670168] | 0x00 0x00 0x01 0x00 0x82 0x2a 0x00 0x00  |  _ _ _ _ _ * _ _
> >> [ 2504.670177] | 0xfd 0xf3 0x80 0x00 0x80 0x41 0xb8 0x2e  |  � � _ _ _ A � .
> >> [ 2504.670187] | 0xbf 0x71 0xca 0x01 0xc4 0xff 0x00 0x14  |  � q � _ � � _ _
> >> [ 2504.670196] | 0x00 0x57 0x00 0x4f 0x00 0x52 0x00 0x4b  |  _ W _ O _ R _ K
> >> [ 2504.670205] | 0x00 0x47 0x00 0x52 0x00 0x4f 0x00 0x55  |  _ G _ R _ O _ U
> >> [ 2504.670214] | 0x00 0x50 0x00 0x00 0x00                 |  _ P _ _ _
> >> [ 2504.670252] | 0x59 0x00 0x00 0x00 0xff 0x53 0x4d 0x42  |  Y _ _ _ � S M B
> >> [ 2504.670262] | 0x72 0x00 0x00 0x00 0x00 0x80 0x01 0xc0  |  r _ _ _ _ _ _
> >> �[ 2504.670270] | 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00  |  _ _ _ _ _ _ _ _
> >> [ 2504.670279] | 0x00 0x00 0x00 0x00 0x00 0x00 0xda 0x1a  |  _ _ _ _ _ _ � _
> >> [ 2504.670288] | 0x00 0x00 0x01 0x00 0x11 0x02 0x00 0x01  |  _ _ _ _ _ _ _ _
> >> [ 2504.670297] | 0x32 0x00 0x01 0x00 0x04 0x41 0x00 0x00  |  2 _ _ _ _ A _ _
> >> [ 2504.670306] | 0x00 0x00 0x01 0x00 0x82 0x2a 0x00 0x00  |  _ _ _ _ _ * _ _
> >> [ 2504.670314] | 0xfd 0xf3 0x80 0x00 0x80 0x41 0xb8 0x2e  |  � � _ _ _ A � .
> >> [ 2504.670324] | 0xbf 0x71 0xca 0x01 0xc4 0xff 0x00 0x14  |  � q � _ � � _ _
> >> [ 2504.670332] | 0x00 0x57 0x00 0x4f 0x00 0x52 0x00 0x4b  |  _ W _ O _ R _ K
> >> [ 2504.670341] | 0x00 0x47 0x00 0x52 0x00 0x4f 0x00 0x55  |  _ G _ R _ O _ U
> >> [ 2504.670348] | 0x00 0x50 0x00 0x00                      |  _ P _ _
> >> [ 2504.670358]  /build/buildd/linux-2.6.24/fs/cifs/cifssmb.c: Dialect: 2
> >> [ 2504.670363]  /build/buildd/linux-2.6.24/fs/cifs/cifssmb.c: negprot rc 0
> >> [ 2504.670367]  /build/buildd/linux-2.6.24/fs/cifs/connect.c: Security
> >> Mode: 0x1 Capabilities: 0x80f3fd TimeAdjust: -3600
> >> [ 2504.670371]  /build/buildd/linux-2.6.24/fs/cifs/sess.c: sess setup type 2
> >> [ 2504.670484]  /build/buildd/linux-2.6.24/fs/cifs/transport.c: For
> >> smb_command 115
> >> [ 2504.670488]  /build/buildd/linux-2.6.24/fs/cifs/transport.c:
> >> Sending smb:  total_len 248
> >> [ 2504.670491] | 0x00 0x00 0x00 0xf4 0xff 0x53 0x4d 0x42  |  _ _ _ � � S M B
> >> [ 2504.670500] | 0x73 0x00 0x00 0x00 0x00 0x00 0x01 0xd0  |  s _ _ _ _ _ _
> >> �[ 2504.670509] | 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00  |  _ _ _ _ _ _ _ _
> >> [ 2504.670517] | 0x00 0x00 0x00 0x00 0x00 0x00 0xda 0x1a  |  _ _ _ _ _ _ � _
> >> [ 2504.670526] | 0x00 0x00 0x02 0x00 0x0d 0xff 0x00 0x00  |  _ _ _ _ _ � _ _
> >> [ 2504.670535] | 0x00 0x58 0x40 0x32 0x00 0x00 0x00 0x00  |  _ X @ 2 _ _ _ _
> >> [ 2504.670544] | 0x00 0x00 0x00 0x18 0x00 0x18 0x00 0x00  |  _ _ _ _ _ _ _ _
> >> [ 2504.670553] | 0x00 0x00 0x00 0xdc 0xd0 0x80 0x00 0xb7  |  _ _ _ � � _ _ �
> >> [ 2504.670562] | 0x00                                     |  _
> >> [ 2506.945967]  /build/buildd/linux-2.6.24/fs/cifs/connect.c: rfc1002
> >> length 0x27
> >> [ 2506.945975] | 0x23 0x00 0x00 0x00 0xff 0x53 0x4d 0x42  |  # _ _ _ � S M B
> >> [ 2506.945985] | 0x73 0x6d 0x00 0x00 0xc0 0x80 0x01 0xc0  |  s m _ _ � _ _
> >> �[ 2506.945994] | 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00  |  _ _ _ _ _ _ _ _
> >> [ 2506.946003] | 0x00 0x00 0x00 0x00 0x00 0x00 0xda 0x1a  |  _ _ _ _ _ _ � _
> >> [ 2506.946012] | 0x00 0x00 0x02 0x00 0x00 0x00 0x00       |  _ _ _ _ _ _ _
> >> [ 2506.946038] | 0x23 0x00 0x00 0x00 0xff 0x53 0x4d 0x42  |  # _ _ _ � S M B
> >> [ 2506.946048] | 0x73 0x6d 0x00 0x00 0xc0 0x80 0x01 0xc0  |  s m _ _ � _ _
> >> �[ 2506.946056] | 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00  |  _ _ _ _ _ _ _ _
> >> [ 2506.946063] | 0x00 0x00 0x00 0x00 0x00 0x00 0xda 0x1a  |  _ _ _ _ _ _ � _
> >> [ 2506.946070] | 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0xf6  |  _ _ _ _ _ _ _
> >> �[ 2506.946077] | 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00  |  _ _ _ _ _ _ _ _
> >> [ 2506.946084] | 0x1b 0x00 0x00 0x00 0x00 0x00 0x00 0x00  |  _ _ _ _ _ _ _ _
> >> [ 2506.946091] | 0x01 0x00 0x00 0x00 0x3c 0x60 0xb4 0xf6  |  _ _ _ _ < ` �
> >> �[ 2506.946098] | 0x3c 0x60 0xb4 0xf6 0x01 0x00 0x00 0x00  |  < ` � � _ _ _ _
> >> [ 2506.946105] | 0x48 0x60 0xb4 0xf6 0x48 0x60 0xb4 0xf6  |  H ` � � H ` �
> >> �[ 2506.946112]  |  H ` � � H ` �
> >> �[ 2506.946115] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
> >> [ 2506.946121]  /build/buildd/linux-2.6.24/fs/cifs/netmisc.c: Mapping
> >> smb error code 5 to POSIX err -13
> >> [ 2506.946124]  /build/buildd/linux-2.6.24/fs/cifs/misc.c: Null buffer
> >> passed to cifs_small_buf_release
> >> [ 2506.946129]  /build/buildd/linux-2.6.24/fs/cifs/sess.c: ssetup rc
> >> from sendrecv2 is -13
> >> [ 2506.946133]  /build/buildd/linux-2.6.24/fs/cifs/sess.c: ssetup
> >> freeing small buf f6b46000
> >> [ 2506.946137]  CIFS VFS: Send error in SessSetup = -13
> >> [ 2507.076409]  /build/buildd/linux-2.6.24/fs/cifs/connect.c: No
> >> session or bad tcon
> >> [ 2507.076417]  /build/buildd/linux-2.6.24/fs/cifs/connect.c: CIFS
> >> VFS: leaving cifs_mount (xid = 14) rc = -13
> >> [ 2507.076421]  CIFS VFS: cifs_mount failed w/return code = -13
> >>
> >> with sec=lanman result is the same (error 13) but with this message in
> >> the dmesg:
> >> [ 2656.284995]  CIFS VFS: Server requests plain text password but
> >> client support disabled
> >>
> >> Thanks,
> >> SC
> >
> > 2.6.24 is pretty ancient at this point. There were a number of patches
> > that went in to fix plaintext auth a year or so ago. You might want to
> > try a more recent kernel.
> >
> > --
> > Jeff Layton <[email protected]>
> >
> 


-- 
Jeff Layton <[email protected]>
_______________________________________________
linux-cifs-client mailing list
[email protected]
https://lists.samba.org/mailman/listinfo/linux-cifs-client
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.