[SOLVED] Cannot connect to SMB share

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
tolga
Level 1
Level 1
Posts: 6
Joined: Fri Mar 10, 2017 5:02 pm

[SOLVED] Cannot connect to SMB share

Postby tolga » Fri Mar 10, 2017 6:02 pm

Hi Mint Community,

I cannot connect to a Samba share from Mint (18.1 KDE - Linux workstation 4.4.0-66-generic #87-Ubuntu SMP Fri Mar 3 15:29:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux).

I have an Asus DSL-N14U modem running Busybox. I attached a USB disk and it is mounted under /mnt/sda1. The Samba share is Download2, under sda1 (/mnt/sda1/Download2).

This is the setup:
    Modem IP: 192.168.1.1
    Modem hostname: DSL-N14U
    Credentials: admin !Passw0rd
    Share: /mnt/sda1/Download2
    Permissions: drwxrwxrwx 1 admin root 0 Mar 10 10:17 Download2

Here is how it looks with smbclient:

Code: Select all

tolga@workstation ~ $ smbclient -L //192.168.1.1
WARNING: The "syslog" option is deprecated
Enter tolga's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33]

        Sharename       Type      Comment
        ---------       ----      -------
        IPC$            IPC       IPC Service (DSL-N14U)
        Download2 (at sda1) Disk      sda1's Download2 in WD Elements 1023
        asus_swap (at sda1) Disk      sda1's asus_swap in WD Elements 1023
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33]

        Server               Comment
        ---------            -------
        DSL-N14U             DSL-N14U
        WORKSTATION          workstation server (Samba, Ubuntu)

        Workgroup            Master
        ---------            -------
        WORKGROUP            DSL-N14U



/etc/smb.conf from the modem:

Code: Select all

[global]                                                                 
workgroup = WORKGROUP                                                   
netbios name = DSL-N14U                                                 
server string = DSL-N14U                                                 
unix charset = UTF8                                                     
display charset = UTF8                                                   
log file = /var/log.samba                                               
log level = 3                                                           
max log size = 5                                                         
security = USER                                                         
guest ok = no                                                           
map to guest = Bad User                                                 
encrypt passwords = yes                                                 
pam password change = no                                                 
null passwords = yes                                                     
force directory mode = 0777                                             
force create mode = 0777                                                 
max connections = 5   
socket options = TCP_NODELAY SO_KEEPALIVE SO_RCVBUF=65536 SO_SNDBUF=65536
use sendfile = no                                                       
obey pam restrictions = no                                               
use spne go = no                                                         
client use spnego = no                                                   
disable spoolss = yes                                                   
host msdfs = no                                                         
strict allocate = No                                                     
bind interfaces only = yes             
interfaces = lo br0                                                     
map archive = no                                                         
map hidden = no                                                         
map read only = no                                                       
map system = no                                                         
store dos attributes = yes                                               
dos filemode = yes                                                       
dos filetimes = yes                                                     
dos filetime resolution = yes                                           
[asus_swap (at sda1)]                                                   
comment = sda1's asus_swap in WD Elements 1023                           
path = /tmp/mnt/sda1/asus_swap                                           
valid users = admin                                                     
invalid users =                                                         
read list = admin                                                       
write list = admin                                                       
[Download2 (at sda1)]                                                   
comment = sda1's Download2 in WD Elements 1023                           
path = /tmp/mnt/sda1/Download2                                           
valid users = admin                           
invalid users =                               
read list = admin                             
write list = admin   


In my computer, I amended client use spnego=no before Networking, under Global Settings ## Browsing/Identification.

OK. When I try to connect to the modem's share Download2 from Dolphin, with the admin credentials, I receive the error

Code: Select all

Access denied to smb://admin@dsl-n14u/Download2 (at sda1).


Changing the credentials to DSL-N14U\admin, dsl-n14u\admin, WORKGROUP\admin does not change anything.

I switched to the command line and tried

Code: Select all

smbclient '\\192.168.1.1\Download2' -U admin.


I received the following error:

Code: Select all

session setup failed: NT_STATUS_LOGON_FAILURE


Specifying the -W parameter with WORKGROUP, DSL-N14U, dsl-n14u does not change anything.

Following is the /var/log.samba from the modem:

Code: Select all

[2017/03/11 00:48:23, 3] smbd/negprot.c:reply_nt1(351)
  not using SPNEGO
[2017/03/11 00:48:23, 3] smbd/negprot.c:reply_negprot(606)
  Selected protocol NT LANMAN 1.0
[2017/03/11 00:48:23, 3] smbd/process.c:process_smb(1140)
  Transaction 1 of length 214
[2017/03/11 00:48:23, 3] smbd/process.c:switch_message(947)
  switch message SMBsesssetupX (pid 1900) conn 0x0
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:set_sec_ctx(241)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2017/03/11 00:48:23, 3] smbd/sesssetup.c:reply_sesssetup_and_X(1256)
  wct=13 flg2=0xc043
[2017/03/11 00:48:23, 3] smbd/sesssetup.c:reply_sesssetup_and_X(1402)
  Domain=[WORKGROUP]  NativeOS=[Unix] NativeLanMan=[Samba] PrimaryDomain=[]
[2017/03/11 00:48:23, 3] smbd/sesssetup.c:reply_sesssetup_and_X(1417)
  sesssetupX:name=[WORKGROUP]\[admin]@[192.168.1.10]
[2017/03/11 00:48:23, 3] auth/auth.c:check_ntlm_password(221)
  check_ntlm_password:  Checking password for unmapped user [WORKGROUP]\[admin]@[192.168.1.10] with the new password interface
[2017/03/11 00:48:23, 3] auth/auth.c:check_ntlm_password(224)
  check_ntlm_password:  mapped user is: [DSL-N14U]\[admin]@[192.168.1.10]
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:push_sec_ctx(208)
  push_sec_ctx(0, 0) : sec_ctx_stack_ndx = 1
[2017/03/11 00:48:23, 3] smbd/uid.c:push_conn_ctx(358)
  push_conn_ctx(0) : conn_ctx_stack_ndx = 0
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:set_sec_ctx(241)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:push_sec_ctx(208)
  push_sec_ctx(0, 0) : sec_ctx_stack_ndx = 2
[2017/03/11 00:48:23, 3] smbd/uid.c:push_conn_ctx(358)
  push_conn_ctx(0) : conn_ctx_stack_ndx = 1
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:set_sec_ctx(241)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 2
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:pop_sec_ctx(356)
  pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 1
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:push_sec_ctx(208)
  push_sec_ctx(0, 0) : sec_ctx_stack_ndx = 2
[2017/03/11 00:48:23, 3] smbd/uid.c:push_conn_ctx(358)
  push_conn_ctx(0) : conn_ctx_stack_ndx = 1
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:set_sec_ctx(241)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 2
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:pop_sec_ctx(356)
  pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 1
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:push_sec_ctx(208)
  push_sec_ctx(0, 0) : sec_ctx_stack_ndx = 2
[2017/03/11 00:48:23, 3] smbd/uid.c:push_conn_ctx(358)
  push_conn_ctx(0) : conn_ctx_stack_ndx = 1
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:set_sec_ctx(241)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 2
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:pop_sec_ctx(356)
  pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 1
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:pop_sec_ctx(356)
  pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0
[2017/03/11 00:48:23, 3] libsmb/ntlm_check.c:ntlm_password_check(317)
  ntlm_password_check: NTLMv2 password check failed
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:push_sec_ctx(208)
  push_sec_ctx(0, 0) : sec_ctx_stack_ndx = 1
[2017/03/11 00:48:23, 3] smbd/uid.c:push_conn_ctx(358)
  push_conn_ctx(0) : conn_ctx_stack_ndx = 0
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:set_sec_ctx(241)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:push_sec_ctx(208)
  push_sec_ctx(0, 0) : sec_ctx_stack_ndx = 2
[2017/03/11 00:48:23, 3] smbd/uid.c:push_conn_ctx(358)
  push_conn_ctx(0) : conn_ctx_stack_ndx = 1
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:set_sec_ctx(241)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 2
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:pop_sec_ctx(356)
  pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 1
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:pop_sec_ctx(356)
  pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:push_sec_ctx(208)
  push_sec_ctx(0, 0) : sec_ctx_stack_ndx = 1
[2017/03/11 00:48:23, 3] smbd/uid.c:push_conn_ctx(358)
  push_conn_ctx(0) : conn_ctx_stack_ndx = 0
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:set_sec_ctx(241)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:pop_sec_ctx(356)
  pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0
[2017/03/11 00:48:23, 2] auth/auth.c:check_ntlm_password(319)
  check_ntlm_password:  Authentication for user [admin] -> [admin] FAILED with error NT_STATUS_WRONG_PASSWORD
[2017/03/11 00:48:23, 3] smbd/error.c:error_packet_set(106)
  error packet at smbd/sesssetup.c(1501) cmd=115 (SMBsesssetupX) NT_STATUS_LOGON_FAILURE
[2017/03/11 00:48:23, 3] smbd/process.c:timeout_processing(1429)
  timeout_processing: End of file from client (client has disconnected).
[2017/03/11 00:48:23, 3] smbd/sec_ctx.c:set_sec_ctx(241)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2017/03/11 00:48:23, 3] smbd/connection.c:yield_connection(69)
  Yielding connection to
[2017/03/11 00:48:23, 3] smbd/server.c:exit_server_common(782)


Wireshark capture is not helpful:

Code: Select all

NT Status: STATUS_LOGON_FAILURE (0xc000006d)


What do you think the error can be? Please don't tell me I entered wrong password.

Any ideas?

Thank you!
Last edited by tolga on Sun Mar 19, 2017 2:22 pm, edited 2 times in total.

altair4
Level 18
Level 18
Posts: 8474
Joined: Tue Feb 03, 2009 10:27 am

Re: Cannot connect to SMB share

Postby altair4 » Fri Mar 10, 2017 7:42 pm

I have to be honest this is just a guess but your sever is running Samba 3.0.33 and it may be a mismatch of security levels between client and server.

I'm shutting down for the day but you might want to try this:

** Create a mount point:

Code: Select all

sudo mkdir /media/NAS

** Then do a temporary mount of the share but specifying the default security level back in 3.0.33 days ( sec=ntlm):

Code: Select all

sudo mount -t cifs //192.168.1.1/downloads2 /media/NAS -o username=admin,password=!Passw0rd,uid=1000,sec=ntlm


Not a KDE user so I don't know if cifs is installed by default. If not install it:

Code: Select all

sudo apt install cifs-utils
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

tolga
Level 1
Level 1
Posts: 6
Joined: Fri Mar 10, 2017 5:02 pm

Re: Cannot connect to SMB share

Postby tolga » Sun Mar 12, 2017 3:47 pm

Thank you very much for your help altair4.

cifs is installed, tried your command, however, the modem logged the same error in /var/log.samba:

Code: Select all

[2017/03/12 22:17:12, 3] smbd/sec_ctx.c:set_sec_ctx(241)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 1
[2017/03/12 22:17:12, 5] auth/auth_util.c:debug_nt_user_token(448)
  NT user token: (NULL)
[2017/03/12 22:17:12, 5] auth/auth_util.c:debug_unix_user_token(474)
  UNIX token of user 0
  Primary group is 0 and contains 0 supplementary groups
[2017/03/12 22:17:12, 3] smbd/sec_ctx.c:pop_sec_ctx(356)
  pop_sec_ctx (0, 0) - sec_ctx_stack_ndx = 0
[2017/03/12 22:17:12, 5] auth/auth.c:check_ntlm_password(273)
  check_ntlm_password: sam authentication for user [admin] FAILED with error NT_STATUS_WRONG_PASSWORD
[2017/03/12 22:17:12, 2] auth/auth.c:check_ntlm_password(319)
  check_ntlm_password:  Authentication for user [admin] -> [admin] FAILED with error NT_STATUS_WRONG_PASSWORD
[2017/03/12 22:17:12, 5] auth/auth_util.c:free_user_info(2108)
  attempting to free (and zero) a user_info structure
[2017/03/12 22:17:12, 3] smbd/error.c:error_packet_set(106)
  error packet at smbd/sesssetup.c(1501) cmd=115 (SMBsesssetupX) NT_STATUS_LOGON_FAILURE
[2017/03/12 22:17:12, 5] lib/util.c:show_msg(506)
[2017/03/12 22:17:12, 5] lib/util.c:show_msg(516)
  size=35
  smb_com=0x73
  smb_rcls=109
  smb_reh=0
  smb_err=49152
  smb_flg=128
  smb_flg2=49153           
  smb_tid=0
  smb_pid=3790
  smb_uid=0
  smb_mid=2
  smt_wct=0
  smb_bcc=0
[2017/03/12 22:17:12, 3] smbd/process.c:timeout_processing(1429)
  timeout_processing: End of file from client (client has disconnected).
[2017/03/12 22:17:12, 5] lib/gencache.c:gencache_shutdown(94)
  Closing cache file
[2017/03/12 22:17:12, 5] libsmb/namecache.c:namecache_shutdown(79)
  namecache_shutdown: netbios namecache closed successfully.
[2017/03/12 22:17:12, 3] smbd/sec_ctx.c:set_sec_ctx(241)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 0
[2017/03/12 22:17:12, 5] auth/auth_util.c:debug_nt_user_token(448)
  NT user token: (NULL)
[2017/03/12 22:17:12, 5] auth/auth_util.c:debug_unix_user_token(474)
  UNIX token of user 0
  Primary group is 0 and contains 0 supplementary groups
[2017/03/12 22:17:12, 5] smbd/uid.c:change_to_root_user(288)
  change_to_root_user: now uid=(0,0) gid=(0,0)
[2017/03/12 22:17:12, 3] smbd/connection.c:yield_connection(69)
  Yielding connection to
[2017/03/12 22:17:12, 3] smbd/server.c:exit_server_common(782)
  Server exit (normal exit)


I am still not able to access the share from a Windows computer - that is, it seems to me that this is a weird authentication issue rather than a Samba version problem.

Busybox is a very stripped-down version (the one that I have), I am not able to add a user to the samba group and retry - there is only the admin user and no useradd command :x

altair4
Level 18
Level 18
Posts: 8474
Joined: Tue Feb 03, 2009 10:27 am

Re: Cannot connect to SMB share

Postby altair4 » Sun Mar 12, 2017 3:58 pm

Can you post the output of this command from your Mint box:

Code: Select all

testparm -s
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

tolga
Level 1
Level 1
Posts: 6
Joined: Fri Mar 10, 2017 5:02 pm

Re: Cannot connect to SMB share

Postby tolga » Sun Mar 12, 2017 4:01 pm

There we go:

Code: Select all

Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "syslog" option is deprecated
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
        server string = %h server (Samba, Ubuntu)
        server role = standalone server
        map to guest = Bad User
        obey pam restrictions = Yes
        pam password change = Yes
        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        unix password sync = Yes
        syslog = 0
        log file = /var/log/samba/log.%m
        max log size = 1000
        client use spnego = No
        dns proxy = No
        usershare allow guests = Yes
        panic action = /usr/share/samba/panic-action %d
        idmap config * : backend = tdb


[printers]
        comment = All Printers
        path = /var/spool/samba
        create mask = 0700
        printable = Yes
        browseable = No


[print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers

altair4
Level 18
Level 18
Posts: 8474
Joined: Tue Feb 03, 2009 10:27 am

Re: Cannot connect to SMB share

Postby altair4 » Mon Mar 13, 2017 7:53 am

I'm going to ramble on a bit, Sorry ....

Usually when I come up against something like this I try to reproduce the user's environment on a test box but the problem I have is the age of the version of samba your device is using. The closest machine I have to that vintage uses samba 3.6 which is still 4 years younger than what you have so if I substitute your smb.conf for mine it's throwing out a lot of the parameters. So I don't know how valid all this is going to be.

I have been able to reproduce many of your errors and the best I can do to actually get access is to do this to the client ( Mint ) smb.conf - right under the "workgroup = workgroup" line I added:

Code: Select all

client ntlmv2 auth = no
client use spnego = no
client lanman auth = yes
client ipc signing = disabled
encrypt passwords = no

The magic key was the last one. I don't think the device knows how to use a samba encrypted password.

Now I'm allowed to access the share through the file manager.

I don't know how you will ever be able to connect to another machine like the Windows box you mentioned with your Mint machine set up this way.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

tolga
Level 1
Level 1
Posts: 6
Joined: Fri Mar 10, 2017 5:02 pm

Re: Cannot connect to SMB share

Postby tolga » Mon Mar 13, 2017 3:27 pm

Thank you very very much for your help altair4!

tl;dr - Dolphin works with the changes you mentioned, mount does not. Full log collection follows.

Questions:
    What does KDE's Dolphin does different from mount; it works, mount doesn't?
    Why does Samba think Download2 in the share path is a service and it attemps to find it? (/var/log.samba says 192.168.1.10 (192.168.1.10) couldn't find service download2)

BTW, 192.168.1.10 is my computer's IP address.

### SCENARIO 1: Password changed from !Passw0rd to 1234567

I suspected that the ! at the beginning of the password might be causing problems. To be able to pass on my credentials, I had to write password=!Passw0rd as password='!Passw0rd' I thought that might be causing the error. I changed it to 1234567 and here is what I had:

Code: Select all

workstation tolga # mount -t cifs //192.168.1.1/Download2 /media/modem -o username=admin,password=1234567,domain=workgroup,uid=1000,sec=ntlm
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)


/var/log.samba

Code: Select all

[2017/03/13 21:42:44, 0] smbd/service.c:make_connection(1243)
  192.168.1.10 (192.168.1.10) couldn't find service download2
[2017/03/13 21:42:44, 0] smbd/service.c:make_connection(1243)
  192.168.1.10 (192.168.1.10) couldn't find service download2


smbclient

Code: Select all

workstation tolga # smbclient -L 192.168.1.1 -U admin
WARNING: The "syslog" option is deprecated
Enter admin's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33]

        Sharename       Type      Comment
        ---------       ----      -------
        asus_swap (at sda1) Disk      sda1's asus_swap in WD Elements 1023
        Download2 (at sda1) Disk      sda1's Download2 in WD Elements 1023
        found.000 (at sda1) Disk      sda1's found.000 in WD Elements 1023
        found.001 (at sda1) Disk      sda1's found.001 in WD Elements 1023
        found.002 (at sda1) Disk      sda1's found.002 in WD Elements 1023
        found.003 (at sda1) Disk      sda1's found.003 in WD Elements 1023
        IPC$            IPC       IPC Service (DSL-N14U)
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33]

        Server               Comment
        ---------            -------
        DSL-N14U             DSL-N14U
        WORKSTATION          workstation server (Samba, Ubuntu)

        Workgroup            Master
        ---------            -------
        WORKGROUP            WORKSTATION


### SCENARIO 2: Password is 1234567 and smb.conf amended as you mentioned


client ntlmv2 auth = no
client use spnego = no
client lanman auth = yes
client ipc signing = disabled
encrypt passwords = no

I can access the Shared Folder (//192.168.1.1/Download2) from Dolphin without any issues.

However, running the mount command returns error:

Code: Select all

workstation tolga # mount -t cifs //192.168.1.1/Download2 /media/modem -o username=admin,password=1234567,uid=1000,sec=ntlm
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)             


### SCENARIO 3: Password is !Passw0rd and smb.conf amended as you mentioned


I can access the Shared Folder (//192.168.1.1/Download2) from Dolphin without any issues.

However, running the mount command returns error:

Code: Select all

workstation init.d # mount -t cifs //192.168.1.1/Download2 /media/modem -o username=admin,password='!Passw0rd',uid=1000,sec=ntlm
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)


/var/log.samba reads:

Code: Select all

[2017/03/13 22:15:12, 0] smbd/service.c:make_connection(1243)
  192.168.1.10 (192.168.1.10) couldn't find service download2
[2017/03/13 22:15:13, 0] smbd/service.c:make_connection(1243)
  192.168.1.10 (192.168.1.10) couldn't find service download2


smbclient command output:

Code: Select all

workstation init.d # smbclient -L //192.168.1.1 -U admin
WARNING: The "syslog" option is deprecated
Enter admin's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33]

        Sharename       Type      Comment
        ---------       ----      -------
        asus_swap (at sda1) Disk      sda1's asus_swap in WD Elements 1023
        Download2 (at sda1) Disk      sda1's Download2 in WD Elements 1023
        IPC$            IPC       IPC Service (DSL-N14U)
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.0.33]

        Server               Comment
        ---------            -------
        DSL-N14U             DSL-N14U
        WORKSTATION          workstation server (Samba, Ubuntu)

        Workgroup            Master
        ---------            -------
        WORKGROUP            WORKSTATION

altair4
Level 18
Level 18
Posts: 8474
Joined: Tue Feb 03, 2009 10:27 am

Re: Cannot connect to SMB share

Postby altair4 » Mon Mar 13, 2017 3:47 pm

Both smbclient ( Dolphin ) and mount.cifs belong to Samba but they don't talk to each other. CIFS doesn't know that smb.conf exists so all the changes you make there won’t do cifs any good.

I'm not sure at the moment how I would approach this issue with a cifs mount.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

tolga
Level 1
Level 1
Posts: 6
Joined: Fri Mar 10, 2017 5:02 pm

Re: Cannot connect to SMB share

Postby tolga » Sun Mar 19, 2017 2:20 pm

Hi altair4,

tl;dr: Nothing works except Dolphin. I am now marking this as solved.

Solution
I have been able to reproduce many of your errors and the best I can do to actually get access is to do this to the client ( Mint ) smb.conf - right under the "workgroup = workgroup" line I added:

Code: Select all

client ntlmv2 auth = no
client use spnego = no
client lanman auth = yes
client ipc signing = disabled
encrypt passwords = no

The magic key was the last one. I don't think the device knows how to use a samba encrypted password.

Now I'm allowed to access the share through the file manager.


I made a couple of more experiments without any luck. smbclient lists the shares OK, can connect with Dolphin but cannot perform any operations with smbclient (except listing shares) or mount -t cifs. Those are not working.

Thank you very much for your kind assistance once again.

tolga
Level 1
Level 1
Posts: 6
Joined: Fri Mar 10, 2017 5:02 pm

Re: [SOLVED] Cannot connect to SMB share

Postby tolga » Sun Mar 19, 2017 3:44 pm

altair4

Apologies - a few things than may catch your attention.

I ran an strace on Dolphin and saved the trace in Dolphin_strace.txt file. While logging the trace, I connected to the share 192.168.1.1/Download2 and copied a video file to my Videos folder.

Some interesting outputs from Dolphin_strace.txt. I am posting those as our collaborative work can end up with something fun. Just if you are as curious :D

Both smbclient ( Dolphin ) and mount.cifs belong to Samba but they don't talk to each other. CIFS doesn't know that smb.conf exists so all the changes you make there won’t do cifs any good.


Proof:

Code: Select all

tolga@workstation ~ $ cat Dolphin_strace.txt | grep cifs
tolga@workstation ~ $


Code: Select all

tolga@workstation ~ $ cat Dolphin_strace.txt | grep mount
readlink("/etc/mtab", "../proc/self/mounts", 4096) = 19
stat("/usr/share/gvfs/mounts", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0


Code: Select all

tolga@workstation ~ $ cat Dolphin_strace.txt | grep smbfs
tolga@workstation ~ $


Code: Select all

tolga@workstation ~ $ cat Dolphin_strace.txt | grep smb | more
stat("/usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/kio/smb.so", {st_mode=S_IFREG|0644, st_size=110448, ...}) = 0
lstat("/usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/kio/smb.so", {st_mode=S_IFREG|0644, st_size=110448, ...}) = 0
open("/usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/kio/smb.so", O_RDONLY|O_CLOEXEC) = 21
lstat("/usr/share/kservices5/smb.protocol", {st_mode=S_IFREG|0644, st_size=325, ...}) = 0
stat("/usr/share/kservices5/smb.protocol", {st_mode=S_IFREG|0644, st_size=325, ...}) = 0
lstat("/usr/share/kservices5/smb.protocol", {st_mode=S_IFREG|0644, st_size=325, ...}) = 0
stat("/usr/share/kservices5/smb.protocol", {st_mode=S_IFREG|0644, st_size=325, ...}) = 0
access("/usr/share/kservices5/smb.protocol", W_OK) = -1 EACCES (Permission denied)
stat("/usr/share/kservices5/smb.protocol", {st_mode=S_IFREG|0644, st_size=325, ...}) = 0
open("/usr/share/kservices5/smb.protocol", O_RDONLY|O_CLOEXEC) = 21
read(21, "[Protocol]\nexec=kf5/kio/smb\nprot"..., 16384) = 325
stat("/usr/sbin/smbd", {st_mode=S_IFREG|0755, st_size=71776, ...}) = 0
read(39, "Load smb config files from /etc/"..., 47) = 47
stat("/etc/samba/smb.conf", {st_mode=S_IFREG|0644, st_size=9694, ...}) = 0
stat("/usr/sbin/smbd", {st_mode=S_IFREG|0755, st_size=71776, ...}) = 0
stat("/usr/sbin/smbd", {st_mode=S_IFREG|0755, st_size=71776, ...}) = 0
stat("/usr/sbin/smbd", {st_mode=S_IFREG|0755, st_size=71776, ...}) = 0
stat("/usr/sbin/smbd", {st_mode=S_IFREG|0755, st_size=71776, ...}) = 0
stat("/usr/sbin/smbd", {st_mode=S_IFREG|0755, st_size=71776, ...}) = 0
writev(3, [{"\22\0\v\0\4\0\0\7r\1\0\0\234\1\0\0\10\0\0\0\23\0\0\0smb - / "..., 44}], 1) = 44
writev(3, [{"\22\0\10\0\4\0\0\7'\0\0\0\37\0\0\0\10p\4\0\7\0\0\0smb - /-", 32}, {NULL, 0}, {"", 0}], 3) = 32
stat("/home/tolga/.config/kio_smbrc", 0x7ffd7f107790) = -1 ENOENT (No such file or directory)
stat("/home/tolga/.config/kio_smbrc", 0x7ffd7f107730) = -1 ENOENT (No such file or directory)
stat("/home/tolga/.config/kio_smbrc", 0x7ffd7f1076c0) = -1 ENOENT (No such file or directory)
stat("/etc/xdg/xdg-/usr/share/xsessions/plasma/kio_smbrc", 0x7ffd7f1076c0) = -1 ENOENT (No such file or directory)
stat("/etc/xdg/kio_smbrc", 0x7ffd7f1076c0) = -1 ENOENT (No such file or directory)
stat("/usr/share/mint-artwork-kde/kf5-settings/kio_smbrc", 0x7ffd7f1076c0) = -1 ENOENT (No such file or directory)
stat("/usr/share/mint-artwork-kde/kde4-profile/default/config/kio_smbrc", 0x7ffd7f1076c0) = -1 ENOENT (No such file or directory)
write(39, "     9_47_\0\0\0\5smb:/", 19) = 19
write(40, "     9_45_\0\0\0\5smb:/", 19) = 19
write(41, "     9_5f_\0\0\0\5smb:/", 19) = 19
write(39, "     9_5f_\0\0\0\5smb:/", 19) = 19
write(40, "     9_5f_\0\0\0\5smb:/", 19) = 19
write(2, "org.kde.kurifilter-ikws: \"smb:/1"..., 82) = 82
writev(3, [{"\22\0\16\0\4\0\0\7r\1\0\0\234\1\0\0\10\0\0\0\35\0\0\0smb - 19"..., 56}], 1) = 56
writev(3, [{"\22\0\v\0\4\0\0\7'\0\0\0\37\0\0\0\10p\4\0\21\0\0\0smb - 19"..., 44}, {NULL, 0}, {"", 0}], 3) = 44
write(39, "    14_47_\0\0\0\20smb:/192.168.1.1", 30) = 30
read(39, "    15_14_\0\0\0\21smb://192.168.1.1 "..., 41) = 41
writev(3, [{"\22\0\17\0\4\0\0\7r\1\0\0\234\1\0\0\10\0\0\0!\0\0\0smb - 19"..., 60}], 1) = 60
writev(3, [{"\22\0\f\0\4\0\0\7'\0\0\0\37\0\0\0\10p\4\0\25\0\0\0smb - 19"..., 48}, {NULL, 0}, {"", 0}], 3) = 48
write(40, "    14_5f_\0\0\0\20smb:/192.168.1.1", 30) = 30

..... same outputs, but different write values [48, 52, 56 ...]

stat("/usr/sbin/smbd", {st_mode=S_IFREG|0755, st_size=71776, ...}) = 0
stat("/usr/sbin/smbd", {st_mode=S_IFREG|0755, st_size=71776, ...}) = 0
stat("/usr/sbin/smbd", {st_mode=S_IFREG|0755, st_size=71776, ...}) = 0
writev(3, [{"\22\0\34\0\10\0\340\7`\1\0\0c\2\0\0\10\0\0\0X\0\0\0smb://ad"..., 156}], 1) = 156
writev(3, [{"\22\0\34\0\10\0\340\7`\1\0\0c\2\0\0\10\0\0\0X\0\0\0smb://ad"..., 156}], 1) = 156



Code: Select all

tolga@workstation ~ $ cat Dolphin_strace.txt | grep 192.168.1.1 | more
stat("/192.168.1.1", 0x7ffd7f106bc0)    = -1 ENOENT (No such file or directory)
stat("/192.168.1.1", 0x7ffd7f106d30)    = -1 ENOENT (No such file or directory)
open("/192.168.1.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
write(39, "    14_47_\0\0\0\20smb:/192.168.1.1", 30) = 30
read(39, "    15_14_\0\0\0\21smb://192.168.1.1 "..., 41) = 41
write(40, "    14_5f_\0\0\0\20smb:/192.168.1.1", 30) = 30
write(39, "    14_45_\0\0\0\20smb:/192.168.1.1", 30) = 30
read(39, "    15_14_\0\0\0\21smb://192.168.1.1 "..., 41) = 41
write(40, "    15_47_\0\0\0\21smb://192.168.1.1", 31) = 31
read(40, "    16_14_\0\0\0\22smb://192.168.1.1/"..., 42) = 42
write(39, "    15_45_\0\0\0\21smb://192.168.1.1", 31) = 31
read(39, "    16_14_\0\0\0\22smb://192.168.1.1/"..., 42) = 42
write(40, "    16_47_\0\0\0\22smb://192.168.1.1/", 32) = 32
write(39, "    16_45_\0\0\0\22smb://192.168.1.1/", 32) = 32
write(40, "    2d_47_\0\0\0)smb://192.168.1.1/"..., 55) = 55
write(39, "    2d_45_\0\0\0)smb://192.168.1.1/"..., 55) = 55
write(41, "    2d_5f_\0\0\0)smb://192.168.1.1/"..., 55) = 55
write(39, "    2d_5f_\0\0\0)smb://192.168.1.1/"..., 55) = 55


Code: Select all

tolga@workstation ~ $ cat Dolphin_strace.txt | grep Download2 | more
stat("/Download2 (at sda1)", 0x7ffd7f106410) = -1 ENOENT (No such file or directory)
stat("/Download2 (at sda1)", 0x7ffd7f106580) = -1 ENOENT (No such file or directory)
open("/Download2 (at sda1)", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/Download2 (at sda1)", 0x7ffd7f106ac0) = -1 ENOENT (No such file or directory)
stat("/Download2 (at sda1)", 0x7ffd7f106c30) = -1 ENOENT (No such file or directory)
open("/Download2 (at sda1)", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/Download2 (at sda1)/Complete", 0x7ffd7f106410) = -1 ENOENT (No such file or directory)
stat("/Download2 (at sda1)/Complete", 0x7ffd7f106580) = -1 ENOENT (No such file or directory)
open("/Download2 (at sda1)/Complete", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/Download2 (at sda1)", 0x7ffd7f106c90) = -1 ENOENT (No such file or directory)
stat("/Download2 (at sda1)", 0x7ffd7f106e00) = -1 ENOENT (No such file or directory)
open("/Download2 (at sda1)", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/Download2 (at sda1)/InComplete", 0x7ffd7f106410) = -1 ENOENT (No such file or directory)
stat("/Download2 (at sda1)/InComplete", 0x7ffd7f106580) = -1 ENOENT (No such file or directory)
open("/Download2 (at sda1)/InComplete", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/Download2 (at sda1)/InComplete/insurances.com", 0x7ffd7f106410) = -1 ENOENT (No such file or directory)
stat("/Download2 (at sda1)/InComplete/insurances.com", 0x7ffd7f106580) = -1 ENOENT (No such file or directory)
open("/Download2 (at sda1)/InComplete/insurances.com", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/Download2 (at sda1)/InComplete/insurances.com/insurance.wmv.part", 0x7ffd7f106b70) = -1 ENOENT (No such file or directory)
stat("/Download2 (at sda1)/InComplete/insurances.com/insurance.wmv.part", 0x7ffd7f106ce0) = -1 ENOENT (No such file or directory)

...recurs files in directory...


Return to “Other networking topics”

Who is online

Users browsing this forum: No registered users and 2 guests