Skip to content

Commit

Permalink
PD-1461 Backport User Home Directory Changes to 24.10 (#3087)
Browse files Browse the repository at this point in the history
This PR backports the content and image changes to user home directory content to the 24.10 branch

Co-authored-by: DjP-iX <[email protected]>
Co-authored-by: linzibelle <[email protected]>
  • Loading branch information
3 people authored Oct 4, 2024
1 parent 24f14ee commit 950064b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions content/SCALETutorials/Credentials/ManageLocalUsersSCALE.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,17 @@ Leave the **Create New Primary Group** toggle enabled to allow TrueNAS to create
To add the user to a different existing primary group, disable the **Create New Primary Group** toggle and search for a group in the **Primary Group** field.
To add the user to more groups use the **Auxiliary Groups** dropdown list.

Configure a home directory and permissions for the user. Some functions, such as replication tasks, require setting a home directory for the user configuring the task.
[Configure a home directory](#adding-home-directories) and permissions for the user. Some functions, such as replication tasks, require setting a home directory for the user configuring the task.

{{< trueimage src="/images/SCALE/Credentials/AddUserHomeDirPermSCALE.png" alt="Add User Home Directory" id="Add User Home Directory" >}}
{{< trueimage src="/images/SCALE/Credentials/AddUserHomeDirPerm.png" alt="Add User Home Directory" id="Add User Home Directory" >}}

When creating a user, the home directory path is set to <file>/var/empty</file>, which does not create a home directory for the user.
When creating a user, the default home directory path is set to **/var/empty**.
This directory is an immutable directory shared by service accounts and accounts that should not have a full home directory.
If set to this path TrueNAS does not create a home directory for the user. You must change this to the path for the dataset created for home directories.

To add a home directory, enter or browse to a path in **Home Directory**, then select **Create Home Directory**.
Select **Read**, **Write**, and **Execute** for each role (**User**, **Group**, and **Other**) to set access control for the user home directory.
Built-in users are read-only and can not modify these settings.

{{< expand "Why did this change in TrueNAS 24.04 (Dragonfish) and later?" "v" >}}
TrueNAS uses the `pam_mkhomdir` PAM module in the pam_open_session configuration file to automatically create user home directories if they do not exist.
Expand All @@ -97,16 +102,11 @@ Starting in SCALE 24.04 (Dragonfish), the root filesystem of TrueNAS is read-onl
This results in a permissions error if `pam_open_session()` is called by an application for a user account that has **Home Directory** set to **/nonexistent**.
{{< /expand >}}

To add a home directory, enter or browse to a path in **Home Directory**, then select **Create Home Directory**.

{{< trueimage src="/images/SCALE/Credentials/AddUserHomeDirAuthSCALE.png" alt="Add User Home Directory and Authentication Settings" id="Add User Home Directory and Authentication Settings" >}}

Select **Read**, **Write**, and **Execute** for each role (**User**, **Group**, and **Other**) to set access control for the user home directory.
Built-in users are read-only and can not modify these settings.

Assign a public SSH key to a user for key-based authentication by entering or pasting the public key into the **Authorized Keys** field.
You can click **Choose File** under **Upload SSH Key** and browse to the location of an SSH key file.

{{< trueimage src="/images/SCALE/Credentials/AddUserHomeDirAuth.png" alt="Add User Home Directory and Authentication Settings" id="Add User Home Directory and Authentication Settings" >}}

{{< hint type=important >}}
Do *not* paste the private key.
{{< /hint >}}
Expand All @@ -126,6 +126,18 @@ Leave **SMB User** selected to allow using the account credentials to access dat

Click **Save**.

### Adding Home Directories
To add a home directory for a user account, first create a dataset to use for user home directories, for example a dataset named *homedirs*.

Next, go to **Credentials > Users** and either click **Add** to add a new user and their home directory, or select an existing user, click **Edit**, and then add a home directory for the user.
While on the user configuration screen:

Enter the path to the new dataset for home directories in **Home Directory**. For example, change **/var/empty/** to the path to the new dataset */tank/homedirs*.

Next select **Create Home Directory**, and select the level of permissions you want to apply. We recommend leaving the default selections, **Read/Write/Execute** selected for the user home directory.

Click **Save**. TrueNAS creates the new home directory for the user.

## Editing User Accounts

To edit an existing user account, go to **Credentials > Users**.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit 950064b

Please sign in to comment.