I’ve recently tried setting up Samba sharing on my Asus RT-N18U Wireless Router with latest available official ASUSWRT software (22.214.171.124.378_9545-ge20f0c3). In order to achieve this, I followed what seemed a logical menu path:
USB Application -> Media Services -> “Network Place (Samba) Share / Cloud Disk”
No big deal so far, and then no issues either in creating and assigning permissions to users:
Unfortunately, what seemed (and should have been) a simple operation didn’t bring expected results. In fact, whenever I was attempting to access samba shares from my PC running Linux Mint (v. 17.2 Rafaela), I was either repeatedly re-asked for a password, or facing connection timed out errors. Samba sharing simply seemed not to be working.
A quick lookup on the Internet helped me not, as no other seemed to be facing the same issue. Or – at least – I have been unable to find a solution. So I have started to investigate a bit myself, using my old time friend, the powerful Linux command line. What I have discovered using smbclient is that there were some configuration issues:
/usr/bin/smbclient -L jerk WARNING: The "syslog" option is deprecated Enter root's password:
Server does not support EXTENDED_SECURITY but 'client use spnego = yes and 'cli
Note: jerk is the name of my router; replace it with your own router name, if you wish to reproduce the above
UPDATE: Additionally, in 2020 and 2021 as I have tried accessing my device from newer Ubuntu and Mint 19 and 20 versions, I stepped into similar but slightly different messages. Bottom line: my “fix” wasn’t working anymore. I have therefore looked for a way to solve my problem on my new hosts and managed to get past it with configuration options below.
One word of caution here: what happens is that the Asus device only supports old, not so secure versions of the SMB protocol. And that I’m therefore forced to force my Linux box to use those old protocol versions. The setup I’m suggesting herein – although it’s the only one which will work with the Asus box (as far as I know) – it is also not as secure as it would be with newer protocol versions. In my situation this is not a problem, as I’m using it in my home network only. Before acting as described below, if you’re using your laptop in public networks also, please make sure that the fix I suggest does not violate your company security policies or introduces potential risks of any kind. This is to say that – although I have received much appreciation for this post during the years – acting as suggested below is under your own and sole responsibility, and that you should at least understand what you’re doing.
Anyways, let’s now get to the fix. In my old setup, I simply added the following two lines:
client NTLMv2 auth = no client use spnego = no
within the global section (look for a [global] entry) of my local samba configuration file – which is /etc/samba/smb.conf on my PC.
For my newer Linux Mint 20.2, the above solution still doesn’t work. Besides the lines above, I also needed to add following two lines to the /etc/samba/smb.conf (just below the two lines above). I suspect this is nowadays necessary not only for Mint/Ubuntu 20, but also for many other recent distributions. If the above lines alone do not work, you can therefore try adding the following two lines (here a hint on what they do):
client min protocol = CORE client max protocol = NT1
Then, also add the following content to a newly created smb.conf file within a – newly created – .smb directory within your user’s home dirctory: That means the /home/MY_USER/.smb/smb.conf file now contains the following:
[global] client NTLMv2 auth = no client use spnego = no
Here too, in recent distributions, you might need to add the following two lines also in order for the setup to work:
client min protocol = CORE client max protocol = NT1
Although it’s not strictly necessary, you can now reload your local samba server. This is useful because it can help you spotting configuration mistakes if you made any while editing the configuration files. You can try to execute one of the following (or similar) commands (the exact one will depend on your distribution/version):
service samba restart systemctl restart smbd
The trick(s) above allowed me to get Samba sharing working.
I’m afraid others might face the same problem, so here it is what I did in order to make my Asus RT-N18U router Samba share work with my Linux Mint PC. If this helps you, let me know. Surely getting some feedback would encourage me to write other similar posts in the future (or update this one once again).
Worked beautifully accessing my USB drive on an Asus RT-AC56R from Mint 20.2. This saved me from losing what little hair I have left. Thanks.
Great! Solved my problem on Debian 10
Thank you very much for the tip.
Thank you so much! Access to the shared files in a USB flash drive in my router worked fine through Windows but I had what seemed like a Linux system problem with my login through Ubuntu 18.04. I have been searching for a solution to for so many hours. This worked!
Thanks man. Now ssamba works on my intel nuc with cinnamon debian and my asus dsl-n14u router.
thank you, this was the solution.
Thanks a bunch for taking the time to write this up.
I have a media center running Ubuntu. It’s connected to a TV and has no keyboard, just as I have no knowledge of Linux.
I solved the problem by installing the Asus Merlin firmware on my AC87U Asus router. This gave me the option of chosing Samba V1 in the Merlin software. Any other option would not browse the Samba shares on my network.
Now all is good. A fine solution for those whose router is compatible with the Merlin firmware update.
thanks a lot!
Solved my issues with the Asus RT-AC58U and Ubuntu 16.04.
All the best,
Thank you! Bows in gratitude. 🙂
Worked great for my Asus AC68U .. only thing you need to change is the service name when I tried “service samba restart” it gave me the following error:
Failed to restart samba.service: Unit samba.service is masked.
Replace samba with smbd ( service smbd restart ) did the trick.
Thanks a lot, this worked also for me 🙂
Thank you a lot!!!
works for me with Asus RT-N56UB1, Ubuntu 16.04
The problem is that Asus router firmware is still using Samba v3.0.33, released Nov 2008. The current version of Samba is 4.7.5, released Feb 2018. Yep… code that is a decade old, and incredibly insecure. PLEASE join me in contacting ASUS and requiring them to include a current version of Samba.
The solution contained in this article does work, and I’ve had to implement it w/ current builds of Libreelec on my system, too, in order to utilize the USB HD server option of the Asus RT-AC56u. What the solution does, however, is to FURTHER reduce the security of what is already an insecure protocol, and that is not acceptable.
If you ARE disabling spnego and ntlmv2, then please make sure you don’t have anything on your attached drive that you’re not willing to share with the world.
You’re making a good point here. And sure, it’d be great if Asus were to update Samba on their routers. I also agree about what you say on security. At the same time, I take for granted that a similar device is to be used in a home environment, and without sensitive data on it. That’s how and why I made it to work this way. No matter how secure a newer version of Samba (or any other file sharing protocol) might become, I’d still go with a firewall ahead of everything else.
How is disabling spnego and ntlmv2 on your PC going to make the contents of the HD available to all? It’s only shared in your local network, and it still requires password to access the files. Even if it can be circumvented by someone in the know, he’d still have to gain access to my local network.
Simply put, disabling spnego and ntlmv2 on your PC is NOT going to make the contents of the HD available to everyone. That’s never been my goal, or the goal for this post. If you act on the SMB client configuration, nothing will happen at the network layer on the server side. So, if the device’s not reachable at the IP level, contents won’t be shared. Other techniques will need to be applied for internet (and Internet) sharing to be enabled.
If you install asuswrt-merlin on your router, you’d get samba v3.6, which supports smb2, and is much more secure.
This is certainly an option. At the same time, I’m afraid this would void any warranty if still present. Also I think this might not be a viable solution for everyone. At the same time, it can be useful for someone, so thanks for suggesting an alternative way to solve the Samba issue.
Your post helped me to solve my broken Samba shares after updateing Libreelec to the latest version. Thanks a lot!
I can’t thank you enough!
Brilliant , this solved my issue with usb disk connected to my RT-AC68U Asus router and Linux Mint 18.1
Brilliant, this solved my issue with RT-AC68U and Linux Mint 18.1
Thank you so much! This solved my problem in Ubuntu 16.04 accessing my Asus RT-AC56U! Very much appreciate the solution!
Godly amazing!! Your solution solves my SMB connection problem between RT-N18U and my LibreELEC box(mxq pro 4k). Good job!!
Awesome. Worked a treat on Ubuntu 16.04.
Thx for your brain u did it smartly. 😉 Work also for RT-AC68U & Ubuntu.
Wizardry that works. Thank you. I think this is a problem – a Mint problem? An Asus problem – that should be fixed, i.e. we should not need this hack.
Had the same issue with ASUS RT-AC68P wireless router. Using LMDE version. Was pulling my hair out, glad you posted this work around. Even got Gigalo working like it should. Thanks
Same issue here with same router, Linux 18 Sarah. You’re the man !! (for me the change did not require to restart samba server )
Worked for me. Thanks.