{"id":481295,"date":"2026-05-27T17:57:58","date_gmt":"2026-05-27T17:57:58","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=481295"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=481295","title":{"rendered":"Root \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u2014 \u044d\u0442\u043e root \u043d\u0430 \u0445\u043e\u0441\u0442\u0435? \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u044e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 Docker\/Podman"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/7c\/3e\/de\/7c3ede98c7bafa9fd27675116534ad33.png\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/webt\/7c\/3e\/de\/7c3ede98c7bafa9fd27675116534ad33.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/webt\/7c\/3e\/de\/7c3ede98c7bafa9fd27675116534ad33.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e\u0442 \u044f\u0434\u0440\u043e \u0441 \u0445\u043e\u0441\u0442\u043e\u043c. \u042d\u0442\u043e \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u0432\u0430\u0436\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u043a\u0430\u043a Unix-\u043f\u0440\u0430\u0432\u0430 \u0441\u043e\u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u0438 \u0445\u043e\u0441\u0442\u043e\u0432\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u043e\u0439?<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c volume \u2014 bind mount \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u0445\u043e\u0441\u0442\u0430, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043b\u0435\u0436\u0438\u0442 \u0444\u0430\u0439\u043b <code>config.yml<\/code>:<\/p>\n<pre><code>\/some-volume\/config.yml<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<ol>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u0443 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 <code>root<\/code> \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u2014 \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u044d\u0442\u043e \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 <code>root<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430?<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c <code>gtosss<\/code> \u2014 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u0443?<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <code>gtosss<\/code> \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u0432\u044b\u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0444\u0430\u0439\u043b \u2014 \u0441\u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0445\u043e\u0441\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u043f\u043e\u0434 \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c?<\/p>\n<\/li>\n<\/ol>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0435 \u2014 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441.<\/p>\n<blockquote>\n<p>\u041f\u0435\u0440\u0435\u0434 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435\u043c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u2014 <a href=\"https:\/\/habr.com\/ru\/articles\/1027674\/\" rel=\"noopener noreferrer nofollow\">\u041f\u0440\u0430\u0432\u0430 \u0432 Linux: chown\/chmod, SELinux context, \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u0430\u044f\/\u0432\u043e\u0441\u044c\u043c\u0435\u0440\u0438\u0447\u043d\u0430\u044f \u043d\u043e\u0442\u0430\u0446\u0438\u044f, DAC\/MAC\/RBAC\/ABAC<\/a><\/p>\n<\/blockquote>\n<hr\/>\n<h2>\u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c<\/h2>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0433\u043e\u043b\u043e\u0432\u0435, \u2014 \u044f\u0434\u0440\u043e \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u0435 \u0438\u043c\u0435\u043d\u0430\u043c\u0438, \u0430 \u0430\u0439\u0434\u0438\u0448\u043d\u0438\u043a\u0430\u043c\u0438 UID \u0438 GID:<\/p>\n<ul>\n<li>\n<p>UID \u2014 User ID<\/p>\n<\/li>\n<li>\n<p>GID \u2014 Group ID<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0438\u0445 ID \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <code>\/etc\/passwd<\/code>.<\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0438\u0434\u0430:<\/p>\n<pre><code>gtosss:x:1000:1000:gtosss:\/home\/gtosss:\/bin\/bash<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u042d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c <code>:<\/code><\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/f1\/e4\/44\/f1e444fcc84004b2e52d6f414f3c57d2.png\" alt=\"\u0420\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0441\u0442\u0440\u043e\u043a \u0438\u0437 \/etc\/passwd\" sizes=\"(max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/webt\/f1\/e4\/44\/f1e444fcc84004b2e52d6f414f3c57d2.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/webt\/f1\/e4\/44\/f1e444fcc84004b2e52d6f414f3c57d2.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0420\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0441\u0442\u0440\u043e\u043a \u0438\u0437 \/etc\/passwd<\/figcaption><\/div>\n<\/figure>\n<hr\/>\n<h2>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0443 \u0434\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432<\/h2>\n<p>\u041e\u043f\u0438\u0448\u0435\u043c <code>docker-compose.yml<\/code><\/p>\n<pre><code>services:  alpine-playground:    image: alpine:3.22    container_name: alpine-playground    volumes:      - .\/common:\/common    command: [\"sleep\", \"infinity\"]    restart: unless-stopped<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441 \u0444\u0430\u0439\u043b\u043e\u043c \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442.<\/p>\n<pre><code class=\"bash\">mkdir common<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<pre><code class=\"bash\">echo 'hello from host' &gt; docker-common\/message.txt<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h2>\u041e\u0442\u0432\u0435\u0447\u0430\u0435\u043c \u043d\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432 Ubuntu 22<\/h2>\n<h3>1. \u0415\u0441\u043b\u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u0443 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 root \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u2014 \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u044d\u0442\u043e \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 root \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430?<\/h3>\n<p>\u041d\u0430 \u0445\u043e\u0441\u0442\u0435 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f gtosss \u0441 UID 1000. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0438 \u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u0435\u043c\u0443. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u044f \u0437\u0430\u043f\u0443\u0449\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438 \u0437\u0430\u0439\u0434\u0443 \u0432\u043d\u0443\u0442\u0440\u044c \u043d\u0435\u0433\u043e<\/p>\n<pre><code class=\"bash\">docker exec -it alpine-playground sh<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u044f root, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0444\u0430\u0439\u043b \u0438\u0437 \u0432\u043e\u043b\u0443\u043c\u0430:<\/p>\n<pre><code>\/ # ls -l commontotal 4-rw-r--r--    1 1000     1000            16 May  9 22:22 message.txt<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441\u0440\u0430\u0437\u0443 UID \u0438 GID. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<pre><code>\/common # stat message.txt  File: message.txt  Size: 16              Blocks: 8          IO Block: 4096   regular fileDevice: 820h\/2080d      Inode: 17210       Links: 1Access: (0644\/-rw-r--r--)  Uid: ( 1000\/ UNKNOWN)   Gid: ( 1000\/ UNKNOWN)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><code>Uid: ( 1000\/ UNKNOWN)<\/code> \u2014 UID 1000, \u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043a\u0430\u043a \u0438 \u0433\u0440\u0443\u043f\u043f\u0430, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b. UNKNOWN (\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d) \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0441\u0432\u043e\u0439 \u0444\u0430\u0439\u043b <code>\/etc\/passwd<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 <code>gtosss<\/code> \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b\u0441\u044f.<\/p>\n<p>\u0418 \u0432\u0440\u043e\u0434\u0435 \u0432\u0441\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0434\u043b\u044f \u0432\u0441\u0435\u0445, \u043a\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c, \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0447\u0442\u0435\u043d\u0438\u0435:<\/p>\n<pre><code>0644\/-rw-r--r--   \u2191        \u2191<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0427\u0438\u0442\u0430\u0435\u043c \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c:<\/p>\n<pre><code>\/ # cat common\/message.txthello from host<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0410 \u043c\u043e\u0436\u0435\u0442 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044f\u0434\u0440\u043e linux \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043c\u0435\u043d\u044f root\u2019\u043e\u043c? \u0427\u0442\u043e \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0437\u0430\u043f\u0438\u0441\u0438:<\/p>\n<pre><code>echo 'hello from container' &gt;&gt; message.txt<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b. \u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441 \u0445\u043e\u0441\u0442\u0430:<\/p>\n<pre><code>\/common # cat message.txthello from hosthello from container<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u044b\u0445\u043e\u0434\u0438\u0442, \u043c\u044b \u0431\u0443\u0434\u0443\u0447\u0438 \u0440\u0443\u0442\u043e\u043c \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0443\u0431\u0435\u0434\u0438\u043b\u0438 \u044f\u0434\u0440\u043e linux \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u044f\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u0440\u0443\u0442\u043e\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u0435\u0436\u0438\u0442 \u0432 \u0445\u043e\u0441\u0442\u043e\u0432\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<p>\u041d\u0430 \u0445\u043e\u0441\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c \u0444\u0430\u0439\u043b\u0430 root \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u043c\u0443 \u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0430.<\/p>\n<p>\u041d\u0430 \u0445\u043e\u0441\u0442\u0435 \u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u0440\u0443\u0442\u0430, \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430. \u0418\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"bash\">ls -ltotal 4-rw------- 1 root root 60 May 10 18:00 message.txt<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u0440\u0443\u0442\u0443 \u0438 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043a \u043d\u0435\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u0430:<\/p>\n<p>\u0417\u0430\u0439\u0434\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u0435\u0433\u0440\u0430\u0434, \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b, \u0432 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c:<\/p>\n<pre><code>\/common # echo 'hello from container 2' &gt;&gt; message.txt<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u044b\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0438 \u0441 \u0445\u043e\u0441\u0442\u0430, \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0441\u0443\u043f\u0435\u0440-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0447\u0438\u0442\u0430\u0435\u043c:<\/p>\n<pre><code>sudo cat message.txt<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u0438\u0434\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435:<\/p>\n<pre><code>hello from hosthello from containerhello from container 2<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0414\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u0432 Ubuntu, root \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u044d\u0442\u043e \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 root \u0447\u0442\u043e \u0438 \u0432 \u0445\u043e\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u042f\u0434\u0440\u043e \u043b\u0438\u043d\u0443\u043a\u0441 \u0434\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0443\u043f\u0435\u0440-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u0414\u043b\u044f \u043d\u0435\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0438\u0441\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u0435. \u041c\u043e\u0436\u043d\u043e \u043d\u0435\u043e\u0441\u043e\u0437\u043d\u0430\u043d\u043d\u043e \u0434\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0440\u0443\u0442\u043e\u0432\u043e\u0439 \u0411\u0414, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443.<\/p>\n<h3>2. \u0415\u0441\u043b\u0438 \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c gtosss \u2014 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u0443?<\/h3>\n<p>\u041d\u0430 \u0445\u043e\u0441\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c \u0444\u0430\u0439\u043b\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <code>gtosss<\/code>. \u0414\u043e\u0441\u0442\u0443\u043f\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code>Access: (0600\/-rw-------)  Uid: ( 1001\/  gtosss)   Gid: ( 1002\/  gtosss)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0440\u044b\u0433\u0438\u0432\u0430\u0435\u043c \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <code>gtosss<\/code> \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u043e\u0439 \u0443 \u043d\u0435\u0433\u043e UID.<\/p>\n<pre><code class=\"bash\">\/ $ cat etc\/passwd | grep gtosssgtosss:x:1000:1000::\/home\/gtosss:\/bin\/sh<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e UID \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f gtosss \u2014 1000. \u041d\u0430 \u0445\u043e\u0441\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0438\u043c\u0435\u0435\u0442 UID 1001. \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0444\u0430\u0439\u043b:<\/p>\n<pre><code>\/common $ cat message.txtcat: can't open 'message.txt': Permission denied<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 UID \u0447\u0442\u043e \u0443 \u043d\u0430 \u0445\u043e\u0441\u0442\u0435. \u041d\u0430 linux alpine \u0443\u0442\u0438\u043b\u0438\u0442\u0430 <code>usermod<\/code> \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442 <code>shadow<\/code> \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430:<\/p>\n<pre><code class=\"bash\">apk add shadow<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c UID 1001<\/p>\n<pre><code class=\"bash\">usermod -u 1001 gtosss<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0418 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:<\/p>\n<pre><code class=\"bash\">\/ $ cat \/common\/message.txthello from hosthello from containerhello from container 2<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u0443, \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u043c\u0441\u044f, \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u044e\u0437\u0435\u0440\u0430 \u0441 \u0442\u0435\u043c \u0436\u0435 UID. \u041f\u0440\u0438\u0447\u0435\u043c \u0438\u043c\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u044f\u0434\u0440\u043e \u043b\u0438\u043d\u0443\u043a\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e ID \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0433\u0440\u0443\u043f\u043f\u044b.<\/p>\n<h3>3. \u0415\u0441\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u0432\u044b\u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0444\u0430\u0439\u043b \u2014 \u0441\u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0445\u043e\u0441\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u043f\u043e\u0434 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c?<\/h3>\n<p>\u0414\u0443\u043c\u0430\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u043d\u0438\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0434\u0430\u0436\u0435 \u0431\u0435\u0437 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u0420\u0435\u0448\u0430\u044e\u0449\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432 \u043a \u0444\u0430\u0439\u043b\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f UID. \u0422\u0443\u0442 \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u0430\u043a \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0435.<\/p>\n<h2>\u041e\u0442\u0432\u0435\u0447\u0430\u0435\u043c \u043d\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432 SELinux (Fedora Linux)<\/h2>\n<p>\u041d\u0430 \u0441\u0432\u043e\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Fedora, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u044f\u0434\u0440\u0430 SELinux (Security-Enhanced Linux). SELinux \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0438\u0442\u0438\u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0412\u043c\u0435\u0441\u0442\u043e Docker \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Podman \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0438\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439, \u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. Podman \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0431\u0435\u0437 \u043f\u0440\u0430\u0432 root (\u0440\u0435\u0436\u0438\u043c rootles), \u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n<hr\/>\n<p>\u041d\u0430 \u0445\u043e\u0441\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0435\u0440\u0435\u0437 <code>ls -l<\/code> \u043a\u0430\u043a\u0438\u0435 \u0443 \u0444\u0430\u0439\u043b\u0430 \u043f\u0440\u0430\u0432\u0430<\/p>\n<pre><code>-rwxr--r--. 1 gtosss gtosss 16 May  9 09:48 message.txt<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0439\u0434\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0438\u0437\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/p>\n<pre><code>gtosss@laptop-dc:~\/playground$ podman exec -it alpine-playground sh<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043c\u044b root, \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \/common:<\/p>\n<pre><code>\/common # ls -lls: can't open '.': Permission denied<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b unix \u043f\u0440\u0430\u0432 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0435\u0442. \u041d\u0430 Ubuntu \u043c\u044b \u0438\u043c\u0435\u043b\u0438 \u0431\u044b \u0434\u043e\u0441\u0442\u0443\u043f, \u043d\u043e \u0442\u0443\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 SELinux \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 Podman. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0432\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 SELinux \u0438 Podman \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 Ubuntu \u0438 Docker.<\/p>\n<h3>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u0430\u044f \u2014 SELinux \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432<\/h3>\n<p>\u0412\u044b\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c context SELinux \u0447\u0435\u0440\u0435\u0437 <code>stat<\/code>:<\/p>\n<pre><code class=\"bash\">gtosss@laptop-dc:~\/playground$ stat common   File: common  Size: 22              Blocks: 0          IO Block: 4096   directoryDevice: 0,44    Inode: 3457892     Links: 1Access: (0744\/drwxr--r--)  Uid: ( 1000\/  gtosss)   Gid: ( 1000\/  gtosss)Context: unconfined_u:object_r:user_home_t:s0<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u044d\u0442\u0430 \u0441\u0442\u0440\u043e\u043a\u0430:<\/p>\n<pre><code>Context: unconfined_u:object_r:user_home_t:s0<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/articles\/1027674\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435 \u043e \u043f\u0440\u0430\u0432\u0430\u0445 linux<\/a> \u0435\u0441\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u0415\u0441\u043b\u0438 \u043e\u043d\u0430 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0442\u0430\u0442\u044c\u0435\u0439. \u0410 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0441 <a href=\"https:\/\/habr.com\/ru\/articles\/1035908\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0431\u043d\u043e\u0440\u0434\u0438\u043d\u0433\u043e\u043c \u043f\u043e SELinux<\/a> \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u043e \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430\u0445 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0430\u0432\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u0442\u0438\u043f\u043e\u043c <code>user_home_t<\/code>. \u0414\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0444\u0430\u0439\u043b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u043c\u0435\u044e\u0442 \u0441\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0438\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (<code>user_t<\/code>, <code>staff_t<\/code>) \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0442\u0438\u043f\u0430 <code>unconfined_t<\/code>. \u041f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0435\u0442\u043a\u0443 \u0434\u043b\u044f \u0432\u043e\u043b\u0443\u043c\u0430 (bind mount), \u0447\u0442\u043e\u0431\u044b Podman \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u043b \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u0443.<\/p>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Docker \u0438 Podman:<\/p>\n<ul>\n<li>\n<p><code>z<\/code> (\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f) &#8212; \u0435\u0441\u043b\u0438 volume \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 (\u043d\u0430\u0448 \u0441\u043b\u0443\u0447\u0430\u0439, \u0442.\u043a \u0440\u0430\u043d\u043d\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432).<\/p>\n<\/li>\n<li>\n<p><code>Z<\/code> (\u0431\u043e\u043b\u044c\u0448\u0430\u044f) &#8212; \u0435\u0441\u043b\u0438 volume \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0443\u044e <code>:z<\/code>:<\/p>\n<pre><code class=\"yaml\">services:  alpine-playground:    image: alpine:3.22    container_name: alpine-playground    volumes:      - .\/common:\/common:z    command: [\"sleep\", \"infinity\"]    restart: unless-stopped<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0437\u0430\u0439\u0434\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u0430\u043c.<\/p>\n<pre><code>gtosss@laptop-dc:~\/playground$ podman exec -it alpine-playground sh\/ # ls common\/message.txt\/ # cat common\/message.txt hello from host<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0437 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430:<\/p>\n<pre><code class=\"bash\">gtosss@laptop-dc:~\/playground$ ls -Z common\/system_u:object_r:container_file_t:s0:c384,c447 message.txt<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0438\u043f \u0444\u0430\u0439\u043b\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f: <code>user_home_t<\/code> \u2192 <code>container_file_t<\/code><\/p>\n<p>\u0418\u0442\u043e\u0433\u043e, \u0432 SELinux \u043f\u043e\u043c\u0438\u043c\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 unix \u043f\u0440\u0430\u0432 (DAC) \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0430\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 SELinux \u043f\u043e\u043b\u0438\u0442\u0438\u043a. \u0422\u0430\u043a \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u044b \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u0432 bind mount \u043f\u043e\u043a\u0440\u044b\u0442\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u043b\u043e\u0435\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u0441\u0447\u0435\u0442 SELinux \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<h3>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u0430\u044f \u2014 User namespace \u0438 UID\/GID mapping<\/h3>\n<p>\u0415\u0441\u043b\u0438 Docker \u043f\u0440\u0438\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 root \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043a root \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0430 \u0445\u043e\u0441\u0442\u0435, \u0442\u043e Podman \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043c\u0430\u043f\u0438\u043d\u0433 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e root \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043c\u043e\u0436\u0435\u0442 \u043c\u0430\u043f\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0445\u043e\u0441\u0442\u0435.<\/p>\n<p>\u0412\u0440\u0443\u0447\u043d\u0443\u044e, \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043c\u0430\u043f\u0438\u043d\u0433 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0444\u043b\u0430\u0433 <code>--uidmap container_uid:host_uid:amount<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code>podman run --uidmap 0:10000:5000 alpine<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0414\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 UID 0 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441 10000 \u0438 \u0442\u0430\u043a 5000 \u0440\u0430\u0437.<\/p>\n<p>\u0421\u043e\u0441\u0442\u0430\u0432\u043b\u044e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u043d\u0430 \u0445\u043e\u0441\u0442\u0435<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">0<\/p>\n<\/td>\n<td>\n<p align=\"left\">10000<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">1<\/p>\n<\/td>\n<td>\n<p align=\"left\">10001<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u2026<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2026<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">4999<\/p>\n<\/td>\n<td>\n<p align=\"left\">10499<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>5000 \u2014 \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0447\u0435\u0442 \u0438\u0434\u0435\u0442 \u0441 \u043d\u0443\u043b\u044f.<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0444\u043b\u0430\u0433 \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f: <code>--gidmap<\/code>.<\/p>\n<p>\u0412 <code>docker-compose.yml<\/code> \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a:<\/p>\n<pre><code>services:  alpine-playground:    image: alpine    x-podman:      uidmaps:        - \"0:100:100\"      gidmaps:        - \"0:100:100\"<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0442\u0430\u043a \u0436\u0435 \u043e\u0442 \u0444\u043b\u0430\u0433\u0430 <code>--userns<\/code> \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f <code>PODMAN_USERNS<\/code>. Podman \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 rootles \u0440\u0435\u0436\u0438\u043c\u0435, \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>PODMAN_USERNS<\/code> \u0440\u0430\u0432\u043d\u043e \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435, \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0431\u0443\u0434\u0435\u0442 \u043c\u0430\u043f\u0438\u043d\u0433:<\/p>\n<ul>\n<li>\n<p>0 \u2014 root \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u043c\u0430\u043f\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u2193<\/p>\n<\/li>\n<li>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>UID<\/code> (\u044d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0445\u0440\u0430\u043d\u0438\u0442 UID \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f).<\/p>\n<\/li>\n<\/ul>\n<p>\u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 root \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043c\u0430\u043f\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u043b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440.<\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435, <a href=\"https:\/\/docs.podman.io\/en\/v4.4\/markdown\/options\/userns.container.html\" rel=\"noopener noreferrer nofollow\">\u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0435\u0436\u0438\u043c\u043e\u0432 (\u0430\u043d\u0433\u043b. \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f)<\/a>. \u0412 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u0441\u0435\u0445 \u0440\u0435\u0436\u0438\u043c\u043e\u0432, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0440\u0435\u0436\u0438\u043c\u0430 <code>host<\/code>, \u043b\u0435\u0436\u0438\u0442 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0430\u044f\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u044b\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0437 \u0445\u043e\u0441\u0442\u0430:<\/p>\n<ul>\n<li>\n<p><code>keep-id<\/code> \u2014 <code>$UID:$GID<\/code> \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 = \u0442\u043e\u0442 \u0436\u0435 <code>$UID:$GID<\/code> \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435. \u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0434\u043b\u044f \u0432\u043e\u043b\u0443\u043c\u043e\u0432, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0430 \u0445\u043e\u0441\u0442\u0435.<\/p>\n<\/li>\n<li>\n<p><code>auto<\/code> \u2014 Podman \u0441\u0430\u043c \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0438\u0437 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 <code>\/etc\/subuid<\/code> <code>\/etc\/subgid<\/code>.<\/p>\n<\/li>\n<li>\n<p><code>host<\/code> \u2014 \u041d\u0435\u0442 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c user-namespace \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, root \u0432 \u0445\u043e\u0441\u0442\u0435 = root \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 (\u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e).<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u0438\u0442 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0447\u0442\u043e <code>$UID:$GID<\/code> \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\n<p><code>--user<\/code> \u2014 \u0427\u0435\u0440\u0435\u0437 CLI \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>podman run --user 1000:1000 alpine<\/code><\/p>\n<\/li>\n<li>\n<p><code>user: \"1000:1000\"<\/code> \u2014 \u0412 <code>docker-compose.yml<\/code><\/p>\n<\/li>\n<li>\n<p><code>USER 1000:1000<\/code> \u2014 \u0412 <code>Dockerfile<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043e\u0431\u0440\u0430\u0437\u0435 (\u0438\u043b\u0438 <code>root<\/code>, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0437\u0430\u0434\u0430\u043d <code>USER<\/code> \u0432 <code>Dockerfile<\/code> \u043e\u0431\u0440\u0430\u0437\u0430).<\/p>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043c\u0430\u043f\u0438\u043d\u0433\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 (user-namespace)<\/h3>\n<p>\u041c\u0430\u043f\u0438\u043d\u0433 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0435 \u044f\u0434\u0440\u0430 linux, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/man7.org\/linux\/man-pages\/man7\/namespaces.7.html\" rel=\"noopener noreferrer nofollow\">namespaces (\u0430\u043d\u0433\u043b. \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f)<\/a>. \u042d\u0442\u043e \u0442\u0435\u043c\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043e\u0431\u044a\u0435\u043c\u043d\u0430\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0443 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439 \u043e\u043d\u0431\u043e\u0440\u0434\u0438\u043d\u0433.<\/p>\n<p><code>namespaces<\/code> \u2014 \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u044f\u0434\u0440\u0430 \u043b\u0438\u043d\u0443\u043a\u0441. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0432 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f namespace (\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d). \u042d\u0442\u0430 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044e \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430.<\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u2014 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043a\u043e\u0440\u043e\u0431\u043a\u0443. \u041d\u0430 \u043d\u0435\u0439 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438, \u0447\u0442\u043e \u043e\u043d\u0430 \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0442\u0430\u043a\u0438\u043c-\u0442\u043e \u0438 \u0442\u0430\u043a\u0438\u043c-\u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c, \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0432 \u044d\u0442\u0443 \u043a\u043e\u0440\u043e\u0431\u043a\u0443 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043a\u0438\u043d\u0443\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438 \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e \u0441\u0430\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <code>namespaces<\/code>.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">Namespace<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0424\u043b\u0430\u0433 clone<\/p>\n<\/th>\n<th>\n<p align=\"left\">Man-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0418\u0437\u043e\u043b\u0438\u0440\u0443\u0435\u0442<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Cgroup<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>CLONE_NEWCGROUP<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/man7.org\/linux\/man-pages\/man7\/cgroup_namespaces.7.html#COLOPHON\" rel=\"noopener noreferrer nofollow\">cgroup_namespaces<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 cgroup \u2014 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 (RAM, CPU \u0438 \u0442\u0434)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">IPC<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>CLONE_NEWIPC<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/man7.org\/linux\/man-pages\/man7\/ipc_namespaces.7.html#COLOPHON\" rel=\"noopener noreferrer nofollow\">ipc_namespaces<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">System V IPC, \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 POSIX (\u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Network<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>CLONE_NEWNET<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/man7.org\/linux\/man-pages\/man7\/network_namespaces.7.html#COLOPHON\" rel=\"noopener noreferrer nofollow\">network_namespaces<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0435\u0442\u0435\u0432\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u0441\u0442\u0435\u043a\u0438, \u043f\u043e\u0440\u0442\u044b, \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0442.\u0434.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Mount<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>CLONE_NEWNS<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/man7.org\/linux\/man-pages\/man7\/mount_namespaces.7.html#COLOPHON\" rel=\"noopener noreferrer nofollow\">mount_namespaces<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0422\u043e\u0447\u043a\u0438 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0444\u0430\u0439\u043b\u043e\u0432\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">PID<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>CLONE_NEWPID<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/man7.org\/linux\/man-pages\/man7\/pid_namespaces.7.html#COLOPHON\" rel=\"noopener noreferrer nofollow\">pid_namespaces<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Time<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>CLONE_NEWTIME<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/man7.org\/linux\/man-pages\/man7\/time_namespaces.7.html\" rel=\"noopener noreferrer nofollow\">time_namespaces<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0427\u0430\u0441\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u043c\u043e\u043d\u043e\u0442\u043e\u043d\u043d\u044b\u0435 \u0447\u0430\u0441\u044b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">User<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>CLONE_NEWUSER<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/man7.org\/linux\/man-pages\/man7\/user_namespaces.7.html\" rel=\"noopener noreferrer nofollow\">user_namespaces<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0433\u0440\u0443\u043f\u043f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">UTS<\/p>\n<\/td>\n<td>\n<p align=\"left\"><code>CLONE_NEWUTS<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\"><a href=\"https:\/\/man7.org\/linux\/man-pages\/man7\/uts_namespaces.7.html\" rel=\"noopener noreferrer nofollow\">uts_namespaces<\/a><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0418\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0438 \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f NIS<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0418\u0437 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e, \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 Podman \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430  <code>user_namespaces<\/code> (\u043f\u0440\u0435\u0434\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435). \u041a\u0440\u0430\u0442\u043a\u043e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>\u042f\u0434\u0440\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432:<\/p>\n<ul>\n<li>\n<p><code>\/proc\/$pid\/uid_map<\/code> &#8212; \u0434\u043b\u044f \u043c\u0430\u043f\u0438\u043d\u0433\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439<\/p>\n<\/li>\n<li>\n<p><code>\/proc\/$pid\/gid_map<\/code> &#8212; \u0434\u043b\u044f \u043c\u0430\u043f\u0438\u043d\u0433\u0430 \u0433\u0440\u0443\u043f\u043f<\/p>\n<\/li>\n<\/ul>\n<p>\u0413\u0434\u0435 <code>$pid<\/code> \u2014 ID \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<\/p>\n<p>\u041f\u043e\u043d\u044f\u0442\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435. \u0415\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0439 podman \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440:<\/p>\n<pre><code>gtosss@laptop-dc:~$ podman ps CONTAINER ID  IMAGE                          COMMAND         CREATED      STATUS      PORTS       NAMEScc86938573d3  docker.io\/library\/alpine:3.22  sleep infinity  10 days ago  Up 10 days              alpine-playground<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c <code>uid_map<\/code> \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c pid \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0422\u0443\u0442 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <code>podman top &lt;ID \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430&gt;<\/code> \u2014 \u043e\u043d\u0430 \u043f\u043e\u043a\u0430\u0436\u0435\u0442, \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435:<\/p>\n<pre><code>gtosss@laptop-dc:~$ podman top cc8USER        PID         PPID        %CPU        ELAPSED             TTY         TIME        COMMANDroot        1           0           0.000       262h2m7.553624745s  ?           0s          sleep infinity <\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<ul>\n<li>\n<p>PID \u2014 Process ID.<\/p>\n<\/li>\n<li>\n<p>PPID \u2014 \u044d\u0442\u043e <code>Parent ID<\/code>, \u0442\u043e \u0435\u0441\u0442\u044c ID \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u043e \u043a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 docker, podman \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 PID \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0430 \u043d\u0435 \u0445\u043e\u0441\u0442\u043e\u0432\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u2014 \u0438\u043d\u0430\u0447\u0435 \u0431\u044b \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0447\u0435\u043c 0 \u0438\u043b\u0438 1. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0445\u043e\u0441\u0442\u043e\u0432\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0441 \u0431\u0443\u043a\u0432\u044b <code>h<\/code> (\u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 host), \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>hpid<\/code>:<\/p>\n<pre><code>gtosss@laptop-dc:~$ podman top cc8 hpidHPID404796<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u043d\u0430\u044f PID \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0430\u0439\u043b:<\/p>\n<pre><code>gtosss@laptop-dc:~$ cat \/proc\/404796\/uid_map          0       1000          1         1     524288      65536<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0427\u0438\u0442\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 Podman <code>--uidmap<\/code>. \u0412\u044b\u0448\u0435 \u044f \u0443\u0436\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u043d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u0443\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u2014 User ID \u0432\u043d\u0443\u0442\u0440\u0438 namespace (\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430)<\/p>\n<\/li>\n<li>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u2014 User ID \u0441\u043d\u0430\u0440\u0443\u0436\u0438 namespace (\u043d\u0430 \u0445\u043e\u0441\u0442\u0435)<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0442\u0438\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u2014 \u041a\u043e\u043b-\u0432\u043e \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 (range \u2014 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d)<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 <code>0<\/code> (root \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435) c <code>1000<\/code> (gtosss \u043d\u0430 \u0445\u043e\u0441\u0442\u0435) \u043e\u0434\u0438\u043d \u0440\u0430\u0437.<\/p>\n<p>\u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 1 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441 UID 524288 \u0438 \u0442\u0430\u043a 65536 \u0440\u0430\u0437.<\/p>\n<ul>\n<li>\n<p>1 \u2192 524288<\/p>\n<\/li>\n<li>\n<p>2 \u2192 524289<\/p>\n<\/li>\n<li>\n<p>3 \u2192 524290<\/p>\n<\/li>\n<li>\n<p>\u0438 \u0442\u0430\u043a 65536 \u0440\u0430\u0437.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f? \u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f user namespaces \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0441\u043e\u0437\u0434\u0430\u043b podman, \u0430 \u0435\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u0430\u043f\u0438\u043d\u0433\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0444\u043b\u0430\u0433\u043e\u043c <code>--userns<\/code> \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f <code>PODMAN_USERNS<\/code>. \u0415\u0441\u043b\u0438 \u0442\u0430\u043c <code>auto<\/code>, \u0442\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u0437\u044f\u0442\u0430 \u0438\u0437 <code>\/etc\/subuid<\/code>. \u0417\u0430\u0433\u043b\u044f\u043d\u0435\u043c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433:<\/p>\n<pre><code>gtosss@laptop-dc:~$ sudo cat \/etc\/subuidgtosss:524288:65536<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u043a\u0430\u043a \u0440\u0430\u0437 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<hr\/>\n<h3>\u0418\u0442\u043e\u0433\u043e<\/h3>\n<ul>\n<li>\n<p>Docker \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f namespaces, \u0438 root \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 = root \u043d\u0430 \u0445\u043e\u0441\u0442\u0435.<\/p>\n<\/li>\n<li>\n<p>Podman \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c user namespaces, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044f\u0434\u0440\u0430 Linux, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c Docker \u0443\u043c\u0435\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/docs.docker.com\/engine\/security\/rootless\/\" rel=\"noopener noreferrer nofollow\">\u0440\u0435\u0436\u0438\u043c\u0435 Rootles mode<\/a> \u2014 \u043d\u043e \u044d\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439.<\/p>\n<hr\/>\n<p>\u041e\u0431 \u0430\u0432\u0442\u043e\u0440\u0435<\/p>\n<ul>\n<li>\n<p>10 \u043b\u0435\u0442 \u0432 IT \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u043a\u0430\u0440\u044c\u0435\u0440\u044b FullStack \u0438 DevOps.<\/p>\n<\/li>\n<li>\n<p>\u0412\u0435\u0434\u0443 <a href=\"https:\/\/t.me\/gtosss_group\" rel=\"noopener noreferrer nofollow\">\u0442\u0433-\u043a\u0430\u043d\u0430\u043b<\/a> \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043f\u0438\u0448\u0443 \u0432\u0441\u0435 \u0447\u0442\u043e \u0434\u0443\u043c\u0430\u044e \u043e\u0431 IT \u0438 \u043d\u0430\u0448\u0435\u043c \u0431\u0443\u0434\u0443\u0449\u0435\u043c, \u0447\u0430\u0441\u0442\u043e \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u044e \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0432\u0430\u0436\u043d\u044b\u0435 \u0442\u0435\u043c\u044b, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e \u0430\u043a\u0442\u0438\u0432\u0438\u0441\u0442\u043e\u0432 \u0438 \u043f\u0440\u0430\u0432\u043e\u0437\u0430\u0449\u0438\u0442\u043d\u0438\u043a\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0433\u043e\u0434\u044b \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0432 \u0441\u0435\u0431\u044f \u043d\u0430 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u043e\u043b\u0436\u043d\u043e\u0441\u0442\u044f\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u0442\u044c \u0441\u043a\u0440\u043e\u043c\u043d\u044b\u0439 \u043e\u043f\u044b\u0442 \u043f\u0440\u0435\u0434\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1040300\/\">https:\/\/habr.com\/ru\/articles\/1040300\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d, \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e\u0442 \u044f\u0434\u0440\u043e \u0441 \u0445\u043e\u0441\u0442\u043e\u043c. \u042d\u0442\u043e \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u0432\u0430\u0436\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u043a\u0430\u043a Unix-\u043f\u0440\u0430\u0432\u0430 \u0441\u043e\u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u043c\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u0438 \u0445\u043e\u0441\u0442\u043e\u0432\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u043e\u0439?\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c volume \u2014 bind mount \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441 \u0445\u043e\u0441\u0442\u0430, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043b\u0435\u0436\u0438\u0442 \u0444\u0430\u0439\u043b config.yml:\/some-volume\/config.yml\u0415\u0441\u043b\u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u0443 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 root \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u2014 \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u044d\u0442\u043e \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 root \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430?\u0415\u0441\u043b\u0438 \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c gtosss \u2014 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u0443?\u0415\u0441\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f gtosss \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u0432\u044b\u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0444\u0430\u0439\u043b \u2014 \u0441\u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0445\u043e\u0441\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u043f\u043e\u0434 \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c?\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u0432\u043e\u043f\u0440\u043e\u0441 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u0435 \u2014 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0432\u0430\u0441.\u041f\u0435\u0440\u0435\u0434 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435\u043c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u2014 \u041f\u0440\u0430\u0432\u0430 \u0432 Linux: chown\/chmod, SELinux context, \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u0430\u044f\/\u0432\u043e\u0441\u044c\u043c\u0435\u0440\u0438\u0447\u043d\u0430\u044f \u043d\u043e\u0442\u0430\u0446\u0438\u044f, DAC\/MAC\/RBAC\/ABAC\u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c\u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0433\u043e\u043b\u043e\u0432\u0435, \u2014 \u044f\u0434\u0440\u043e \u043e\u043f\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u0435 \u0438\u043c\u0435\u043d\u0430\u043c\u0438, \u0430 \u0430\u0439\u0434\u0438\u0448\u043d\u0438\u043a\u0430\u043c\u0438 UID \u0438 GID:UID \u2014 User IDGID \u2014 Group ID\u0421\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0438\u0445 ID \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \/etc\/passwd.\u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0438\u0434\u0430:gtosss:x:1000:1000:gtosss:\/home\/gtosss:\/bin\/bash\u042d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c :\u0420\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0441\u0442\u0440\u043e\u043a \u0438\u0437 \/etc\/passwd\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0443 \u0434\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432\u041e\u043f\u0438\u0448\u0435\u043c docker-compose.ymlservices:  alpine-playground:    image: alpine:3.22    container_name: alpine-playground    volumes:      &#8212; .\/common:\/common    command: [&#171;sleep&#187;, &#171;infinity&#187;]    restart: unless-stopped\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441 \u0444\u0430\u0439\u043b\u043e\u043c \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u0442\u0435\u043a\u0441\u0442.mkdir commonecho &#8216;hello from host&#8217; &gt; docker-common\/message.txt\u041e\u0442\u0432\u0435\u0447\u0430\u0435\u043c \u043d\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432 Ubuntu 221. \u0415\u0441\u043b\u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u0443 \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 root \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u2014 \u0431\u0443\u0434\u0435\u0442 \u043b\u0438 \u044d\u0442\u043e \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 root \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430?\u041d\u0430 \u0445\u043e\u0441\u0442\u0435 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f gtosss \u0441 UID 1000. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0438 \u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0430\u0442 \u0435\u043c\u0443. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u044f \u0437\u0430\u043f\u0443\u0449\u0443 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438 \u0437\u0430\u0439\u0434\u0443 \u0432\u043d\u0443\u0442\u0440\u044c \u043d\u0435\u0433\u043edocker exec -it alpine-playground sh\u0412\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u044f root, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0444\u0430\u0439\u043b \u0438\u0437 \u0432\u043e\u043b\u0443\u043c\u0430:\/ # ls -l commontotal 4-rw-r&#8212;r&#8212;    1 1000     1000            16 May  9 22:22 message.txt\u0412\u043c\u0435\u0441\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441\u0440\u0430\u0437\u0443 UID \u0438 GID. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0443\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.\/common # stat message.txt  File: message.txt  Size: 16              Blocks: 8          IO Block: 4096   regular fileDevice: 820h\/2080d      Inode: 17210       Links: 1Access: (0644\/-rw-r&#8212;r&#8212;)  Uid: ( 1000\/ UNKNOWN)   Gid: ( 1000\/ UNKNOWN)Uid: ( 1000\/ UNKNOWN) \u2014 UID 1000, \u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043a\u0430\u043a \u0438 \u0433\u0440\u0443\u043f\u043f\u0430, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043d\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b. UNKNOWN (\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d) \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u0441\u0432\u043e\u0439 \u0444\u0430\u0439\u043b \/etc\/passwd, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 gtosss \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b\u0441\u044f.\u0418 \u0432\u0440\u043e\u0434\u0435 \u0432\u0441\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0434\u043b\u044f \u0432\u0441\u0435\u0445, \u043a\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c, \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0447\u0442\u0435\u043d\u0438\u0435:0644\/-rw-r&#8212;r&#8212;   \u2191        \u2191\u0427\u0438\u0442\u0430\u0435\u043c \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c:\/ # cat common\/message.txthello from host\u0410 \u043c\u043e\u0436\u0435\u0442 \u0434\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044f\u0434\u0440\u043e linux \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043c\u0435\u043d\u044f root\u2019\u043e\u043c? \u0427\u0442\u043e \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0437\u0430\u043f\u0438\u0441\u0438:echo &#8216;hello from container&#8217; &gt;&gt; message.txt\u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b. \u0423\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441 \u0445\u043e\u0441\u0442\u0430:\/common # cat message.txthello from hosthello from container\u0412\u044b\u0445\u043e\u0434\u0438\u0442, \u043c\u044b \u0431\u0443\u0434\u0443\u0447\u0438 \u0440\u0443\u0442\u043e\u043c \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0443\u0431\u0435\u0434\u0438\u043b\u0438 \u044f\u0434\u0440\u043e linux \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u044f\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u0440\u0443\u0442\u043e\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u0435\u0436\u0438\u0442 \u0432 \u0445\u043e\u0441\u0442\u043e\u0432\u043e\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.\u041d\u0430 \u0445\u043e\u0441\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c \u0444\u0430\u0439\u043b\u0430 root \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u043c\u0443 \u0434\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0430.\u041d\u0430 \u0445\u043e\u0441\u0442\u0435 \u043c\u0435\u043d\u044f\u0435\u043c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430 \u0444\u0430\u0439\u043b\u0430 \u043d\u0430 \u0440\u0443\u0442\u0430, \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430. \u0418\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f:ls -ltotal 4-rw&#8212;&#8212;- 1 root root 60 May 10 18:00 message.txt\u0412\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u0440\u0443\u0442\u0443 \u0438 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043a \u043d\u0435\u043c\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u0430:\u0417\u0430\u0439\u0434\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u0435\u0433\u0440\u0430\u0434, \u0447\u0442\u043e\u0431\u044b \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b, \u0432 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c:\/common # echo &#8216;hello from container 2&#8217; &gt;&gt; message.txt\u0412\u044b\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u0438 \u0441 \u0445\u043e\u0441\u0442\u0430, \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0441\u0443\u043f\u0435\u0440-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0447\u0438\u0442\u0430\u0435\u043c:sudo cat message.txt\u0412\u0438\u0434\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435:hello from hosthello from containerhello from container 2\u0414\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u0432 Ubuntu, root \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430, \u044d\u0442\u043e \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 root \u0447\u0442\u043e \u0438 \u0432 \u0445\u043e\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u042f\u0434\u0440\u043e \u043b\u0438\u043d\u0443\u043a\u0441 \u0434\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0443\u043f\u0435\u0440-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. \u0414\u043b\u044f \u043d\u0435\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430, \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0438\u0441\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u0435. \u041c\u043e\u0436\u043d\u043e \u043d\u0435\u043e\u0441\u043e\u0437\u043d\u0430\u043d\u043d\u043e \u0434\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0440\u0443\u0442\u043e\u0432\u043e\u0439 \u0411\u0414, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0443.2. \u0415\u0441\u043b\u0438 \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c gtosss \u2014 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u0443?\u041d\u0430 \u0445\u043e\u0441\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c \u0444\u0430\u0439\u043b\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f gtosss. \u0414\u043e\u0441\u0442\u0443\u043f\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0442\u0430\u043a:Access: (0600\/-rw&#8212;&#8212;-)  Uid: ( 1001\/  gtosss)   Gid: ( 1002\/  gtosss)\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043f\u0440\u044b\u0433\u0438\u0432\u0430\u0435\u043c \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f gtosss \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a\u043e\u0439 \u0443 \u043d\u0435\u0433\u043e UID.\/ $ cat etc\/passwd | grep gtosssgtosss:x:1000:1000::\/home\/gtosss:\/bin\/sh\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e UID \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f gtosss \u2014 1000. \u041d\u0430 \u0445\u043e\u0441\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0438\u043c\u0435\u0435\u0442 UID 1001. \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0444\u0430\u0439\u043b:\/common $ cat message.txtcat: can&#8217;t open &#8216;message.txt&#8217;: Permission denied\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0442\u043e\u0442 \u0436\u0435 \u0441\u0430\u043c\u044b\u0439 UID \u0447\u0442\u043e \u0443 \u043d\u0430 \u0445\u043e\u0441\u0442\u0435. \u041d\u0430 linux alpine \u0443\u0442\u0438\u043b\u0438\u0442\u0430 usermod \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043a\u0435\u0442 shadow \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430:apk add shadow\u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c UID 1001usermod -u 1001 gtosss\u0418 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:\/ $ cat \/common\/message.txthello from hosthello from containerhello from container 2\u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u0443, \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u043c\u0441\u044f, \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u044e\u0437\u0435\u0440\u0430 \u0441 \u0442\u0435\u043c \u0436\u0435 UID. \u041f\u0440\u0438\u0447\u0435\u043c \u0438\u043c\u044f \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u044f\u0434\u0440\u043e \u043b\u0438\u043d\u0443\u043a\u0441 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e ID \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0433\u0440\u0443\u043f\u043f\u044b.3. \u0415\u0441\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u0432\u044b\u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0444\u0430\u0439\u043b \u2014 \u0441\u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u0445\u043e\u0441\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443 \u043f\u043e\u0434 \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c?\u0414\u0443\u043c\u0430\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u043d\u0438\u0439 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0434\u0430\u0436\u0435 \u0431\u0435\u0437 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432. \u0420\u0435\u0448\u0430\u044e\u0449\u0438\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432 \u043a \u0444\u0430\u0439\u043b\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f UID. \u0422\u0443\u0442 \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u0430\u043a \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u0435.\u041e\u0442\u0432\u0435\u0447\u0430\u0435\u043c \u043d\u0430 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432 SELinux (Fedora Linux)\u041d\u0430 \u0441\u0432\u043e\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Fedora, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u044f\u0434\u0440\u0430 SELinux (Security-Enhanced Linux). SELinux \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0438\u0442\u0438\u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u0412\u043c\u0435\u0441\u0442\u043e Docker \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e Podman \u2014 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0438\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439, \u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. Podman \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0431\u0435\u0437 \u043f\u0440\u0430\u0432 root (\u0440\u0435\u0436\u0438\u043c rootles), \u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.\u041d\u0430 \u0445\u043e\u0441\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0435\u0440\u0435\u0437 ls -l \u043a\u0430\u043a\u0438\u0435 \u0443 \u0444\u0430\u0439\u043b\u0430 \u043f\u0440\u0430\u0432\u0430-rwxr&#8212;r&#8212;. 1 gtosss gtosss 16 May  9 09:48 message.txt\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0439\u0434\u0435\u043c \u0432\u043d\u0443\u0442\u0440\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0438\u0437\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430gtosss@laptop-dc:~\/playground$ podman exec -it alpine-playground sh\u0412 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043c\u044b root, \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \/common:\/common # ls -lls: can&#8217;t open &#8216;.&#8217;: Permission denied\u041d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b unix \u043f\u0440\u0430\u0432 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0435\u0442. \u041d\u0430 Ubuntu \u043c\u044b \u0438\u043c\u0435\u043b\u0438 \u0431\u044b \u0434\u043e\u0441\u0442\u0443\u043f, \u043d\u043e \u0442\u0443\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 SELinux \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 Podman. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0432\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 SELinux \u0438 Podman \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 Ubuntu \u0438 Docker.\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u0430\u044f \u2014 SELinux \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432\u0412\u044b\u0445\u043e\u0434\u0438\u043c \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c context SELinux \u0447\u0435\u0440\u0435\u0437 stat:gtosss@laptop-dc:~\/playground$ stat common   File: common  Size: 22              Blocks: 0          IO Block: 4096   directoryDevice: 0,44    Inode: 3457892     Links: 1Access: (0744\/drwxr&#8212;r&#8212;)  Uid: ( 1000\/  gtosss)   Gid: ( 1000\/  gtosss)Context: unconfined_u:object_r:user_home_t:s0\u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u044d\u0442\u0430 \u0441\u0442\u0440\u043e\u043a\u0430:Context: unconfined_u:object_r:user_home_t:s0\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043e \u043f\u0440\u0430\u0432\u0430\u0445 linux \u0435\u0441\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u0415\u0441\u043b\u0438 \u043e\u043d\u0430 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u0430, \u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0442\u0430\u0442\u044c\u0435\u0439. \u0410 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0441 \u043e\u0431\u043d\u043e\u0440\u0434\u0438\u043d\u0433\u043e\u043c \u043f\u043e SELinux \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u043e \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430\u0445 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438.\u0417\u0434\u0435\u0441\u044c \u043f\u0440\u0430\u0432\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u0442\u0438\u043f\u043e\u043c user_home_t. \u0414\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0444\u0430\u0439\u043b \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u0438\u043c\u0435\u044e\u0442 \u0441\u0430\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0438\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (user_t, staff_t) \u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0442\u0438\u043f\u0430 unconfined_t. \u041f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0435\u0442\u043a\u0443 \u0434\u043b\u044f \u0432\u043e\u043b\u0443\u043c\u0430 (bind mount), \u0447\u0442\u043e\u0431\u044b Podman \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u043b \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u0443.\u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Docker \u0438 Podman:z (\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f) &#8212; \u0435\u0441\u043b\u0438 volume \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 (\u043d\u0430\u0448 \u0441\u043b\u0443\u0447\u0430\u0439, \u0442.\u043a \u0440\u0430\u043d\u043d\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432).Z (\u0431\u043e\u043b\u044c\u0448\u0430\u044f) &#8212; \u0435\u0441\u043b\u0438 volume \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440.\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0443\u044e :z:services:  alpine-playground:    image: alpine:3.22    container_name: alpine-playground    volumes:      &#8212; .\/common:\/common:z    command: [&#171;sleep&#187;, &#171;infinity&#187;]    restart: unless-stopped\u0422\u0435\u043f\u0435\u0440\u044c, \u0437\u0430\u0439\u0434\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0444\u0430\u0439\u043b\u0430\u043c.gtosss@laptop-dc:~\/playground$ podman exec -it alpine-playground sh\/ # ls common\/message.txt\/ # cat common\/message.txt hello from host\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430 \u0445\u043e\u0441\u0442\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0437 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430:gtosss@laptop-dc:~\/playground$ ls -Z common\/system_u:object_r:container_file_t:s0:c384,c447 message.txt\u0422\u0438\u043f \u0444\u0430\u0439\u043b\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f: user_home_t \u2192 container_file_t\u0418\u0442\u043e\u0433\u043e, \u0432 SELinux \u043f\u043e\u043c\u0438\u043c\u043e \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0445 unix \u043f\u0440\u0430\u0432 (DAC) \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u043e\u0433\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u0432, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0430\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 SELinux \u043f\u043e\u043b\u0438\u0442\u0438\u043a. \u0422\u0430\u043a \u0447\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u044b \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u0432 bind mount \u043f\u043e\u043a\u0440\u044b\u0442\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u043b\u043e\u0435\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u0441\u0447\u0435\u0442 SELinux \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0444\u0430\u0439\u043b\u043e\u0432.\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u0430\u044f \u2014 User namespace \u0438 UID\/GID mapping\u0415\u0441\u043b\u0438 Docker \u043f\u0440\u0438\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 root \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043a root \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0430 \u0445\u043e\u0441\u0442\u0435, \u0442\u043e Podman \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043c\u0430\u043f\u0438\u043d\u0433 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e root \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 \u043c\u043e\u0436\u0435\u0442 \u043c\u0430\u043f\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0445\u043e\u0441\u0442\u0435.\u0412\u0440\u0443\u0447\u043d\u0443\u044e, \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043c\u0430\u043f\u0438\u043d\u0433 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0444\u043b\u0430\u0433 &#8212;uidmap container_uid:host_uid:amount. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:podman run &#8212;uidmap 0:10000:5000 alpine\u0414\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 UID 0 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441 10000 \u0438 \u0442\u0430\u043a 5000 \u0440\u0430\u0437.\u0421\u043e\u0441\u0442\u0430\u0432\u043b\u044e \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439, \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f:\u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435\u043d\u0430 \u0445\u043e\u0441\u0442\u0435010000110001\u2026\u20264999104995000 \u2014 \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0447\u0435\u0442 \u0438\u0434\u0435\u0442 \u0441 \u043d\u0443\u043b\u044f.\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0444\u043b\u0430\u0433 \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f: &#8212;gidmap.\u0412 docker-compose.yml \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a:services:  alpine-playground:    image: alpine    x-podman:      uidmaps:        &#8212; &#171;0:100:100&#187;      gidmaps:        &#8212; &#171;0:100:100&#8243;\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u0442\u0430\u043a \u0436\u0435 \u043e\u0442 \u0444\u043b\u0430\u0433\u0430 &#8212;userns \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f PODMAN_USERNS&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-481295","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/481295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=481295"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/481295\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=481295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=481295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=481295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}