Scenario: Samba server with multiple netbios aliases and specific includes for each netbios alias. smb.conf: netbios name = bando netbios aliases = cat include = /etc/samba/smb.conf.%L smb ports = 139 smb.conf.cat: [cats_share] path = /tmp Connecting to //cat/cats_share with smbclient works fine. Mounting //cat/cats_share with mount.cifs fails with: 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) In the network sniff, you can see a nbss session request to *SMBSERVER<20> (packet number 6) instead of CAT<20> (which is the case with smbclient). Mount option 'netbiosname' only applies to the client netbios name and I wonder how I can connect to the virtual server 'cat'. Thanks in advance!
Created attachment 2852 [details] tcpdump of trial to mount via mount.cifs mount -t cifs //cat/cats_share /mnt -o username=xxx,password=xxx
Created attachment 2853 [details] tcpdump of working connection via smbclient smbclient //cat/cats_share -Ukseeger
Okay, works (with newer kernels) with mount option 'servername' (which is not documented in the man page). Why not grabbing the netbios name out of the unc path?
Looking at the tcpdump/wireshark traces for cifs vfs client and smbclient. The user id used during session setup is different in both the cases. Are cifs vfs client and smbclient and Samba server running on the same machine? I do not see smbclient resolving netbios name of the Samba server in the trace, wonder how smbclient is resolving netbios name of the server to negotiate/session_setup/tree_connnet to that server! Also, can you please state the entire command that works when used with cifs client (with servername option)?
cifs vfs client does not do netbios name query like smbclient does.
I have files /usr/local/samba/lib/smb.conf with this content (only) netbios name = cfstst8 netbios alias = cfstst8a client signing = mandatory server signing = mandatory include = /usr/local/samba/lib/smb.conf.%L smb ports = 139 and /usr/local/samba/lib/smb.conf.cfstst8 [smbshare8] path = /tmp/smbshare8 browsable = yes read only = no guest ok = yes writable = yes yet, when I try to either mount via cifs using netbios name or use smbclient with netbios name, I get an error cifstest8:~ # smbclient //cfstst8/smbshare8 /mnt/smb_a -U root Connection to cfstst8 failed (Error NT_STATUS_BAD_NETWORK_NAME)
(In reply to comment #4) > Looking at the tcpdump/wireshark traces for cifs vfs client and smbclient. > The user id used during session setup is different in both the cases. > Are cifs vfs client and smbclient and Samba server running on the same machine? Yes. > I do not see smbclient resolving netbios name of the Samba server in the > trace, wonder how smbclient is resolving netbios name of the server to > negotiate/session_setup/tree_connnet to that server! > Also, can you please state the entire command that works when used with cifs > client (with servername option)? mount -t cifs //127.0.0.1/cats_share /mnt -o username=xxx,password=xxx,servername=cat
(In reply to comment #6) > I have files /usr/local/samba/lib/smb.conf with this content (only) > > netbios name = cfstst8 > netbios alias = cfstst8a > client signing = mandatory > server signing = mandatory > include = /usr/local/samba/lib/smb.conf.%L > smb ports = 139 > > and /usr/local/samba/lib/smb.conf.cfstst8 > > [smbshare8] > path = /tmp/smbshare8 > browsable = yes > read only = no > guest ok = yes > writable = yes > > yet, when I try to either mount via cifs using netbios name or > use smbclient with netbios name, I get an error > > > cifstest8:~ # smbclient //cfstst8/smbshare8 /mnt/smb_a -U root > Connection to cfstst8 failed (Error NT_STATUS_BAD_NETWORK_NAME) Does /tmp/smbshare8 exist?
(In reply to comment #8) > (In reply to comment #6) > Does /tmp/smbshare8 exist? yes.
cifs client does not discover netbios hosts, I think unlike smbclient. So I am not sure what the issue here is.
cifs client does not talk NBNS. So I do not think it can discover netbios names.
Marking bug as invalid, as it seems to be impossible.