0

I have linux system where i created network namespace "BLUE_NAME", requirement to access the /var/tmp files present in the BLUE_NAME network space to outside of the name space (Host Machine).Request you provide your suggestion.

1 Answer 1

2

Network namespaces itself create abstraction for network related components own list devices, routing tables, firewall rules.

Network namespace not affect filesystem.

But when we create namespace and run in namespace any utilities, this utilities will be works from user root, so we may run utils from needed to us user. <- Keep eye on this, I'm early run several times chrome* inside namespace and wondering where my settings.

Just try this:

#add namespace test
sudo ip netns add test

#run bash inside namespace, be carefull now you become root
sudo ip netns exec test /bin/bash

#create file in tmp "don't do this in scripts, in scripts use mktemp"
touch /tmp/test_from_namespace

Exit from bash inside namespace and destroy namespace

#destroy namespace
sudo ip netns del test

Then try as usual user list files in /tmp and you see created file

1
  • @user521705 You are welcome. Welcome on the serverfault.com May 2, 2019 at 7:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .