Smbclient
Directory Creation
You must login to Swan at least one time to create your NRDStor folder before connecting via Samba. Please see the page Connecting to log into Swan either via SSH or Open OnDemand. Once you have logged in successfully to Swan, you can connect via Samba.
NRDStor can be accessed using the smbclient command-line utility.
Install Smbclient¶
You can download smbclient from https://www.samba.org/samba/download/.
Accessing and Managing Files¶
Once smbclient is installed, you can use smbclient commands to navigate directories and manage files. Here are a few examples:
Accessing Files¶
To access a specific directory and retrieve a file, use the following command:
smbclient \\\\nrdstor.unl.edu\\nrdstor -U NEAD/<NUID> -c "cd <groupname>/<username>/; get readme.txt"
In this command:
-
\\\\nrdstor.unl.edu\\nrdstor: The path to the NRDStor server. -
-U NEAD/<NUID>: Your University TrueYou credentials, where<NUID>is your 8 digit NUID. -
-c "cd <groupname>/<username>/; get readme.txt": This-coption passes a command string tosmbclient. -
cd <groupname>/<username>/: The command to change the directory.groupnameis the name of your HCC group, andusernameis your HCC username. -
get readme.txt: get the filereadme.txt.
Uploading Files¶
To upload a file to a specific directory, use the following command:
smbclient \\\\nrdstor.unl.edu\\nrdstor -U NEAD/<NUID> -c "cd <groupname>/<username>/; put readme.txt"
In the command string:
put readme.txt: The command to upload the filereadme.txtto the specified directory.
Downloading Full Directory¶
To download a specific directory from the server, use the following command:
smbclient \\\\nrdstor.unl.edu\\nrdstor -U NEAD/<NUID> -c "recurse; prompt OFF; cd <groupname>/<username>/; mget directory_name"
In the command string "recurse; prompt OFF; cd <groupname>/<username>/; mget directory_name":
-
recurse: Ensures that the command will operate recursively, affecting all subdirectories and their contents. -
prompt OFF: Turns off prompting to confirm each file transfer. -
cd <groupname>/<username>/: Changes the directory on the remote server to the specified path. -
mget directory_name: Downloads the directory nameddirectory_namefrom the server.
Uploading Full Directory¶
To upload a specific directory to the server, use the following command:
smbclient \\\\nrdstor.unl.edu\\nrdstor -U NEAD/<NUID> -c "recurse; prompt OFF; cd <groupname>/<username>/; mput directory_name"
In the command string "recurse; prompt OFF; cd <groupname>/<username>/; mput directory_name":
mput directory_name: Uploads the directory nameddirectory_nameto the server.