2

Can you compare why samba client and NFS client are used differently?

For example, Why do I have to mount a shared directory on a NFS client side, while I don't have to for samba client side?

In pcmanfm, why can I just type smb://192.168.1.198 on the address bar of file manager, and connect to samba server, while I can't do similarly to access a NFS shared directory, or how can I?

Thanks.

4

pcmanfm uses gvfs, a GNOME Virtual FileSystem. It has SMB support in the gvfs-backends package, which depends on libsmbclient and suggests samba-common.

GVFS requires D-Bus and/or GIO module support for programs to use it, or a gvfs-fuse package that uses FUSE to allow mounting GVFS-accessible filesystems to be accessible by generic programs.

Also, a NFS server and client will trust each other on a much deeper level than a SMB server and client, if the classic NFS sec=sys security model is used, and so mounting a NFS filesystem must require administrative access. (Think of what you could do as a regular user if you could freely mount a filesystem containing setuid binaries of your choice from a server specified by you. The answer is "anything".) That is why implementing a user-accessible nfs:// protocol would not be trivial.

  • Thanks. (1) How can I access a NFS shared irectory in pcmanfm, maybe similarly to a Samba shared directory? (2) " a NFS server and client will trust each other on a much deeper level than a SMB server and client". But I configured NFS server by /share 192.168.1.0/24(rw,sync,no_subtree_check) by following linuxconfig.org/…, It turns out that there is no explicit authentication from a client side (another computer in the same local network). How can I configure the NFS server so that it can securely share a directory? – Tim Feb 25 at 12:04
  • (1) mount it as root, or have an admin set up a prepared /etc/fstab line that allows user mounting, then use pcmanfm to access it like a local filesystem. That is the only way. (2) ...and this is why (1) is so: no authentication, just blind trust. NFSv4 allows secure sharing with Kerberos authentication and optional traffic encryption, but you'll need to set up a Kerberos authentication environment first... and that is not exactly trivial. – telcoM Feb 25 at 14:38
  • "That is the only way" for NFS, whereas "pcmanfm uses gvfs, a GNOME Virtual FileSystem. It has SMB support in the gvfs-backends package, which depends on libsmbclient and suggests samba-common. " Does gvfs, not have NFS support? Surprising if yes, given that NFS seems more native to Linux than Samba is – Tim Feb 25 at 14:42
  • Looks like I was wrong... there is a NFS backend for GVFS, but it seems to be packaged separately, so it might be still experimental or have other issues with it. The NFS protocol was originally designed for sharing disks between multi-user systems, so it does not quite have a concept of "allow only this one particular user to access the share according to their permissions": the protocol basically allows full access and trusts that the client will restrict the client-side users as appropriate. But if the client is evil, it can do anything... the root_squash was the first fix for this. – telcoM Feb 26 at 8:52
2

Tim, you ask more than one question. But let me answer one (which I found interesting)

You do not need to mount the NFS share. You can access it on this way:

cd /net/<NFS server IP or hostname/path/to/shared/dir

and then copy, view, etc. the files and directories inside. You do not need to specity the protocol as this (/net ) is a special directory like /proc for example. TO use /net you need to install autofs package.

You can mount SMB share on this way:

mount -t cifs -o user=<username> //<IP or hostname of SMB server>/<share name> /mount/point

For more details you can check Samba documentation

  • Thanks. (1) Why is there no protocol name like nfs:// in the URL in your cd command, while I have to type smb:// in the address bar of a file manager? (2) can you mount a samba shared directory? If yes, how? – Tim Feb 25 at 11:36
  • @Tim, you can mount SMB share on the same way you mount filesystem, see my edited answer – Romeo Ninov Feb 25 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.