# Local NAS Users and Groups

<br/>

<a id="creating-nas-users"></a>

## Creating NAS Users

By default “root” User and Group at the NFS client are mapped to
“root” User and Group in the VPSA. To prevent remote “root” access
to the Volume enable the “NFS Root Squash” setting,
either at the time the Volume is created or later under
Volumes > Properties. All other client-side
Users are mapped to User “nobody” and Group “nogroup”.

To configure a basic NAS authentication so that Users and Groups on
the NFS client will be mapped to the corresponding Users and Groups at the
VPSA, perform the following steps:

- Go to VPSA GUI > Settings > NAS tab and press Edit for **NFS
  Domain**. The NFS Domain dialog will appear:

![image79](media/image79.png)

- Enter the NFS domain name identical to the domain name set in the Client
  and press the Update button. Typically the default domain
  name on a Linux client is “localdomain” and is therefore also
  the default value in the VPSA.

- Go to VPSA GUI > NAS Users and press the Create button.
- Enter a Username.
- Select the NFS checkbox for Authentication.
- Enter a NFS UID (in the range 1-999,999).
- If you wish to grant this User access to SMB shares as well, also
  : select the SMB checkbox and enter a password (which
    will be used later when mounting the NAS Volume on a Windows Client).

![image80](media/image80.png)

<a id="creating-smb-users"></a>

## Creating SMB Users

- Go to VPSA GUI > NAS Users and click the Create button.
- Enter a Username.
- Select the SMB checkbox for Authentication.
- Enter a password. You will be asked to provide this username
  and SMB password when mapping a network drive on the Windows
  Client.
- If you wish to grant this user access to NFS shares as well, also
  check the NFS checkbox and enter a NFS UID (in the range of 1-999,999).

![image81](media/image81.png)

<br/>

## Editing SMB Users Password

It is possible to edit the Password of a SMB User at any time. Go to
the NAS Users page and select Edit SMB Password:

![image82](media/image82.png)

- To change the SMB Password enter a new SMB Password, confirm the
  password and click the Change Password button.
- If the User is also defined with a NFS ID you can press the
  Remove Password button to erase the User SMB Password.

### Creating NAS Groups

You can create and view NAS Groups via the NAS Groups page.

To create a NAS Group go to VPSA GUI > NAS Groups and click the Create button.

![image83](media/image83.png)

- Enter a name for the NAS Group. This should match the Group name on the NFS client.
- Select either NFS or SMB checkbox (or both) for Authentication.
- If you are creating a NFS group also add a valid NFS Group ID (in the
  range of 1-999,999) that matches the Group Name and GID on your Linux
  Server.

<br/>

### Managing NAS Quotas

<br/>

## Enabling or Disabling User/Group/Project Quotas

To enable/disable Quotas on a given NAS share, open the VPSA GUI > Volumes
and select the Volume on which you want to set Quotas. In the
South Panel, scroll down to the User Quotas and Group Quotas lines and
click the edit icon.

![image88](media/image88.png)

In the dialog that opens, select the Off or On option.

The same process applies for enabling Group and Project quotas.

**Quotas Configuration File Format**

This is a CSV file where each line sets the quota for a specific user or group.

The line syntax is the following:

```default
type,is_user,id,usage,soft,hard,warns,name
```

Where:

* **type:** 1-nfsid or 2-nasuser or 3-aduser
* **is_user:** 0-groups or 1-users
* **id:** uid or gid (if type=’aduser’ and id is still unknown, set to 0 and name will be translated to id
* **usage:** 0
* **soft:** 0
* **hard:** hard limit in MB
* **warns:** 0
* **name:** AD name or NAS name

e.g.:

```default
1,1,50001,0,0,28,0,-
3,1,2015348,0,0,24,0,ZADARA\user1
3,1,0,0,0,24,0,ZADARA\user2
```

<br/>

<a id="setting-user-group-quotas"></a>

## Setting User/Group Quotas

To set quota limits on a given NAS Volume go to the
VPSA GUI > Volumes, select the Volume where you want to set up Quotas and click
Quotas

![image89](media/image89.png)

In the dialog that opens, you can set the Quotas for Users, Groups and Projects (as applicable).

If you want to define a default Quota for all Users on the selected
Volume, enter the default limit and click the Update defaults
button.

**Automatic Users discovery:**

Press the Refresh button. If this VPSA is connected to an Active
Directory the system will scan the AD to find users that have data on
this volume. They will all be added and given the default limit. You can
edit and change the default value.

If the VPSA is not connected to an Active Directory, a similar scan will be
done against all locally defined Users.

**Adding User Quotas manually:**

In addition, other Users can be added to the Quotas list even if
they don’t currently have any files on the given volume. Click Add Quotas
and then fill in the User details in the line that opens. The User
ID should be entered according to the User type. There are 3 User types:

1. **Active Directory user** – the ID is the user name in this format:
   Domain\\username
2. **NAS user** – the ID is the same name as defined in NAS Users.
3. **NFS User** – use the UID as defined in UNIX/Linux systems

![image90](media/image90.png)

Setting Groups Quotas is the same as described above for Users. Click
the Groups tab and repeat the same process.

After making any additions or changes to Quota Limits,
on the Quotas dialogue box press ‘Refresh’ to update the figures displayed.

<br/>

<a id="setting-project-quotas"></a>

## Setting Project Quotas

Project Quotas are quotas set on a group of one or more folders.
Setting these quotas is done in 2 steps: Defining the Projects and then setting the limits.

**Defining Projects**

To define a Project on a given NAS Volume open the
VPSA GUI > Volumes page, select the Volume you want to set Quotas on and click
Quotas. On the dialog that opens select the Projects and click
Manage projects.

![image90a](media/image90a.png)

Click Add Project and add directories to this Project.
When done click Save and close.

![image90b](media/image90b.png)

**Setting Projects Quotas**

Click Add Quotas, select the project of interest and set its quota limit.
When done click Add Quotas and close.

![image90c](media/image90c.png)

Finally, on the Quotas dialogue box, press Refresh to update the Quota Limits displayed.
