Sample Header Ad - 728x90

NAS issues with SMB/CIFS; how to 'see' client-server messaging?

1 vote
0 answers
818 views
I have a new Synology NAS (DS1621+), and have begun integration into my home network. I'm having some problems using it with my Linux hosts. I can mount the NAS, but the permissions (as seen from Linux) are not what I want them to be. I'm under the impression that ownership & permissions can be *"mapped"* from the NAS to my Linux clients, but it's unclear to me how this is done. My Linux hosts are all Debian-based units, and file services provided by the Synology NAS are via SMB. From Linux, I use the *cifs-utils suite* (mount -t cifs ...) to mount the shares. I've contacted Synology, and was surprised to learn: **1:** Synology does not provide tech support to "command line" users. **2:** Synology claimed their SMB implementation is proprietary, and do not provide any (useful) documentation on the interface. I *suspect* that Synology's implementation is not *that* far off mainstream, but after some trial-and-error, I'm still having *"permissions issues"*. Also, the mount.cifs manual has many options whose purpose and effect are vague to me. Are there any Linux tools available that can help identify how the various options and parameters in mount.cifs affect permissions as seen from the Linux client's perspective? I'd like to eliminate as much of the *trial-and-error* as possible. I'm interested in using SMB instead of NFS because I've heard more negatives on NFS than I have SMB. I have created the users on the Synology side and added them to the SMB config there. #### EDIT: 2022-07-12; More reading, findings The *variables* which seem to be in play are: 1. the state of the Linux implementation of the ["Unix Extensions"](https://wiki.samba.org/index.php/UNIX_Extensions) to SMB, and the version on my client machine 2. the state of the server's (Synology's) implementation of SMB/Samba 3. the state of the server's (Synology's) implementation of the "Unix Extensions" In an effort to improve the quality of this question, I've attempted to define these variables in the context of my question: 1. Re the state of the Linux implementation of the "Unix Extensions":
$ mount.cifs --version
   mount.cifs version: 6.11
   # NOTE1: Unix Extensions are enabled by default per man mount.cifs 
   # NOTE2: see also 'modinfo cifs'
2. Re server (Synology) version of SMB/Samba:
$ ssh admin@SynologyNAS-1
   /$ samba --version
   Version 4.10.18 
   /$ uname -srm
   Linux 4.4.180+ x86_64
3. Re server (Synology) version of the "Unix Extensions" ***I'm at a loss on how to do this, so I tried smbclient:***
$ smbclient \\\\SynologyNAS\\rpi_share -U=pi
   Enter WORKGROUP\pi's password:
   Try "help" to get a list of possible commands.
   smb: \> help
   ?              allinfo        altname        archive        backup
   blocksize      cancel         case_sensitive cd             chmod
   chown          close          del            deltree        dir
   du             echo           exit           get            getfacl
   geteas         hardlink       help           history        iosize
   lcd            link           lock           lowercase      ls
   l              mask           md             mget           mkdir
   more           mput           newer          notify         open
   posix          posix_encrypt  posix_open     posix_mkdir    posix_rmdir
   posix_unlink   posix_whoami   print          prompt         put
   pwd            q              queue          quit           readlink
   rd             recurse        reget          rename         reput
   rm             rmdir          showacls       setea          setmode
   scopy          stat           symlink        tar            tarmode
   timeout        translate      unlock         volume         vuid
   wdel           logon          listconnect    showconnect    tcon
   tdis           tid            utimes         logoff         ..
   !
   smb: \> ? posix
   HELP posix:
   	   turn on all POSIX capabilities
   
   smb: \> posix
   Server doesn't support UNIX CIFS extensions.
   smb: \> ? chmod
   HELP chmod:
	     chmod a file using UNIX permission
   
   smb: \> chmod test-touch-4B.txt 666
   Server doesn't support UNIX CIFS calls.
   ...
#### 2022-07-12; Conclusions & Revised Questions? The above results with smbclient ***suggest*** that with respect to SMB/CIFS, my client software is [*up to speed*](https://idioms.thefreedictionary.com/up+to+speed) , but my shiny new Synology NAS is far [*behind the curve*](https://idioms.thefreedictionary.com/behind+the+curve) . My original question now becomes, "Are these results accurate; is there a more conclusive or accurate method to determine the status of a product when the vendor refuses any information on it?" For those with similar questions, I can only offer this: >***In my case***: I mount using Synology user pi credentials. Doing so leaves my Linux user pi unable to write to the mounted share - despite the fact that Synology user pi had been given R&W privileges in the Synology DSM. I found that adding the uid=pi and gid=pi options to my mount -t cifs command, at least enabled the Linux user pi to write to the SMB share on the Synology server. ***Why*** this works I will have to leave for others to answer. ### Further Reading: 1. [The SMB UNIX Extensions Wiki](https://wiki.samba.org/index.php/UNIX_Extensions) 2. [CIFS VFS - Protocol extensions to the Common Internet File System for better POSIX file I/O semantics](https://www.samba.org/samba/CIFS_POSIX_extensions.html) 3. [A Search: what are the "Unix Extensions" for SMB/CIFS/Samba?](https://duckduckgo.com/?t=ffab&q=what+are+the+%22Unix+Extensions%22+for+SMB%2FCIFS%2FSamba&atb=v278-1&ia=web) . 4. [Samba version 4.3 or newer supports SMB 3.1.1](https://www.admin-magazine.com/Archive/2017/40/SMB-3.1.1-in-Windows-Server-2016) 5. [Linux cifs mailing list](http://vger.kernel.org/vger-lists.html#linux-cifs) 6. mount.cifs and mount.smb3 are *nearly* the same; ref man mount.cifs - which is also the manual for mount.smb3. 7. [The SMB3-Linux Wiki](https://wiki.samba.org/index.php/SMB3-Linux) 8. [Are SMB POSIX Extensions Same As SMB Unix Extensions?... *Apparently not*](https://snia.org/sites/default/files/SDC/2020/053-French-SMB3-POSIX-Extensions-Phase.pdf) 9. [CIFS Protocol Extensions Update, fm 2006 (This has been YEARS in the making)](https://download.samba.org/pub/samba/cifs-cvs/snia-developer-2006-cifs-extensions.pdf) 10. [A Tour through the CIFS Protocol Extensions and Linux CIFS client, fm. 2008](https://vdocument.in/a-tour-through-the-cifs-protocol-extensions-and-linux-cifs-almost-ntfscifs.html) . 11. [SMB3 POSIX Extensions Phase 2 ... what is next? (fm. 2020)](https://snia.org/sites/default/files/SDC/2020/053-French-SMB3-POSIX-Extensions-Phase.pdf) 12. [The video of #10 above](https://www.snia.org/educational-library/smb3-posix-extensions-phase-2-now-they-are-what-next-2020) 13. [The Linux kernel user’s and administrator’s guide » CIFS (note: more verbiage by Steve French)](https://www.kernel.org/doc/html/latest/admin-guide/cifs/index.html) 14. [What Is SMB Protocol and Why Is it a Security Concern?](https://cybersophia.net/articles/what-is/what-is-smb-protocol-and-why-is-it-a-security-concern/) 15. [Server Message Block - Wikipedia](https://en.wikipedia.org/wiki/Server_Message_Block)
Asked by Seamus (3772 rep)
Jul 8, 2022, 03:36 PM
Last activity: Dec 10, 2024, 01:22 AM