> For the complete documentation index, see [llms.txt](https://docs.stackos.io/stackos-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackos.io/stackos-docs/operations/practice-persistent-data-alternate-user.md).

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