Linux smbclient Connect to Server Error: Failed to retrieve share list from the server, No Such File Or Directory

Google+ Pinterest LinkedIn Tumblr

In this quick article, or tutorial or whatever you call it, let me share a problem solution which I recently encountered when I’m trying to connect to my client’s windows server from my Debian bases Linux system.

It’s not that this is the first time I’m trying to connect to windows server using the smbclient. Everything works before since I updated my smbclient to 4.7.4. Now if I try to connect to my windows server it shows me the following error.

Failed to retreive share list from server. No such file or directory.

I searched for the solution on different online forums and did get the breakthrough. So, the only way to solve this problem is by editing the /etc/samba/smb.conf file and override the default by adding a line inside the [global] section.

Note: If you did not find the file samba/smb.conf file in the /etc directory then you first need to install the smbclient using the following command.

sudo apt-get install smbclient -y

After the successful installation of smbclient opens the up the /etc/samba/smb.conf file and right after the workgroup = WORKGROUP add the below line to change the default.

client max protocol = NT1

Visually the file looks like this.

Linux smbclient to change the default to NT1

In the last step, you just need to save the file and reboot the system.

Note: Reboot is necessary otherwise the above solution will not work.

Hopefully, this works well without any kind of error.

More Resource

You can check out this forum for a complete discussion on why this error occurred when working with smbclient on new version “Failed to retrieve share list from the server, no such file or directory”.

If the above solution solves your problem then don’t forget to hit the ♥️ button.

Thank you for being here and keep reading…


  1. Please DON’T do this. This forces the connection to use the obsolete and VERY vulnerable SMB1 protocol.

    If it works, you’re being forced to use a very slow, buggy, and insecure protocol.

    And it’s quite possible that it won’t work, due to Microsoft trying to get SMB1 disabled everywhere.

    Don’t use SMB1.

  2. Also don’t reboot. geez this is a bad advice article. sudo systemctl restart smbd Rebooting instead of restarting the service, FFS.

    • ahsensaeed067 Reply

      Hey Kevin,
      Thanks for sharing your thoughts on this. Yes, I know but at the time when I wrote this article, this is the only solution I came up with.

Write A Comment