# Practice - Persistent Data, Alternate User

**App Name:** switch

**Image**: nginx:1.21

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

**CPU:** 500

**RAM:** 500

## ✅ Create Application

![](https://595251010-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ml8spdZ1HNNSGfvTi3F%2Fuploads%2FOy4ai3vvdSXrrepp6YC0%2Fswitch%20page%201.png?alt=media\&token=83b90a68-fc01-430b-b7aa-0059d2025f44)

![](https://595251010-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Ml8spdZ1HNNSGfvTi3F%2Fuploads%2FtZjNtp18lLSbTGz4iOem%2Fswitch%20page%202.png?alt=media\&token=c5aa5bd1-a706-4e1f-a86b-fc012e679a88)

## ✅ Use WebTTY and enter your pod

{% content-ref url="create-webtty" %}
[create-webtty](https://docs.stackos.io/stackos-docs/operations/create-webtty)
{% 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`
