[lxc-users] What's the best way to copy file from host to container?

Fiedler Roman Roman.Fiedler at ait.ac.at
Mon Apr 27 06:14:26 UTC 2015


> Von: lxc-users [mailto:lxc-users-bounces at lists.linuxcontainers.org] Im 
> Auftrag
>
> Hi Andrey,
>
> This seems to be the perfect solution, I can just copy over to the path like
> proc/12423/root/usr/local, without worrying about snapshot clone uses
> delta0, rather than root in the container folder. After I moved the file, I 
> still
> need to update the file permissions and ownership though.

What about packing the files with e.g. cpio on the host and injecting them via 
pipe to ns-attached cpio-process running in guest scope.

This also works around guest to host privilege escalation if malicious guest 
content moves around fs-tree parts while copying.

Roman

> On Fri, Apr 24, 2015 at 2:43 PM, Andrey <anrdaemon at yandex.ru> wrote:
>
>
> 	Greetings, Dan Shi.
>
> 	Saturday, April 25, 2015, 00:37:27 you wrote:
>
> 	DS> I need to deploy some config files, e.g., .ssh config,  key file etc, 
> to
> 	DS> container. I can copy the files to the absolute path in  container,
> e.g.,
> 	DS> /usr/local/containers/base/rootfs/root/.ssh/
>
> 	DS> The  problem is that, I have to change the owner and permission
> of the
> 	DS> files  manually. I'm wondering if there is a better way to do it, like
> scp?
>
> 	ls -l /proc/$(lxc-info -n $NAME -p -H)/
>
> 	Courtesy @stgraber
>
>
> 	--
> 	Sincerely,
> 	Andrey
> 	Saturday, April 25, 2015 00:41:52
>
> 	Sorry for my terrible english...
>
> 	_______________________________________________
> 	lxc-users mailing list
> 	lxc-users at lists.linuxcontainers.org
> 	http://lists.linuxcontainers.org/listinfo/lxc-users
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6344 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20150427/7f7bc8fc/attachment.bin>


More information about the lxc-users mailing list