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.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

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

Write a response