10月 202017
 

功能: 创建新的名字空间,并使得进程处于sleep状态,可以随时nsenter进来

测试 mnt 时发现,似乎并没有实现mount的隔离; 测试方法:

./new-namespace -m &

然后使用nsenter,分别在名字空间内外查看 /proc/self/mountinfo 的内容,发现如何操作,内外都是一致的。

注意: 需要和pid名字空间一起使用

 

参考: https://www.toptal.com/linux/separation-anxiety-isolating-your-system-with-linux-namespaces

 Posted by at 下午 12:08

  One Response to “创建新的名字空间”

  1. 因为nsenter一般是根据pid来查找需要进入的名字空间的ID的,如果能直接指定具体名字空间的ID应该也是可以的

Leave a Reply to phpor Cancel reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据