# CIFS / SMB Shares

## About

I have a couple SMB shares setup separately on my network and I mount those shares onto the server so I'd be able to manipulate and access those files without much effort and this is how I do that using `/etc/fstab`.

## Mounting

### Install cifs-utils

to be able to support SMB shares, the above package needs to be installed on the ubuntu machine.

```
sudo apt-get install cifs-utils
```

![](/files/Vg9SjDdzClF0xUKDHz07)

### Mkdir

Make a directory that you'd like to mount your files into.

```
mkdir nas
```

### Edit /etc/fstab

Here's the entry that I add to my `/etc/fstab`

```
//smb_server_ip/share_name     /mount/directory       cifs    user=your_name,pass=your_pass        0       0
```

### Mount all

This command mounts all drives in the fstab file.

```
mount -a
```

### Verify

Running `tree` on the mounted directory will yield all files on the SMB share. You can use this to verify if the files are there.

```
tree directory/
```

![](/files/y61b2MutnULsmeQw2red)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://homelab.4pfsec.com/system-services-software/cifs-smb-shares.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
