Contents¶
Persistent Research Drive Mount¶
System maintenance on the vm will cause it to occasionally reboot. This section outlines how to ensure the drive is automatically remounted after reboot.
set up a credentials file¶
Create a file in your home-directory of the vm named (e.g.) .cifs_credentials
, and edit it to contain the lines
Now protect that file by changing its permissions to give you, and no-one else, read-only access:
Gather auxilliary information¶
Find your user identity on the vm with the command
and observe the values of your uid and gid (user-id and group-id).
We assume you mount the drive on your home directory as above, e.g. ~/<research_drive_mount_point>
.
edit /etc/fstab with sudo¶
Using sudo, edit the file /etc/fstab
and append the following line to it, substituting your values:
//files.auckland.ac.nz/research/<research_drive_name> /home/<your_username_on_the_vm>/<research_drive_mount_point> cifs credentials=/home/<your_username_on_the_vm>/.cifs_credentials,uid=<your_uid>,gid=<your_gid>,users 0 0
Unmount the research drive in order to test the fstab configuration:
Shared Research Drive Access¶
(Taken from RedHat documentation)
One method of sharing a mount of a research drive is by having an admin user set up the mount with the multiuser option, mounting the drive, and then letting individual users authenticate with cifs using their credentials.
Superuser setup¶
- A superuser creates the folder /mnt/
with group owner the vm's rw(user) group name:
2.This superuser then creates a secure credentials file for their access to the research drive:
E.g. create the file /
- With sudo permissions, edit the file
/etc/fstab
instructing that the research drive be mounted with these credentials, with the multiuser attribute:
//files.auckland.ac.nz/research/<research_drive_name> /mnt/unifiles cifs multiuser,sec=ntlmssp,credentials=/<some_directory_path>/.smb.cred,noauto 0 0
systemctl daemon-reload
User access¶
Any user of the vm who has access to the research-drive (belongs to the appropriate vmuser group) then provides their credentials for the research-drive server (files.auckland.ac.nz
) to the kernel’s keyring with the command:
They can then access the drive with their permissions in the directory /mnt/