How to connect to a UZH NAS from the ScienceCluster¶
This guide describes how to access a UZH based NAS device. "NAS" stands for "network attached storage", and a NAS device is essentially a virtual hard-drive that can be mounted or connected to by any computer with the proper credentials and software.
In many cases, NAS devices are mounted to a computer's file system so that they interact the same way as external hard-drives connected to personal computers.
On the Cluster, a user can connect to a UZH based NAS using the
smbclient tool. You can use this tool to connect to your specified UZH NAS device then explore the file system and download or upload files from/to the ScienceCluster file system.
Please note that the
smbclient does not mount the NAS to the ScienceCluster as part of the file system. Rather, it is used to directly connect to the NAS from the ScienceCluster so that you can access then download/upload any files needed for your cluster workflow. See the section below on relevant commands to use with this tool.
Connecting to a UZH NAS with
To connect to a UZH NAS, input the following command
smbclient --max-protocol SMB3 -W UZH -U username //nasaddress
usernamewith your UZH shortname and
nasaddresswith the address to your NAS. If you input the command correctly, and the NAS is working properly, you will then be prompted to enter your UZH password.
Adjusting the NAS address for the
NAS addresses are often shared using their full prefix. For example,
smb://examplenas.uzh.ch/username$. In this case, you would augment the command as follows:
smbclient --max-protocol SMB3 -W UZH -U username //examplenas.uzh.ch/username$
smb:prefix has been removed, but the username of the subfolder on the NAS remains.
In other cases, NAS addresses are given to users with a username used within the address prefix. For example,
smb://username:*examplenas.uzh.ch/subfolder$. For this address, you would input the following into the
smbclient --max-protocol SMB3 -W UZH -U username //examplenas.uzh.ch/subfolder$
Once you've connected to your UZH NAS successfully, you will see the following appear in your terminal.
From this command prompt you can enter a variety of operations to interact with the files in your ScienceCluster area. Many of these operations are identical to their Bash counterparts. Important commands to note include:
- lists files and directories (including hidden files) in the present working directory;
- changes the command prompt location to another specified directory within the NAS device;
- downloads a specified file from the NAS device and places it where you specify in the ScienceCluster file system;
- uploads a specified file from ScienceCluster to the specified location on the NAS device;
- exits the
smbclientcommand prompt interface and returns to ScienceCluster;
- exits the
For a full set of operations with the
smbclient tool, execute the command
man smbclient and look under the "Operations" section.
To download a text file titled
test.txt from a NAS device and place it into the directory where you executed the
smbclient command, use:
smb: \> get test.txt new_test.txt
test.txtwill be copied to your present working directory on ScienceCluster with the new name
To upload a file from ScienceCluster to the NAS device, use:
smb: \> put new\_test.txt augmented\_test.txt
smbclientcommand prompt interface.