19

When accessing SMB shared that are password-protected, smbclient works just fine.

But when I'm trying to access shared that have no password protection (public shares), smbclient prints:

tree connect failed: NT_STATUS_ACCESS_DENIED

How can I access those shares?

I'm trying to access Windows 7 from my Ubuntu 12.10

6
  • I believe that is not the complete error message...
    – schaiba
    Feb 17, 2013 at 20:35
  • @schaiba - It also says Anonymous login successful if it helps
    – speller
    Feb 17, 2013 at 20:39
  • Yes, it helps. Remove live essentials from the Windows 7 server and try again, it's an old bug.
    – schaiba
    Feb 17, 2013 at 20:46
  • @schaiba - I don't have live essentials
    – speller
    Feb 17, 2013 at 20:56
  • which version of samba you use? $smbd --version
    – Yurij73
    Mar 4, 2013 at 6:12

7 Answers 7

12

Answering quite an old question, I can do this using smbclient like this:

$ smbclient //host/share -U " "%" "
Domain=[WORKGROUP] OS=[Windows 2000] Server=[Windows 2000 LAN Manager]
smb: \>

This is from a fedora 21 host connecting to a solaris clone (omnios), but should be the same to a windows host.

3
  • 3
    The syntax for the -U (user) option is this: -U|--user=username[%password]. Therefore, this answer users the "single-space" username with a "single-space" password.
    – bernie
    Aug 26, 2016 at 21:49
  • 2
    smbclient //host/share -U guest% worked for me. Dec 1, 2016 at 12:18
  • 2
    -U % worked for me Jan 16, 2018 at 18:38
2

if your mount point is /home/myuser/mountpoint and shared folder is named sharefolder. You should try mount -t cifs //<your shareserver name or ip>/sharefolder -o username=guest,password="" /home/myuser/mountpoint

3
  • Tried it, but I'm getting mount error(5): Input/output error. Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) And if I sniff with Wireshark I see I get STATUS_ACCOUNT_RESTRICTION from the server
    – speller
    Feb 19, 2013 at 19:33
  • does windows share permit folder read/write for guests?
    – Yurij73
    Feb 20, 2013 at 6:19
  • check for sure that the full sharepath is accessible. your sharefolder and all higher level folder must be +r+x at least.
    – Yurij73
    Feb 20, 2013 at 15:41
1

Could you check which security option is given in your smb.conf. By default security = user option will be enabled under Standalone Server option .User level of security asks for username/passwd in windows while if you keep the security = share it wont ask for credentials or can access share without password. This option can also be appended to your local share definitions.

1
  • It was indeed security = user but it was also commented-out. Tries un-commenting it, and changed it to security = share, but I got the same results
    – speller
    Feb 19, 2013 at 19:38
0

From here:

by default network access is denied to accounts which don't have a
password... you can change this option in the group policy

Well, appears it's not possible. Microsoft probably thought this is clever..

1
  • Sorry for that comment, if something goes wrong. I use a windows 2003 and XPs shares w/o any pass. Just with guest acc enabled.
    – Yurij73
    Feb 24, 2013 at 19:59
0

This is an old question, but I fixed this problem for guest account access by enabling the following policy in Group Policy Management:

Default Domain Policy > Computer Configuration > Policies > Windows Settings > Security Settings > Local Policies > Security Options > Accounts: Guest account status

Even though it is not defined, it is disabled by default and prevents enumeration of the share.

0

In my case this syntax was working great on smbclient Version 4.3.11-Ubuntu to copy a file on another linux server using smb share:

smbclient '//server.domain.local/share' -U 'myuser%' -c 'put "/tmp/filen_to_copy.txt" "subfolder\copied_file.txt"'

I think it works with Windows server w/o AD.

0

@bernie had the right idea. The following command works following this syntax:

smbclient -L '//10.10.16.165/' -U '%' OR smbclient '//10.10.16.165/SHARE' -U '%'
1
  • smbclient //192.168.1.10/smb -U '%' -c 'cd \mnt\termux7\storage\emulated\0;ls'
    – CS QGB
    Sep 15, 2022 at 11:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .