简体   繁体   English

rkt容器中“ root”帐户的“受限”访问权限

[英]“Restricted” access right for the “root” account in a rkt container

I meet some issues while trying to execute commands as a root in my rkt containers. 在尝试以rkt容器的根用户身份执行命令时遇到一些问题。

I run the rkt engine as a sudo. 我将rkt引擎作为sudo运行。 Inside of the launched container, I also am logged as a root. 在启动的容器中,我也以root用户身份登录。 But it seems that I am not a "real" root inside. 但似乎我不是内心的“真正”根源。

For example, when I try to run a "chrt" command on a launched process which I own, I get the following answer: 例如,当我尝试在自己拥有的启动进程上运行“ chrt”命令时,得到以下答案:

[root@rkt-b1e45e35-f3e7-4cc2-88ea-58d06809dd5d /]# chrt -p -f 99 25
Unable to change scheduling policy!
either run as root or join realtime group**

Other example, when I try to login as another user I created in my container, I have the following error message: 另一个示例,当我尝试以在容器中创建的另一个用户身份登录时,出现以下错误消息:

[root@rkt-b1e45e35-f3e7-4cc2-88ea-58d06809dd5d /]# su toto
Bad system call

(note: I have the same message when I try to launch a "sudo" command). (注意:当我尝试启动“ sudo”命令时,我有相同的消息)。

I also tried to add toto or root either to "root" usergroup or to the "realtime" one but it still does not work. 我还尝试将toto或root添加到“ root”用户组或“实时”用户组,但仍然无法正常工作。

Other expressive example, when I try to apply (as a root) a chmod +w on a file owned by root with the following confifuration : rw-r--r-- , I have an access denied message... 其他富有表现力的示例,当我尝试(以root用户身份)将chmod +w应用于root拥有的文件时,其配置如下: rw-r--r-- ,我收到了拒绝访问的消息...

For information, a rkt image cat manifest xxx command on my rkt image gives the following output: 有关信息,我的rkt映像上的rkt image cat manifest xxx命令提供以下输出:

{ "acKind": "ImageManifest", "acVersion": "0.6.1", "name": "xxxxxxxxxx", "labels": [ { "name": "version", "value": "latest" }, { "name": "arch", "value": "amd64" }, { "name": "os", "value": "linux" } ], "app": { "exec": [ "/bin/bash" ], "user": "root", "group": "root", "workingDirectory": "/", "environment": [ { "name": "PATH", "value": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" } ] } } {“ acKind”:“ ImageManifest”,“ acVersion”:“ 0.6.1”,“ name”:“ xxxxxxxxxx”,“ labels”:[{“ name”:“ version”,“ value”:“ latest”}, {“ name”:“ arch”,“ value”:“ amd64”},{“ name”:“ os”,“ value”:“ linux”}],“ app”:{“ exec”:[“ / bin / bash“],” user“:” root“,” group“:” root“,” workingDirectory“:” /“,” environment“:[{” name“:” PATH“,” value“:” / usr / local / sbin:/ usr / local / bin:/ usr / sbin:/ usr / bin:/ sbin:/ bin“}]}}

Do you have any idea about the origin of my issue? 您对我的问题的起源有任何想法吗?

I found the solution : I simply had to add more "--caps-retain" parameters in the rkt run command. 我找到了解决方案:我只需要在rkt run命令中添加更多“ --caps-retain”参数。 (per default, the local pseudo root user has strong limitations) (默认情况下,本地伪root用户具有严格的限制)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM