# Practice - Persistent Data, Alternate User

**App Name:** switch

**Image**: nginx:1.21

**Persistent Data Directory:** /data&#x20;

**CPU:** 500

**RAM:** 500

## ✅ Create Application

![](/files/R9XQwKVbgAOrOpmtCGST)

![](/files/uT0Jd1Psnl8ZVRcmBTsm)

## ✅ Use WebTTY and enter your pod

{% content-ref url="/pages/6Lt7THKcrasjl5i7evFj" %}
[Create WebTTY](/stackos-docs/operations/create-webtty.md)
{% endcontent-ref %}

## ✅ After getting a shell into your pod

\---

## ✅ Check /data is owned by root

`root# ls -al /data`

`total 24`

`drwxr-xr-x 3 root root  4096 Jan 19 12:54 .`

`drwxr-xr-x 1 root root  4096 Jan 19 12:57 ..`

`drwx------ 2 root root 16384 Jan 19 12:54 lost+found`

<br>

<br>

## ✅ Create demo user

`groupadd demo`

`useradd demo -g demo -m`

<br>

## ✅ Give /data to demo user

`chown demo:demo /data`

<br>

## ✅ Prove we can use a user that only exists in this pod

`su - demo -c whoami`

`demo`

<br>

## ✅ Run a command as another user

`root# su demo -c "touch /data/myfile"`

<br>

## ✅ See a resulting file owned by the other user (which doesn't exist in the "hypervisor")

`root# ls -al /data`

`total 24`

`drwxr-xr-x 3 demo demo  4096 Jan 19 13:01 .`

`drwxr-xr-x 1 root root  4096 Jan 19 12:57 ..`

`drwx------ 2 root root 16384 Jan 19 12:54 lost+found`

`-rw-r--r-- 1 demo demo     0 Jan 19 13:01 myfile`


---

# 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://docs.stackos.io/stackos-docs/operations/practice-persistent-data-alternate-user.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.
