Skip to contentSkip to conversation

connecting to windows server with SMB2

DISCUSSION Ashish Sangwan 1 participant 1 message Jul 10, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Sorry for top posting.

It seems cifs client tries to connect 2 times.
dmesg output:
VDLinux#> mount -t cifs //107.109.224.147/sharefolder /mnt -o user=a.sangwan -o pass=xxxx -o vers=2.0 [ 2][ 3966.260000] fs/cifs/cifsfs.c: Devname: //107.109.224.147/sharefolder flags: 32768 [ 2][ 3966.260000] fs/cifs/netmisc.c: address conversion returned 1 for 107.109.224.147\sharefolder [ 2][ 3966.260000] fs/cifs/connect.c: Username: a.sangwan
[ 2][ 3966.260000] fs/cifs/connect.c: file mode: 0x1ed dir mode: 0x1ed
[ 2][ 3966.260000] fs/cifs/connect.c: CIFS VFS: in cifs_mount as Xid: 68 with uid: 0 [ 2][ 3966.260000] fs/cifs/connect.c: UNC: \\107.109.224.147\sharefolder
[ 2][ 3966.260000] fs/cifs/connect.c: Socket created
[ 2][ 3966.260000] fs/cifs/connect.c: sndbuf 16384 rcvbuf 87380 rcvtimeo 0x6d6
[ 0][ 3966.264000] fs/cifs/fscache.c: cifs_fscache_get_client_cookie: (0xe5ab9800/0xe5b7f230) [ 0][ 3966.264000] fs/cifs/connect.c: CIFS VFS: in cifs_get_smb_ses as Xid: 69 with uid: 0 [ 0][ 3966.264000] fs/cifs/connect.c: Existing smb sess not found
[ 0][ 3966.264000] fs/cifs/smb2pdu.c: Negotiate protocol
[ 0][ 3966.264000] fs/cifs/smb2pdu.c: sec_flags 0x81
[ 0][ 3966.264000] fs/cifs/transport.c: Sending smb: smb_len=102
[ 0][ 3966.264000] fs/cifs/connect.c: Demultiplex PID: 243
[ 0][ 3966.264000] fs/cifs/connect.c: RFC1002 header 0xaa
[ 0][ 3966.264000] fs/cifs/smb2misc.c: smb2_check_message length: 0xae, smb_buf_length: 0xaa [ 0][ 3966.264000] fs/cifs/smb2misc.c: SMB2 data length 42 offset 128
[ 0][ 3966.264000] fs/cifs/smb2misc.c: SMB2 len 174
[ 0][ 3966.264000] fs/cifs/transport.c: cifs_sync_mid_result: cmd=0 mid=0 state=4
[ 0][ 3966.264000] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[ 0][ 3966.264000] fs/cifs/smb2pdu.c: mode 0x1
[ 0][ 3966.264000] fs/cifs/smb2pdu.c: negotiated smb2.0 dialect
[ 0][ 3966.264000] fs/cifs/smb2pdu.c: sec_flags 0x81
[ 0][ 3966.264000] fs/cifs/smb2pdu.c: Signing optional
[ 0][ 3966.264000] fs/cifs/connect.c: Security Mode: 0x1 Capabilities: 0x300001 TimeAdjust: 0 [ 0][ 3966.264000] fs/cifs/smb2pdu.c: Session Setup
[ 0][ 3966.264000] fs/cifs/smb2pdu.c: sec_flags 0x81
[ 0][ 3966.264000] fs/cifs/transport.c: Sending smb: smb_len=120
[ 0][ 3966.268000] fs/cifs/connect.c: RFC1002 header 0xfa
[ 0][ 3966.268000] fs/cifs/smb2misc.c: smb2_check_message length: 0xfe, smb_buf_length: 0xfa [ 0][ 3966.268000] fs/cifs/smb2misc.c: SMB2 data length 178 offset 72
[ 0][ 3966.268000] fs/cifs/smb2misc.c: SMB2 len 254
[ 0][ 3966.268000] fs/cifs/transport.c: cifs_sync_mid_result: cmd=1 mid=1 state=4
[ 0][ 3966.268000] fs/cifs/smb2maperror.c: Mapping SMB2 status code -1073741802 to POSIX err -5 [ 0][ 3966.268000] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[ 0][ 3966.268000] fs/cifs/smb2pdu.c: sec_flags 0x81
[ 0][ 3966.268000] fs/cifs/transport.c: Sending smb: smb_len=354
[ 0][ 3966.268000] fs/cifs/connect.c: RFC1002 header 0x49
[ 0][ 3966.268000] fs/cifs/smb2misc.c: smb2_check_message length: 0x4d, smb_buf_length: 0x49 [ 0][ 3966.268000] fs/cifs/smb2misc.c: SMB2 data length 0 offset 0
[ 0][ 3966.268000] fs/cifs/smb2misc.c: SMB2 len 77
[ 0][ 3966.268000] fs/cifs/transport.c: cifs_sync_mid_result: cmd=1 mid=2 state=4
[ 0][ 3966.268000] Status code returned 0xc000006d STATUS_LOGON_FAILURE
[ 0][ 3966.272000] fs/cifs/smb2maperror.c: Mapping SMB2 status code -1073741715 to POSIX err -13 [ 0][ 3966.272000] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[ 0][ 3966.272000] CIFS VFS: Send error in SessSetup = -13
[ 0][ 3966.280000] fs/cifs/connect.c: CIFS VFS: leaving cifs_get_smb_ses (xid = 69) rc = -13 [ 0][ 3966.280000] fs/cifs/fscache.c: cifs_fscache_release_client_cookie: (0xe5ab9800/0xe5b7f230) [ 3][ 3966.428000] fs/cifs/connect.c: CIFS VFS: leaving cifs_mount (xid = 68) rc = -13 [ 3][ 3966.428000] fs/cifs/cifsfs.c: Devname: //107.109.224.147/sharefolder flags: 32769 [ 3][ 3966.432000] fs/cifs/netmisc.c: address conversion returned 1 for 107.109.224.147\sharefolder [ 3][ 3966.432000] fs/cifs/connect.c: Username: a.sangwan
[ 3][ 3966.432000] fs/cifs/connect.c: file mode: 0x1ed dir mode: 0x1ed
[ 3][ 3966.432000] fs/cifs/connect.c: CIFS VFS: in cifs_mount as Xid: 70 with uid: 0 [ 3][ 3966.432000] fs/cifs/connect.c: UNC: \\107.109.224.147\sharefolder
[ 3][ 3966.432000] fs/cifs/connect.c: Socket created
[ 3][ 3966.432000] fs/cifs/connect.c: sndbuf 16384 rcvbuf 87380 rcvtimeo 0x6d6
[ 0][ 3966.432000] fs/cifs/fscache.c: cifs_fscache_get_client_cookie: (0xe4c53400/0xe5b7f230) [ 0][ 3966.432000] fs/cifs/connect.c: CIFS VFS: in cifs_get_smb_ses as Xid: 71 with uid: 0 [ 0][ 3966.432000] fs/cifs/connect.c: Existing smb sess not found
[ 0][ 3966.432000] fs/cifs/smb2pdu.c: Negotiate protocol
[ 0][ 3966.432000] fs/cifs/smb2pdu.c: sec_flags 0x81
[ 0][ 3966.432000] fs/cifs/transport.c: Sending smb: smb_len=102
[ 0][ 3966.432000] fs/cifs/connect.c: Demultiplex PID: 244
[ 0][ 3966.436000] fs/cifs/connect.c: RFC1002 header 0xaa
[ 0][ 3966.436000] fs/cifs/smb2misc.c: smb2_check_message length: 0xae, smb_buf_length: 0xaa [ 0][ 3966.436000] fs/cifs/smb2misc.c: SMB2 data length 42 offset 128
[ 0][ 3966.436000] fs/cifs/smb2misc.c: SMB2 len 174
[ 0][ 3966.436000] fs/cifs/transport.c: cifs_sync_mid_result: cmd=0 mid=0 state=4
[ 0][ 3966.436000] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[ 0][ 3966.436000] fs/cifs/smb2pdu.c: mode 0x1
[ 0][ 3966.436000] fs/cifs/smb2pdu.c: negotiated smb2.0 dialect
[ 0][ 3966.436000] fs/cifs/smb2pdu.c: sec_flags 0x81
[ 0][ 3966.436000] fs/cifs/smb2pdu.c: Signing optional
[ 0][ 3966.436000] fs/cifs/connect.c: Security Mode: 0x1 Capabilities: 0x300001 TimeAdjust: 0 [ 0][ 3966.436000] fs/cifs/smb2pdu.c: Session Setup
[ 0][ 3966.436000] fs/cifs/smb2pdu.c: sec_flags 0x81
[ 0][ 3966.436000] fs/cifs/transport.c: Sending smb: smb_len=120
[ 0][ 3966.436000] fs/cifs/connect.c: RFC1002 header 0xfa
[ 0][ 3966.436000] fs/cifs/smb2misc.c: smb2_check_message length: 0xfe, smb_buf_length: 0xfa [ 0][ 3966.436000] fs/cifs/smb2misc.c: SMB2 data length 178 offset 72
[ 0][ 3966.436000] fs/cifs/smb2misc.c: SMB2 len 254
[ 0][ 3966.436000] fs/cifs/transport.c: cifs_sync_mid_result: cmd=1 mid=1 state=4
[ 0][ 3966.436000] fs/cifs/smb2maperror.c: Mapping SMB2 status code -1073741802 to POSIX err -5 [ 0][ 3966.436000] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[ 0][ 3966.436000] fs/cifs/smb2pdu.c: sec_flags 0x81
[ 0][ 3966.436000] fs/cifs/transport.c: Sending smb: smb_len=354
[ 0][ 3966.436000] fs/cifs/connect.c: RFC1002 header 0x49
[ 0][ 3966.436000] fs/cifs/smb2misc.c: smb2_check_message length: 0x4d, smb_buf_length: 0x49 [ 0][ 3966.436000] fs/cifs/smb2misc.c: SMB2 data length 0 offset 0
[ 0][ 3966.436000] fs/cifs/smb2misc.c: SMB2 len 77
[ 0][ 3966.436000] fs/cifs/transport.c: cifs_sync_mid_result: cmd=1 mid=2 state=4
[ 0][ 3966.436000] Status code returned 0xc000006d STATUS_LOGON_FAILURE
[ 0][ 3966.444000] fs/cifs/smb2maperror.c: Mapping SMB2 status code -1073741715 to POSIX err -13 [ 0][ 3966.444000] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[ 0][ 3966.444000] CIFS VFS: Send error in SessSetup = -13
[ 0][ 3966.448000] fs/cifs/connect.c: CIFS VFS: leaving cifs_get_smb_ses (xid = 71) rc = -13 [ 0][ 3966.448000] fs/cifs/fscache.c: cifs_fscache_release_client_cookie: (0xe4c53400/0xe5b7f230) [ 3][ 3966.600000] fs/cifs/connect.c: CIFS VFS: leaving cifs_mount (xid = 70) rc = -13

Regards,
Ashish
------- Original Message -------
Sender : Pavel Shilovsky<[email protected]> Date : Jul 10, 2014 17:21 (GMT+05:30)
Title : Re: Re: connecting to windows server with SMB2

2014-07-10 15:20 GMT+04:00 Ashish Sangwan :

Quoted 76 lines

2014-07-10 14:26 GMT+04:00 Ashish Sangwan :

Quoted 10 lines
Quoted 10 lines

I am using kernel version 3.8.13 and windows 7.

The below command works successfully:
Linux#> mount -t cifs //107.109.224.147/sharefolder /mnt -o user=a.sangwan -o pass=xxxx -o vers=1.0 -o sec=ntlm

Other than 1.0, all are fail:
Linux#> mount -t cifs //107.109.224.147/sharefolder /mnt -o user=a.sangwan -o pass=xxxx -o vers=2.0 -o sec=ntlm
[ 0][ 64.276000] Status code returned 0xc000006d STATUS_LOGON_FAILURE
[ 0][ 64.284000] CIFS VFS: Send error in SessSetup = -13

Quoted 4 lines
Quoted 2 lines

Tried with sec=ntlmv2/none/lanman/krb5, none of them worked. Help please!!

Did you tries without "sec=" option at all?

Yes, without sec=ntlm option, I am not able to mount even with vers=1.0
VDLinux#> mount -t cifs //107.109.224.147/sharefolder /mnt -o user=a.sangwan -o pass=xxxx -o vers=1.0 [ 0][ 1082.672000] selected vers 1.0
[ 0][ 1082.680000] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
[ 0][ 1082.688000] CIFS VFS: Send error in SessSetup = -13
mount: mounting //107.109.224.147/sharefolder on /mnt failed: Permission denied

Quoted 3 lines

If yes, you should set "echo 1 > /proc/fs/cifs/cifsFYI', try to mount and collect dmesg output and send it to the list.

Here it is for the command:
VDLinux#> mount -t cifs //107.109.224.147/sharefolder /mnt -o user=a.sangwan -o pass=xxxx -o vers=1.0

[ 0][ 1082.844000] fs/cifs/netmisc.c: address conversion returned 1 for 107.109.224.147\sharefolder [ 0][ 1082.844000] fs/cifs/connect.c: Username: a.sangwan
[ 0][ 1082.844000] fs/cifs/connect.c: file mode: 0x1ed dir mode: 0x1ed
[ 0][ 1082.844000] fs/cifs/connect.c: CIFS VFS: in cifs_mount as Xid: 50 with uid: 0 [ 0][ 1082.844000] fs/cifs/connect.c: UNC: \\107.109.224.147\sharefolder
[ 0][ 1082.844000] fs/cifs/connect.c: Socket created
[ 0][ 1082.844000] fs/cifs/connect.c: sndbuf 16384 rcvbuf 87380 rcvtimeo 0x6d6
[ 0][ 1082.848000] fs/cifs/fscache.c: cifs_fscache_get_client_cookie: (0xe5b36c00/0xe5b7f230) [ 0][ 1082.848000] fs/cifs/connect.c: CIFS VFS: in cifs_get_smb_ses as Xid: 51 with uid: 0 [ 0][ 1082.848000] fs/cifs/connect.c: Existing smb sess not found
[ 0][ 1082.848000] fs/cifs/cifssmb.c: secFlags 0x81
[ 0][ 1082.848000] fs/cifs/cifssmb.c: NTLMSSP only mechanism, enable extended security [ 0][ 1082.848000] fs/cifs/transport.c: For smb_command 114
[ 0][ 1082.848000] fs/cifs/transport.c: Sending smb: smb_len=69
[ 0][ 1082.848000] fs/cifs/connect.c: Demultiplex PID: 222
[ 0][ 1082.848000] fs/cifs/connect.c: RFC1002 header 0x7f
[ 0][ 1082.848000] fs/cifs/transport.c: cifs_sync_mid_result: cmd=114 mid=1 state=4 [ 0][ 1082.848000] fs/cifs/cifssmb.c: Dialect: 2
[ 0][ 1082.848000] fs/cifs/cifssmb.c: Max buf = 4356
[ 0][ 1082.848000] fs/cifs/asn1.c: OID len = 10 oid = 0x1 0x3 0x6 0x1
[ 0][ 1082.848000] fs/cifs/asn1.c: OID len = 10 oid = 0x1 0x3 0x6 0x1
[ 0][ 1082.848000] fs/cifs/cifssmb.c: negprot rc 0
[ 0][ 1082.848000] fs/cifs/connect.c: Security Mode: 0x3 Capabilities: 0x8001e3fc TimeAdjust: -19800 [ 0][ 1082.848000] fs/cifs/sess.c: sess setup type 3
[ 0][ 1082.848000] fs/cifs/sess.c: ntlmssp session setup phase 1
[ 0][ 1082.848000] fs/cifs/transport.c: For smb_command 115
[ 0][ 1082.848000] fs/cifs/transport.c: Sending smb: smb_len=186
[ 0][ 1082.848000] fs/cifs/connect.c: RFC1002 header 0x161
[ 0][ 1082.848000] fs/cifs/transport.c: cifs_sync_mid_result: cmd=115 mid=2 state=4 [ 0][ 1082.848000] fs/cifs/netmisc.c: Mapping smb error code 0xc0000016 to POSIX err -5 [ 0][ 1082.848000] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[ 0][ 1082.848000] fs/cifs/sess.c: UID = 2048
[ 0][ 1082.848000] fs/cifs/sess.c: bleft 131
[ 0][ 1082.848000] fs/cifs/sess.c: serverOS=Windows 7 Enterprise 7601 Service Pack 1 [ 0][ 1082.848000] fs/cifs/sess.c: serverNOS=Windows 7 Enterprise 6.1
[ 0][ 1082.848000] fs/cifs/sess.c: ssetup freeing small buf e5bc1c00
[ 0][ 1082.848000] fs/cifs/sess.c: ntlmssp session setup phase 3
[ 0][ 1082.848000] fs/cifs/transport.c: For smb_command 115
[ 0][ 1082.848000] fs/cifs/transport.c: Sending smb: smb_len=420
[ 0][ 1082.852000] fs/cifs/connect.c: RFC1002 header 0x23
[ 0][ 1082.852000] fs/cifs/transport.c: cifs_sync_mid_result: cmd=115 mid=3 state=4 [ 0][ 1082.852000] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
[ 0][ 1082.856000] fs/cifs/netmisc.c: Mapping smb error code 0xc000006d to POSIX err -13 [ 0][ 1082.856000] fs/cifs/misc.c: Null buffer passed to cifs_small_buf_release
[ 0][ 1082.856000] fs/cifs/sess.c: ssetup freeing small buf e5bc1500
[ 0][ 1082.856000] CIFS VFS: Send error in SessSetup = -13
[ 0][ 1082.860000] fs/cifs/connect.c: CIFS VFS: leaving cifs_get_smb_ses (xid = 51) rc = -13 [ 0][ 1082.860000] fs/cifs/fscache.c: cifs_fscache_release_client_cookie: (0xe5b36c00/0xe5b7f230)

Quoted 7 lines

In other mail Benjamin has suggessted to additionally provide -o "domain=" I am wondering why SMB1.0 is success as I don't provide domain in that cas too. Anyway, I will try suggesstion.

Additionally, I am able to connect to samba server (v 4.0.2) from the same machine without giving any -o sec -o domain option and it is success for all 2.0, 2.1 and 3.0 versions.

Sorry for being unclear, I meant dmesg output of unsuccessful mount with vers=2.0.

Signature · 2 lines
Best regards,
Pavel Shilovsky.