Site icon New Generation Enterprise Linux

Auditing Namespace Membership via Procfs

Container Basics On Linux (Namespaces/Cgroups)

Auditing Namespace Membership via Procfs

🧩 The Challenge

It is often difficult to verify which specific kernel namespaces a running process is currently sharing with the host or other containers. Manually mapping these relationships is complex when dealing with layered container runtimes.

💡 The Fix

Inspect the symbolic links within the process’s proc directory to see the unique inode numbers associated with each namespace type.

ls -l /proc/$$/ns/

⚙️ Why It Works

Each entry in the /proc/[pid]/ns/ directory represents a namespace; processes sharing the same inode number for a specific namespace type are physically inside that same boundary.

🚀 Pro-Tip: Use readlink /proc/self/ns/net to quickly extract the net namespace ID for automation scripts.

Linux Tips & Tricks | © ngelinux.com | 7/8/2026

0 0 votes
Article Rating
Exit mobile version