• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Linux Linux Namespaces: Isolating Processes

dEEpEst

☣☣ In The Depths ☣☣
Staff member
Administrator
Super Moderator
Hacker
Specter
Crawler
Shadow
Joined
Mar 29, 2018
Messages
13,861
Solutions
4
Reputation
32
Reaction score
45,552
Points
1,813
Credits
55,350
ā€Ž7 Years of Serviceā€Ž
 
56%
Linux Namespaces: Isolating Processes

šŸ‘‹ Welcome to the world of digital security, Hack Tools Dark Community!

Today, let's explore how Linux creates isolated "sandboxes" for processes using namespaces.

  • āŗ PID Namespace - Your Own Process Tree:
    Isolate processes so they only see each other without accessing host processes.

    Bash:
    sudo unshare --pid --fork --mount-proc /bin/bash

    Inside the new shell, use:
    Bash:
    ps aux

    As a result, you will only see the processes launched within this namespace.
  • āŗ NET Namespace - Separate Network for Each Container:
    Create a separate network stack with unique interfaces and IP addresses.

    Bash:
    sudo ip netns add mynetns
    sudo ip netns exec mynetns bash
    ip link show

    Inside the namespace, only the local interface will be available initially, offering complete network isolation.
  • āŗ MNT Namespace - Isolate File Systems:
    Provide each process with its own mount points. This allows working with different filesystems without affecting the host.

    Bash:
    sudo unshare --mount /bin/bash
    mount -t tmpfs tmpfs /mnt
    mount | grep /mnt

    The newly created mount point will be visible only inside the namespace, hidden from the host system.




āš ļøDisclaimer:
This post is for educational purposes only. Use the information responsibly and only in environments where you have permission to perform such actions.

šŸ’¬ Join the discussion below! Share your experiences with namespaces or ask questions!
 
Back
Top