There’s no crictl exec -u 0 and this is a solution.

Jbn1233
Sep 26, 2020

--

To run a command in a running container:

# crictl exec -it ebacf64845b36a sh   
/pgadmin4 $ id
uid=5050(pgadmin) gid=5050(pgadmin)

But how to become root or another user ID ?

crictl exec -it -u 0 ebacf64845b36a sh 
Incorrect Usage: flag provided but not defined: -u

No this is cricrl not docker, We don’t do that here. Use runc instead

# runc exec -t -u 0 ebacf64845b36a816432bd9ca34da0892b568832d7d2f505f4d14eacb583f639 sh
/pgadmin4 # id
uid=0(root) gid=5050(pgadmin)

PS. runc need full container ID. you must inspect it first.

--

--

Jbn1233
Jbn1233

Written by Jbn1233

Very short and simple notes for CKA/SRE and may not works on your environment | jbn1233@gmail.com | Bangkok, Thailand |

No responses yet