I sometimes think that there is some confusion about cifs. It’s basically a transport protocol implemented in the kernel that samba happens to use. Up to an early version of 11 it was a simple matter to use it directly. At some point people asked if cifs was secure. No one was prepared to do a security audit on it so the code was modified to prevent it’s direct use. This is the source section that does that, modified to allow it to function directly without samba.
/*
* mount.cifs has been the subject of many "security" bugs that have arisen
* because of users and distributions installing it as a setuid root program.
* mount.cifs has not been audited for security. Thus, we strongly recommend
* that it not be installed setuid root. To make that abundantly clear,
* mount.cifs now check whether it's running setuid root and exit with an
* error if it is. If you wish to disable this check, then set the following
* #define to 1, but please realize that you do so at your own peril.
*/
#define CIFS_DISABLE_SETUID_CHECK 1
/*
* By default, mount.cifs follows the conventions set forth by /bin/mount
* for user mounts. That is, it requires that the mount be listed in
* /etc/fstab with the "user" option when run as an unprivileged user and
* mount.cifs is setuid root.
*
* Older versions of mount.cifs however were "looser" in this regard. When
* made setuid root, a user could run mount.cifs directly and mount any share
* on a directory owned by that user.
*
* The legacy behavior is now disabled by default. To reenable it, set the
* following #define to true.
*/
#define CIFS_LEGACY_SETUID_CHECK 1
/*
* When an unprivileged user runs a setuid mount.cifs, we set certain mount
* flags by default. These defaults can be changed here.
*/
#define CIFS_SETUID_FLAGS (MS_NOSUID|MS_NODEV)
Actually the setuid aspect might be sufficient given root writes a script for a user to use it directly. With mount.cifs like this all I need to connect a directory on my desktop to to one on the NAS is this. Fstab which is supposed to be depreciated doesn’t enter into it. It seems it will disappear at some point.
/sbin/mount.cifs //192.168.xxx.xxx/Volume_1 /home/john/Desktop/NAS -o user=john,rw
This requests my nas password. I prefer it like that rather than passing a password directly. :XActually it takes me to the NAS’s // so that I can navigate to the shared or my own directory.
There are several reasons why I use it like this. Speed for one. It’s much faster than using it via samba. Also how my NAS is set up. One shared directory that can only be accessed by users only for exchanging files and several private password protected user directories. These are used for additional storage space. I could equally well add a media directory. The other reason relates to the NAS itself. Like many home type NAS’s NFS support can be enabled but as the docs point out this will slow it down as it has to load 2 servers at it’s end. Unfortunately there will always be windoze users in the house.
I also managed to get the NAS functioning using the KDE sharing set up but the behaviour when I launched files from the NAS was bizarre. Some worked some didn’t depending on the application. Also problems with reading files off the NAS, modifying them and writing them back. Boot up was also extremely slow as was directory navigation.
As far as sharing goes I have no interest in anything other than I have - a communal drop box on the NAS. The file locking cifs offers is adequate for this and also joint modification of files actually.
:(No answer to what a typical linux based home commercial NAS uses for a server though. I suspect it’s a stripped down Samba server but have no idea just how stripped down or where. They also clearly load a separate NFS server if needed.
Thanks for the WebYAST suggestion. I will have a look at that. The commercial NAS’s probably use a freely available simple web server to provide the admin interface. It seems Freenas offers this but reports on it are mixed. Possibly because it seems there is also a pay for version. It doesn’t run Linux either. Using a swear word it seems Ubuntu have done more in the line of home built Linux NAS set ups using Samba on the NAS but so far I haven’t found much info on it’s management. There is a USB stick type version available.
John