I created a simple test netns :
sudo ip netns add test
Then I brought up the lo interface.
I'm currently in the home directory of user1, and by executing
sudo ip netns exec test ls -la
I see all the files and directories, however, I can't access a certain directory with
sudo ip netns exec test cd MyDir
It just says: " exec of "cd" failed: No such file or directory "
Here are the access rights the directory I cant access:
drwxr-xr-x 7 user1 user1 4096 Jan 18 20:08 MyDir
Now it goes without saying that I can access MyDir without any issue from ANYWHERE else NO problem ! It also happens with other directories owned and created by user1.
So why is that, what am I doing wrong? I know anything executed with ip netns exec will be executed as root, but is that the issue?
ip netns
. Comparenice sleep 1
versusnice cd .
.