Skip to content
Snippets Groups Projects

Added accessing-NRDStor-using-smbclient

Merged hchen2016 requested to merge nrdstor-smbclient into master
Files
2
+++
title = "Smbclient"
description = "Using Smbclient to Access NRDStor"
weight=30
+++
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:
```bash
smbclient \\\\nrdstor.unl.edu\\nrdstor -U <campusName>/<UniversityUsername> -c "cd <groupname>/<username>/; get readme.txt"
```
In this command:
- **`\\\\nrdstor.unl.edu\\nrdstor`**: The path to the NRDStor server.
- **`-U <campusName>/<UniversityUsername>`**: Your login credentials, where **`campusName`** corresponds to your campus and **`UniversityUsername`** is your specific NU user name.
{{% notice info %}}
The **`<campusName>/<UniversityUsername>`** values to use depend on which campus you are associated with. Users from UNL, UNK, and UNO may use their local campus credentials. Users from UNMC must use their NUID username and password. Refer to the following table:
| Campus | Campus Login | SMB_Campus_Identifer |
|--------|--------------------------|----------------------------|
| UNL | husker@unl.edu | UNL-AD/husker |
| UNO | maverick@unomaha.edu | UNOMAHA/maverick |
| UNK | loper@unk.edu | UNKNET/loper |
| UNMC (via NUID) | 00000000 (NUID) | NEAD/00000000 |
In the examples provided here, please replace **`<campusName>/<UniversityUsername>`** with the value from the SMB_Campus_Identifer column in the table, and the respective NU username/ID.
{{% /notice %}}
- **`-c "cd <groupname>/<username>/; get readme.txt"`**: This **`-c`** option passes a command string to **`smbclient`**.
- **`cd <groupname>/<username>/`**: The command to change the directory. **`groupname`** is the name of your HCC group, and **`username`** is your HCC username.
- **`get readme.txt`**: get the file **`readme.txt`**.
#### Uploading Files
To upload a file to a specific directory, use the following command:
```bash
smbclient \\\\nrdstor.unl.edu\\nrdstor -U <campusName>/<UniversityUsername> -c "cd <groupname>/<username>/; put readme.txt"
```
In the command string:
- **`put readme.txt`**: The command to upload the file **`readme.txt`** to the specified directory.
#### Downloading Full Directory
To download a specific directory from the server, use the following command:
```bash
smbclient \\\\nrdstor.unl.edu\\nrdstor -U <campusName>/<UniversityUsername> -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 named **`directory_name`** from the server.
#### Uploading Full Directory
To upload a specific directory to the server, use the following command:
```bash
smbclient \\\\nrdstor.unl.edu\\nrdstor -U <campusName>/<UniversityUsername> -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 named **`directory_name`** to the server.
Loading