# Mount macOS & Windows shares on Debian

Mount macOS &amp; Windows shares on Debian e.g. in case you need to save backups on a network share.

### Step-by-Step Guide for Debian

#### Mounting Windows Shares

1. **Install CIFS Utilities:** Open a terminal and install the CIFS utilities package if it's not already installed.
    
    ```bash
    sudo apt-get update
    sudo apt-get install cifs-utils
    
    ```
2. **Mount the Windows Share:** Use the `mount` command to mount the Windows share. Replace the placeholders with your actual values.
    
    ```bash
    sudo mount -t cifs -o username=yourusername,password=yourpassword //yourIPAddress/yoursharedfolder /yourfoldertomount
    
    ```

#### Mounting macOS Shares

1. **Install CIFS Utilities:** Ensure the CIFS utilities package is installed (this step is the same as above).
    
    ```bash
    sudo apt-get update
    sudo apt-get install cifs-utils
    
    ```
2. **Mount the macOS Share:** Use the `mount` command to mount the macOS share. Replace the placeholders with your actual values.
    
    ```bash
    sudo mount -t cifs //yourIPAddress/yoursharedfolder /yourfoldertomount -o username=yourusername,password=yourpassword,nounix,sec=ntlmssp
    
    ```

#### Creating and Sharing a Folder

1. **Create a Folder:** Create the folder where you want to mount the share.
    
    ```bash
    sudo mkdir /yourfoldertomount
    
    ```
2. **Replace the Placeholder:** Replace `yourfoldertomount` with the actual path of the folder you created in the mount commands above.

### Example

If you want to mount a Windows share with IP `192.168.1.100` and shared folder name `backup` to a local directory `/mnt/backup`:

1. **Create Local Directory:**
    
    ```bash
    sudo mkdir /mnt/backup
    
    ```
2. **Mount the Share:**
    
    ```bash
    sudo mount -t cifs -o username=myuser,password=mypassword //192.168.1.100/backup /mnt/backup
    
    ```

Similarly, for a macOS share:

1. **Create Local Directory:**
    
    ```bash
    sudo mkdir /mnt/backup
    
    ```
2. **Mount the Share:**
    
    ```bash
    sudo mount -t cifs //192.168.1.100/backup /mnt/backup -o username=myuser,password=mypassword,nounix,sec=ntlmssp
    
    ```

### Additional Tips

- **FSTAB Entry for Persistent Mounts:** To make the mount persistent across reboots, add an entry to `/etc/fstab`:
    
    ```plaintext
    //yourIPAddress/yoursharedfolder /yourfoldertomount cifs username=yourusername,password=yourpassword,nounix,sec=ntlmssp 0 0
    
    ```
- **Security Note:** Storing passwords in plain text can be a security risk. Consider using a credentials file:
    
    ```plaintext
    //yourIPAddress/yoursharedfolder /yourfoldertomount cifs credentials=/etc/cifs-credentials,nounix,sec=ntlmssp 0 0
    
    ```
    
    And create `/etc/cifs-credentials` with the following content:
    
    ```plaintext
    username=yourusername
    password=yourpassword
    
    ```
    
    Ensure the credentials file has appropriate permissions:
    
    ```bash
    sudo chmod 600 /etc/cifs-credentials
    
    ```

## CentOS Details

If you are on CentOS and are migrating off of it and need to do it here is the old documentation on this same process:

1. For Linux to Windows:  
    
    1. **mount -t cifs -o username=**yourusername**,password=**yourpassword **//**yourIPAdress**/**yoursharedfolder **/**yourfoldertomount
2. For Linux to macOS  
    
    1. **sudo yum install cifs-utils**
    2. **mount -t cifs //**yourIPAddress**/**yoursharedfolder **/**yourfoldertomount **-o username=**yourusername**,password=**yourpassword**,nounix,sec=ntlmssp**

<p class="callout info">Create a folder and share it then replace this value "yourfoldertomount" with the right shared folder name.</p>

## Related Content

- [FileWave Server Backup and Restore](https://kb.filewave.com/books/filewave-server/page/filewave-server-backup-and-restore "FileWave Server Backup and Restore")