Regression in smbclient, username required for anonymous login
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
samba (Ubuntu) |
Triaged
|
Low
|
Unassigned | ||
Bionic |
New
|
Undecided
|
Unassigned |
Bug Description
I noticed a regression in smbclient between 16.04 and 18.04.
After setting up an open share (RW access to everyone, no password) on the Windows 10 box, I can access it with Ubuntu 16.04 (samba 4.3.11):
$ smbclient -L 192.168.0.104 -N
WARNING: The "syslog" option is deprecated
OS=[Windows 10 Home 17134] Server=[Windows 10 Home 6.3]
Sharename Type Comment
--------- ---- -------
ADMIN$ Disk Remote Admin
C$ Disk Default share
IPC$ IPC Remote IPC
MySharedFolder Disk
print$ Disk Printer Drivers
Users Disk
Connection to 192.168.0.104 failed (Error NT_STATUS_
NetBIOS over TCP disabled -- no workgroup available
I get that successful result also if I set the min protocol to NT1, SMB2 or SMB3 using the -m argument.
But if I try to access it in Ubuntu 18.04 (samba 4.7.6), I get an ACCESS_DENIED error:
$ smbclient -L 192.168.0.104 -N
WARNING: The "syslog" option is deprecated
session setup failed: NT_STATUS_
Specifying the protocol to SMB2 or SMB3 doesn't change anything:
$ smbclient -L 192.168.0.104 -N -m SMB2
WARNING: The "syslog" option is deprecated
session setup failed: NT_STATUS_
Interestingly enough, changing it to NT1 doesn't solve the issue but note how smbclient reports a successful anonymous login:
$ smbclient -L 192.168.0.104 -N -m NT1
WARNING: The "syslog" option is deprecated
Anonymous login successful
Sharename Type Comment
--------- ---- -------
Error returning browse list: NT_STATUS_
Reconnecting with SMB1 for workgroup listing.
Connection to 192.168.0.104 failed (Error NT_STATUS_
Failed to connect with SMB1 -- no workgroup available
And finally, what solves the issue is to set a username to something, anything. In the example below I use the string "dummy", which doesn't correspond to any username in the Windows or in the Linux box:
smbclient -L 192.168.0.104 -N -U dummy
WARNING: The "syslog" option is deprecated
Sharename Type Comment
--------- ---- -------
ADMIN$ Disk Remote Admin
C$ Disk Default share
IPC$ IPC Remote IPC
MySharedFolder Disk
print$ Disk Printer Drivers
Users Disk
Reconnecting with SMB1 for workgroup listing.
Connection to 192.168.0.104 failed (Error NT_STATUS_
Failed to connect with SMB1 -- no workgroup available
This is observed when connecting to shares using the UI also. When gvfs launches the auth dialog, selecting to connect anonymously fails and results in the dialog appearing again. A successful connection can be achieved by typing a dummy username and a dummy password instead.