CentOS 7系统,Docker想启用userns-remap,傻了吧?

今天想启用这个功能,

这样,docker里的root用户,就不用是宿主机的root用户,

安全性可以提高一个层次。

于是找了文档,对比了配置,default用了,自定义用了,

结果呢?

傻眼了~~~~全都失败。


~~~~~~~~~~~~~~~~~~~~

花了几小时,再想找找为何失败,

结果,原来在centos/rhel中, user namespaces只是一个预览功能。

要用命令才能开启!!!!

OMG,不知敢不敢用了。


http://cache.baiducontent.com/c?m=9d78d513d9951cfe01bad4690d6790274e1497624c8b91027ea48448e5735a310731bce8653657448dca262147ed084beb832b6f675d7de28cc8ff1b9cedce3f2fff7b633601d31453985eaaca44389260d601b8f14efaeca774c0f58c92c25158ce50067f87f3&p=c27ec54ad5c516f30be296605055&newp=8b2a970e8ed505fd11bd9b7d0b4092695803ed633fd6d301298ffe0cc4241a1a1a3aecbf2025110fd7c2786703a44b58ecf03273330834f1f689df08d2ecce7e64d031702255&user=baidu&fm=sc&query=docker+userns-remap&qid=a68e3d2a000023c9&p1=11


https://segmentfault.com/q/1010000010909708

https://bugzilla.redhat.com/show_bug.cgi?id=1349704


========================

grubby --args="user_namespace.enable=1" --update-kernel="$(grubby --default-kernel)"
    reboot

If you're using CentOS 7, there are two things you need to know.

1.User Namespaces is not enabled on the kernel by default. You can enable it by executing the following command and restart the system.

sudo grubby --args="user_namespace.enable=1" \
    --update-kernel=/boot/vmlinuz-3.10.0-XXX.XX.X.el7.x86_64
The user namespaces are "Technology Preview" and disabled by default, see kernel implementation https://bugzilla.redhat.com/show_bug.cgi?id=1138782

If I good remember you need to enable it on kernel command line
(something like grubby --args=user_namespace.enable=1 + reboot).
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值