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.