Copy files from LXC to host machine

5,947

Solution 1

I can do it the other way around. So SCP a local folder on the LXC container to the host machine:

scp -r /root/[container folder] [email protected]:/root/[host folder to put files in]

Solution 2

Install a SSH server on your LXC container. Allow connections from remote hosts to port TCP 22. From your own machine connect to your LXC container using SCP with WinSCP (for Windows). In case you are using Linux on your own machine just use the scp command from console.

Share:
5,947
Tina J
Author by

Tina J

Updated on September 18, 2022

Comments

  • Tina J
    Tina J over 1 year

    I'm new to containers. I have a LXC container running on a remote linux machine. All I found online is how to copy files from host to LXC container. But how can I copy files from a running LXC container to the host, and eventually to my own machine?

    Maybe it seems trivial that I couldn't find anything. I'm new and am a bit confused.

  • Tina J
    Tina J over 6 years
    10.0.3.1 is the interface IP shown on the host.
  • Jaime Hablutzel
    Jaime Hablutzel almost 6 years
    You are unnecesarily exposing SSH service in your container. See my comment in the OP question.