Mounting CUBINlab drives under Linux
Overview
CUBINlab provides numerous shares to the network for MS-Windows users which can be accessed under Linux too. Authentication is on a per-user basis with passwords, rather than more primitive methods as used in NFS. For this reason, NFS access is not provided for machines where typically only one user logs in.
The shares accessible under Linux are the same as those under MS-Windows, so this document only describes how to mount those shares under Linux.
Mounting Samba shares under Linux
-
Edit your
/etc/fstabfile and insert the following line, one for each share:$SHARE $PATH smbfs uid=$USER,gid=$GROUP,fmask=700,credentials=/etc/samba/smbmount.passwd 0 0where
$SHAREis the share name (e.g.//samba-core/homesfor the user home directories in the core network) noting that forward slashes are used rather than the MS-Windows backslashes.$PATHis the mount point where you wish to place the share (e.g./home/j/jpapif I were to mount my home directory and keep it consistent with the path on other multiuser CUBINlab machines).$USERis your username (or equivalently, your CUBINlab user id),$GROUPis your groupname (or equivalently, your CUBINlab group id). This uid/gid pair is used to set the ownership of all files mounted by thesmbfs. Otherwise, all files will be owned by root! For example, we might useuid=jpap,gid=pgradfor the userjpapin the postgrad group. Note: if you use the groupname rather than the id, then you must ensure it is listed in your/etc/groupfile.The credentials parameter tells
smbfswhere your username and password is located for that Samba share. This must specify the path (and filename) of a simple text file with two lines:username = $USER password = $PASSwhere
$USERis replaced with your username, and$PASS$with your password.Please ensure that you set the permissions of this file appropriately, just in case someone can read it by remotely accessing your machine. The safest method is to set the user:group to root:root, with read/write permissions for root, and no permissions for everyone else.
As a complete example, here's the
/etc/fstabentry that I use://samba-core/homes /home/j/jpap smbfs uid=jpap,gid=pgrad,fmask=700,credentials=/etc/samba/smbmount.passwd 0 0 -
Either reboot your machine to ensure the share is mounted on startup, or mount it manually on the command line as root:
mount $PATHwhere
$PATHis the path to the share that you placed in your/etc/fstabfile above.
Further information
For further information on the smbfs, please read the smbmount man page.