Practice - Persistent Data, Alternate User
Last updated
Last updated
App Name: switch
Image: nginx:1.21
Persistent Data Directory: /data
CPU: 500
RAM: 500
---
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
groupadd demo
useradd demo -g demo -m
chown demo:demo /data
su - demo -c whoami
demo
root# su demo -c "touch /data/myfile"
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