> For the complete documentation index, see [llms.txt](https://homelab.4pfsec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://homelab.4pfsec.com/system-services-software/cifs-smb-shares.md).

# CIFS / SMB Shares

Mounting 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
```

![](https://4023630493-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsVNw0ukkXTvV2pJfDvjn%2Fuploads%2FQgqtoXuhzTSDMHCzSGn6%2Fimage.png?alt=media\&token=93bb7f63-ea28-458b-a0e3-7abb0905a070)

### 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/
```

![](https://4023630493-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsVNw0ukkXTvV2pJfDvjn%2Fuploads%2FJKOe5JCxNTiZ5uLxTPkg%2Fimage.png?alt=media\&token=ee725542-7f17-4515-a79c-22ea1385c495)
