Skip to content

Commit 00723a2

Browse files
committed
update
1 parent d6f540f commit 00723a2

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

articles/container-apps/container-debug-console.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -161,21 +161,7 @@ By default, debug console runs as root user.
161161
You can access /proc/1 to access container's file system if your container runs as root user. If your container does not run as root user, run below command to switch user before accessing /proc/1 directory, or you'll get permission denied error.
162162

163163
```bash
164-
tdnf install -y shadow-utils
165-
app_gid=$(ps -ax --sort pid -o 'group' --no-headers | head -1)
166-
167-
if [ "$app_uid" != "$(whoami)" ]; then
168-
if [ -z "$(getent passwd $app_uid)" ]; then
169-
echo "User $app_uid does not exist. Creating..."
170-
groupadd -g $app_gid appgroup
171-
useradd -u $app_uid -g $app_gid appuser
172-
fi
173-
174-
echo "Switching to user $app_uid..."
175-
su appuser
176-
else
177-
echo "No need to switch user"
178-
fi
164+
switch-to-app-user
179165
```
180166

181167
---

0 commit comments

Comments
 (0)