16/01/2026

K8s – container root login

Find the pid of container process
sudo crictl inspect CONTAINER_ID | grep -i "pid" | awk '{print $2}'

Use nsenter to enter container as root
sudo nsenter -t CONTAINER_PID -m -u -i -n -p -- su - root